Fixed crash when going into android app settings and going back to linphone
This commit is contained in:
parent
9d1cfe2ea5
commit
49b45cab09
2 changed files with 10 additions and 3 deletions
|
@ -123,6 +123,8 @@ import org.linphone.xmlrpc.XmlRpcListenerBase;
|
||||||
|
|
||||||
public class LinphoneActivity extends LinphoneGenericActivity
|
public class LinphoneActivity extends LinphoneGenericActivity
|
||||||
implements OnClickListener, ActivityCompat.OnRequestPermissionsResultCallback {
|
implements OnClickListener, ActivityCompat.OnRequestPermissionsResultCallback {
|
||||||
|
public static final int ANDROID_APP_SETTINGS_ACTIVITY = 300;
|
||||||
|
|
||||||
private static final int SETTINGS_ACTIVITY = 123;
|
private static final int SETTINGS_ACTIVITY = 123;
|
||||||
private static final int CALL_ACTIVITY = 19;
|
private static final int CALL_ACTIVITY = 19;
|
||||||
private static final int PERMISSIONS_REQUEST_OVERLAY = 206;
|
private static final int PERMISSIONS_REQUEST_OVERLAY = 206;
|
||||||
|
@ -1118,7 +1120,9 @@ public class LinphoneActivity extends LinphoneGenericActivity
|
||||||
mNewProxyConfig = getIntent().getExtras().getBoolean("isNewProxyConfig");
|
mNewProxyConfig = getIntent().getExtras().getBoolean("isNewProxyConfig");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultCode == Activity.RESULT_FIRST_USER && requestCode == SETTINGS_ACTIVITY) {
|
if (requestCode == ANDROID_APP_SETTINGS_ACTIVITY) {
|
||||||
|
LinphoneActivity.instance().goToDialerFragment();
|
||||||
|
} else if (resultCode == Activity.RESULT_FIRST_USER && requestCode == SETTINGS_ACTIVITY) {
|
||||||
if (data.getExtras().getBoolean("Exit", false)) {
|
if (data.getExtras().getBoolean("Exit", false)) {
|
||||||
quit();
|
quit();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1761,7 +1761,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(Preference preference) {
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
synchronized (SettingsFragment.this) {
|
synchronized (SettingsFragment.this) {
|
||||||
Context context = SettingsFragment.this.getActivity();
|
Context context = LinphoneActivity.instance();
|
||||||
Intent i = new Intent();
|
Intent i = new Intent();
|
||||||
i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
i.addCategory(Intent.CATEGORY_DEFAULT);
|
i.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
@ -1769,7 +1769,10 @@ public class SettingsFragment extends PreferenceFragment {
|
||||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
|
i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
|
||||||
i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
||||||
context.startActivity(i);
|
LinphoneActivity.instance()
|
||||||
|
.startActivityForResult(
|
||||||
|
i,
|
||||||
|
LinphoneActivity.ANDROID_APP_SETTINGS_ACTIVITY);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue