Loading InCallUI/src/com/android/incallui/InCallActivity.java +13 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.app.DialogFragment; import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnCancelListener; Loading Loading @@ -862,4 +863,16 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { CallList.getInstance().onErrorDialogDismissed(); InCallPresenter.getInstance().onDismissDialog(); } public void setExcludeFromRecents(boolean exclude) { ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.AppTask> tasks = am.getAppTasks(); int taskId = getTaskId(); for (int i=0; i<tasks.size(); i++) { ActivityManager.AppTask task = tasks.get(i); if (task.getTaskInfo().id == taskId) { task.setExcludeFromRecents(exclude); } } } } InCallUI/src/com/android/incallui/InCallPresenter.java +3 −3 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ public class InCallPresenter implements CallList.Listener, final boolean doFinish = (mInCallActivity != null && isActivityStarted()); Log.i(this, "Hide in call UI: " + doFinish); if (doFinish) { mInCallActivity.setExcludeFromRecents(true); mInCallActivity.finish(); if (mAccountSelectionCancelled) { Loading Loading @@ -315,6 +316,7 @@ public class InCallPresenter implements CallList.Listener, } mInCallActivity = inCallActivity; mInCallActivity.setExcludeFromRecents(false); // By the time the UI finally comes up, the call may already be disconnected. // If that's the case, we may need to show an error dialog. Loading Loading @@ -1309,9 +1311,7 @@ public class InCallPresenter implements CallList.Listener, public Intent getInCallIntent(boolean showDialpad, boolean newOutgoingCall) { final Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(mContext, InCallActivity.class); if (showDialpad) { Loading Loading
InCallUI/src/com/android/incallui/InCallActivity.java +13 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.app.DialogFragment; import android.app.Fragment; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnCancelListener; Loading Loading @@ -862,4 +863,16 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { CallList.getInstance().onErrorDialogDismissed(); InCallPresenter.getInstance().onDismissDialog(); } public void setExcludeFromRecents(boolean exclude) { ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.AppTask> tasks = am.getAppTasks(); int taskId = getTaskId(); for (int i=0; i<tasks.size(); i++) { ActivityManager.AppTask task = tasks.get(i); if (task.getTaskInfo().id == taskId) { task.setExcludeFromRecents(exclude); } } } }
InCallUI/src/com/android/incallui/InCallPresenter.java +3 −3 Original line number Diff line number Diff line Loading @@ -252,6 +252,7 @@ public class InCallPresenter implements CallList.Listener, final boolean doFinish = (mInCallActivity != null && isActivityStarted()); Log.i(this, "Hide in call UI: " + doFinish); if (doFinish) { mInCallActivity.setExcludeFromRecents(true); mInCallActivity.finish(); if (mAccountSelectionCancelled) { Loading Loading @@ -315,6 +316,7 @@ public class InCallPresenter implements CallList.Listener, } mInCallActivity = inCallActivity; mInCallActivity.setExcludeFromRecents(false); // By the time the UI finally comes up, the call may already be disconnected. // If that's the case, we may need to show an error dialog. Loading Loading @@ -1309,9 +1311,7 @@ public class InCallPresenter implements CallList.Listener, public Intent getInCallIntent(boolean showDialpad, boolean newOutgoingCall) { final Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(mContext, InCallActivity.class); if (showDialpad) { Loading