Use more elegant solution to prevent some activities to be in history

This commit is contained in:
Sylvain Berfini 2018-11-14 14:09:01 +01:00
parent 085ac38d53
commit 1ff00d7b79
5 changed files with 9 additions and 10 deletions

View file

@ -73,6 +73,7 @@
android:launchMode="singleTask" android:launchMode="singleTask"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/NoTitle" android:theme="@style/NoTitle"
android:noHistory="true"
android:windowSoftInputMode="adjustPan|stateHidden"> android:windowSoftInputMode="adjustPan|stateHidden">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -129,6 +130,7 @@
<activity <activity
android:name=".call.CallIncomingActivity" android:name=".call.CallIncomingActivity"
android:launchMode="singleTop" android:launchMode="singleTop"
android:noHistory="true"
android:theme="@style/NoTitle"> android:theme="@style/NoTitle">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -137,6 +139,7 @@
<activity <activity
android:name=".call.CallOutgoingActivity" android:name=".call.CallOutgoingActivity"
android:launchMode="singleTop" android:launchMode="singleTop"
android:noHistory="true"
android:theme="@style/NoTitle"> android:theme="@style/NoTitle">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
@ -145,6 +148,7 @@
<activity <activity
android:name=".call.CallActivity" android:name=".call.CallActivity"
android:launchMode="singleTop" android:launchMode="singleTop"
android:noHistory="true"
android:theme="@style/FullScreen"> android:theme="@style/FullScreen">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>

View file

@ -1496,7 +1496,6 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
displayInapp(); displayInapp();
} else if (extras != null && extras.getBoolean("Notification", false)) { } else if (extras != null && extras.getBoolean("Notification", false)) {
if (LinphoneManager.getLc().getCallsNb() > 0) { if (LinphoneManager.getLc().getCallsNb() > 0) {
Call call = LinphoneManager.getLc().getCalls()[0];
startIncallActivity(); startIncallActivity();
} }
} else if (extras != null && extras.getBoolean("StartCall", false)) { } else if (extras != null && extras.getBoolean("StartCall", false)) {
@ -1505,10 +1504,11 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
} else { } else {
mAddressWaitingToBeCalled = extras.getString("NumberToCall"); mAddressWaitingToBeCalled = extras.getString("NumberToCall");
goToDialerFragment(); goToDialerFragment();
//startActivity(new Intent(this, CallIncomingActivity.class));
} }
} else if (extras != null && extras.getBoolean("Transfer", false)) { } else if (extras != null && extras.getBoolean("Transfer", false)) {
intent.putExtra("DoNotGoToCallActivity", true); intent.putExtra("DoNotGoToCallActivity", true);
} else if (extras != null && extras.getBoolean("AddCall", false)) {
intent.putExtra("DoNotGoToCallActivity", true);
} else { } else {
DialerFragment dialerFragment = DialerFragment.instance(); DialerFragment dialerFragment = DialerFragment.instance();
if (dialerFragment != null) { if (dialerFragment != null) {

View file

@ -167,7 +167,6 @@ public class LinphoneLauncherActivity extends Activity {
LinphoneActivity.instance().displayChat(null, null, stringUriFileShared); LinphoneActivity.instance().displayChat(null, null, stringUriFileShared);
} }
} }
finish();
} }
}, 1000); }, 1000);
} }

View file

@ -1043,9 +1043,9 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
public void goBackToDialer() { public void goBackToDialer() {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra("Transfer", false); intent.setClass(this, LinphoneActivity.class);
setResult(Activity.RESULT_FIRST_USER, intent); intent.putExtra("AddCall", true);
finish(); startActivity(intent);
} }
private void goBackToDialerAndDisplayTransferButton() { private void goBackToDialerAndDisplayTransferButton() {
@ -1053,7 +1053,6 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
intent.setClass(this, LinphoneActivity.class); intent.setClass(this, LinphoneActivity.class);
intent.putExtra("Transfer", true); intent.putExtra("Transfer", true);
startActivity(intent); startActivity(intent);
finish();
} }
private void goToChatList() { private void goToChatList() {
@ -1061,7 +1060,6 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
intent.setClass(this, LinphoneActivity.class); intent.setClass(this, LinphoneActivity.class);
intent.putExtra("GoToChat", true); intent.putExtra("GoToChat", true);
startActivity(intent); startActivity(intent);
finish();
} }
public void acceptCallUpdate(boolean accept) { public void acceptCallUpdate(boolean accept) {

View file

@ -109,7 +109,6 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
return; return;
} }
LinphoneActivity.instance().startIncallActivity(); LinphoneActivity.instance().startIncallActivity();
finish();
return; return;
} else if (state == State.Error) { } else if (state == State.Error) {
// Convert Core message for internalization // Convert Core message for internalization
@ -172,7 +171,6 @@ public class CallOutgoingActivity extends LinphoneGenericActivity implements OnC
return; return;
} }
LinphoneActivity.instance().startIncallActivity(); LinphoneActivity.instance().startIncallActivity();
finish();
return; return;
} }
} }