This commit is contained in:
Erwan Croze 2019-01-10 10:53:34 +01:00
parent 4546ddb353
commit a60787413f
6 changed files with 47 additions and 6 deletions

View file

@ -88,8 +88,8 @@
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:gravity="center_vertical|center_horizontal"
android:paddingBottom="10dp"
android:paddingTop="10dp">
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:id="@+id/contact_picture"
@ -97,7 +97,7 @@
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_contact_picture"
android:src="@drawable/avatar_big_secure1"/>
android:src="@drawable/avatar_big_secure1" />
<ImageView
android:id="@+id/mask"
@ -106,7 +106,7 @@
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_contact_picture"
android:src="@drawable/avatar_mask_border"
android:visibility="gone"/>
android:visibility="gone" />
</RelativeLayout>

View file

@ -133,9 +133,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal|center"
android:layout_marginRight="5dp"
android:foregroundGravity="center"
android:src="@drawable/chat_file_message"
android:visibility="gone"/>
android:visibility="gone" />
<TextView
android:id="@+id/lastMessageSender"

View file

@ -935,7 +935,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
Log.i("[Doze Mode]: unregister");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try {
if(dozeModeEnabled)
if(mDozeReceiver != null)
mServiceContext.unregisterReceiver(mDozeReceiver);
} catch (IllegalArgumentException e) {
e.printStackTrace();

View file

@ -1611,6 +1611,9 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
return true;
}
break;
case MESSAGE_IMDN:
popBackStack();
return true;
case GROUP_CHAT:
LinphoneActivity.instance().goToChatList();
return true;

View file

@ -1661,12 +1661,19 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
}
boolean isConfPaused = false;
boolean callDisplayed = false;
for (Call call : LinphoneManager.getLc().getCalls()) {
if (call.getConference() != null && !isConferenceRunning) {
isConfPaused = true;
index++;
} else {
if (call != LinphoneManager.getLc().getCurrentCall() && !(call.getConference() != null)) {
if (!callDisplayed && LinphoneManager.getLc().getCurrentCall() == null) {
Address lAddress = call.getRemoteAddress();
TextView contactName = (TextView) findViewById(R.id.current_contact_name);
setContactInformation(contactName, contactPicture, lAddress);
callDisplayed = true;
}
displayPausedCalls(resources, call, index);
index++;
} else {

View file

@ -26,6 +26,7 @@ import org.linphone.LinphonePreferences;
import org.linphone.LinphoneService;
import org.linphone.R;
import org.linphone.core.Core;
import org.linphone.core.CoreListenerStub;
import org.linphone.core.Factory;
import org.linphone.core.LogCollectionState;
import org.linphone.mediastream.Log;
@ -33,6 +34,7 @@ import org.linphone.mediastream.Log;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@ -91,9 +93,36 @@ public class Digit extends Button implements AddressAware {
private class DialKeyListener implements OnClickListener, OnTouchListener, OnLongClickListener {
final char mKeyCode;
boolean mIsDtmfStarted;
CoreListenerStub mListener;
DialKeyListener() {
mKeyCode = Digit.this.getText().subSequence(0, 1).charAt(0);
mListener =
new CoreListenerStub() {
@Override
public void onLogCollectionUploadProgressIndication(
Core lc, int offset, int total) {}
@Override
public void onLogCollectionUploadStateChanged(Core lc, Core.LogCollectionUploadState state, String info) {
if (state == Core.LogCollectionUploadState.Delivered) {
final String appName = LinphoneService.instance().getApplicationContext().getString(R.string.app_name);
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_EMAIL, new String[]{ LinphoneService.instance().getApplicationContext().getString(R.string.about_bugreport_email) });
i.putExtra(Intent.EXTRA_SUBJECT, appName + " Logs");
i.putExtra(Intent.EXTRA_TEXT, info);
i.setType("application/zip");
try {
LinphoneService.instance().getApplicationContext().startActivity(Intent.createChooser(i, "Send mail..."));
lc.removeListener(mListener);
} catch (android.content.ActivityNotFoundException ex) {
Log.e(ex);
}
}
}
};
}
private boolean linphoneServiceReady() {
@ -144,6 +173,7 @@ public class Digit extends Button implements AddressAware {
if(which == 1) {
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
if (lc != null) {
lc.addListener(mListener);
lc.uploadLogCollection();
}
}