Improved LinphoneActivity lifecycle
This commit is contained in:
parent
3dd96e828e
commit
bd498252e6
3 changed files with 11 additions and 10 deletions
|
@ -203,10 +203,6 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
}
|
||||
}
|
||||
|
||||
if (getIntent() != null && getIntent().getExtras() != null) {
|
||||
newProxyConfig = getIntent().getExtras().getBoolean("isNewProxyConfig");
|
||||
}
|
||||
|
||||
if (getResources().getBoolean(R.bool.use_linphone_tag)) {
|
||||
if (getPackageManager().checkPermission(Manifest.permission.WRITE_SYNC_SETTINGS, getPackageName()) != PackageManager.PERMISSION_GRANTED) {
|
||||
checkSyncPermission();
|
||||
|
@ -1165,6 +1161,10 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
|
|||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (getIntent() != null && getIntent().getExtras() != null) {
|
||||
newProxyConfig = getIntent().getExtras().getBoolean("isNewProxyConfig");
|
||||
}
|
||||
|
||||
if (resultCode == Activity.RESULT_FIRST_USER && requestCode == SETTINGS_ACTIVITY) {
|
||||
if (data.getExtras().getBoolean("Exit", false)) {
|
||||
quit();
|
||||
|
|
|
@ -262,6 +262,7 @@ private static AssistantActivity instance;
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
boolean firstLaunch = LinphonePreferences.instance().isFirstLaunch();
|
||||
|
||||
if (id == R.id.assistant_cancel) {
|
||||
hideKeyboard();
|
||||
|
@ -269,8 +270,7 @@ private static AssistantActivity instance;
|
|||
if (getResources().getBoolean(R.bool.assistant_cancel_move_to_back)) {
|
||||
moveTaskToBack(true);
|
||||
} else {
|
||||
LinphonePreferences.instance().firstLaunchSuccessful();
|
||||
startActivity(new Intent().setClass(this, LinphoneActivity.class));
|
||||
if (firstLaunch) startActivity(new Intent().setClass(this, LinphoneActivity.class));
|
||||
finish();
|
||||
}
|
||||
} else if (id == R.id.back) {
|
||||
|
@ -284,13 +284,14 @@ private static AssistantActivity instance;
|
|||
if (isLink) {
|
||||
return;
|
||||
}
|
||||
boolean firstLaunch = LinphonePreferences.instance().isFirstLaunch();
|
||||
if (currentFragment == firstFragment) {
|
||||
LinphonePreferences.instance().firstLaunchSuccessful();
|
||||
if (getResources().getBoolean(R.bool.assistant_cancel_move_to_back)) {
|
||||
moveTaskToBack(true);
|
||||
} else {
|
||||
LinphonePreferences.instance().firstLaunchSuccessful();
|
||||
startActivity(new Intent().setClass(this, LinphoneActivity.class));
|
||||
if (firstLaunch) startActivity(new Intent().setClass(this, LinphoneActivity.class));
|
||||
finish();
|
||||
}
|
||||
} else if (currentFragment == AssistantFragmentsEnum.LOGIN
|
||||
|
@ -299,6 +300,7 @@ private static AssistantActivity instance;
|
|||
|| currentFragment == AssistantFragmentsEnum.REMOTE_PROVISIONING) {
|
||||
displayMenu();
|
||||
} else if (currentFragment == AssistantFragmentsEnum.WELCOME) {
|
||||
if (firstLaunch) startActivity(new Intent().setClass(this, LinphoneActivity.class));
|
||||
finish();
|
||||
} else if (currentFragment == AssistantFragmentsEnum.COUNTRY_CHOOSER){
|
||||
if(lastFragment.equals(AssistantFragmentsEnum.LINPHONE_LOGIN)){
|
||||
|
@ -675,7 +677,7 @@ private static AssistantActivity instance;
|
|||
|
||||
private void goToLinphoneActivity() {
|
||||
mPrefs.firstLaunchSuccessful();
|
||||
startActivity(new Intent().setClass(this, LinphoneActivity.class).putExtra("isNewProxyConfig", true));
|
||||
setResult(Activity.RESULT_OK, new Intent().putExtra("isNewProxyConfig", true));
|
||||
finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -296,7 +296,6 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
|||
}
|
||||
else if (id == R.id.assistant_skip){
|
||||
if (getArguments().getBoolean("LinkFromPref")) {
|
||||
startActivity(new Intent().setClass(AssistantActivity.instance(), LinphoneActivity.class));
|
||||
AssistantActivity.instance().finish();
|
||||
} else {
|
||||
AssistantActivity.instance().success();
|
||||
|
|
Loading…
Reference in a new issue