Merge "Allow to disable showing starting window when start from recents" into tm-qpr-dev
This commit is contained in:
@@ -256,6 +256,12 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
*/
|
*/
|
||||||
private static final String KEY_LAUNCH_TASK_ID = "android.activity.launchTaskId";
|
private static final String KEY_LAUNCH_TASK_ID = "android.activity.launchTaskId";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See {@link #setDisableStartingWindow}.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
private static final String KEY_DISABLE_STARTING_WINDOW = "android.activity.disableStarting";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See {@link #setPendingIntentLaunchFlags(int)}
|
* See {@link #setPendingIntentLaunchFlags(int)}
|
||||||
* @hide
|
* @hide
|
||||||
@@ -467,6 +473,7 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
private PictureInPictureParams mLaunchIntoPipParams;
|
private PictureInPictureParams mLaunchIntoPipParams;
|
||||||
private boolean mDismissKeyguard;
|
private boolean mDismissKeyguard;
|
||||||
private boolean mIgnorePendingIntentCreatorForegroundState;
|
private boolean mIgnorePendingIntentCreatorForegroundState;
|
||||||
|
private boolean mDisableStartingWindow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an ActivityOptions specifying a custom animation to run when
|
* Create an ActivityOptions specifying a custom animation to run when
|
||||||
@@ -1272,6 +1279,7 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
mDismissKeyguard = opts.getBoolean(KEY_DISMISS_KEYGUARD);
|
mDismissKeyguard = opts.getBoolean(KEY_DISMISS_KEYGUARD);
|
||||||
mIgnorePendingIntentCreatorForegroundState = opts.getBoolean(
|
mIgnorePendingIntentCreatorForegroundState = opts.getBoolean(
|
||||||
KEY_IGNORE_PENDING_INTENT_CREATOR_FOREGROUND_STATE);
|
KEY_IGNORE_PENDING_INTENT_CREATOR_FOREGROUND_STATE);
|
||||||
|
mDisableStartingWindow = opts.getBoolean(KEY_DISABLE_STARTING_WINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1670,6 +1678,22 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
return mLaunchTaskId;
|
return mLaunchTaskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether recents disable showing starting window when activity launch.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@RequiresPermission(START_TASKS_FROM_RECENTS)
|
||||||
|
public void setDisableStartingWindow(boolean disable) {
|
||||||
|
mDisableStartingWindow = disable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public boolean getDisableStartingWindow() {
|
||||||
|
return mDisableStartingWindow;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies intent flags to be applied for any activity started from a PendingIntent.
|
* Specifies intent flags to be applied for any activity started from a PendingIntent.
|
||||||
*
|
*
|
||||||
@@ -2178,6 +2202,9 @@ public class ActivityOptions extends ComponentOptions {
|
|||||||
b.putBoolean(KEY_IGNORE_PENDING_INTENT_CREATOR_FOREGROUND_STATE,
|
b.putBoolean(KEY_IGNORE_PENDING_INTENT_CREATOR_FOREGROUND_STATE,
|
||||||
mIgnorePendingIntentCreatorForegroundState);
|
mIgnorePendingIntentCreatorForegroundState);
|
||||||
}
|
}
|
||||||
|
if (mDisableStartingWindow) {
|
||||||
|
b.putBoolean(KEY_DISABLE_STARTING_WINDOW, mDisableStartingWindow);
|
||||||
|
}
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1481,7 +1481,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
|
|||||||
handleNonResizableTaskIfNeeded(task, WINDOWING_MODE_UNDEFINED,
|
handleNonResizableTaskIfNeeded(task, WINDOWING_MODE_UNDEFINED,
|
||||||
mRootWindowContainer.getDefaultTaskDisplayArea(), currentRootTask,
|
mRootWindowContainer.getDefaultTaskDisplayArea(), currentRootTask,
|
||||||
forceNonResizeable);
|
forceNonResizeable);
|
||||||
if (r != null) {
|
if (r != null && (options == null || !options.getDisableStartingWindow())) {
|
||||||
// Use a starting window to reduce the transition latency for reshowing the task.
|
// Use a starting window to reduce the transition latency for reshowing the task.
|
||||||
// Note that with shell transition, this should be executed before requesting
|
// Note that with shell transition, this should be executed before requesting
|
||||||
// transition to avoid delaying the starting window.
|
// transition to avoid delaying the starting window.
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ public class SafeActivityOptions {
|
|||||||
ActivityOptions options, int callingPid, int callingUid) {
|
ActivityOptions options, int callingPid, int callingUid) {
|
||||||
// If a launch task id is specified, then ensure that the caller is the recents
|
// If a launch task id is specified, then ensure that the caller is the recents
|
||||||
// component or has the START_TASKS_FROM_RECENTS permission
|
// component or has the START_TASKS_FROM_RECENTS permission
|
||||||
if (options.getLaunchTaskId() != INVALID_TASK_ID
|
if ((options.getLaunchTaskId() != INVALID_TASK_ID || options.getDisableStartingWindow())
|
||||||
&& !supervisor.mRecentTasks.isCallerRecents(callingUid)) {
|
&& !supervisor.mRecentTasks.isCallerRecents(callingUid)) {
|
||||||
final int startInTaskPerm = ActivityTaskManagerService.checkPermission(
|
final int startInTaskPerm = ActivityTaskManagerService.checkPermission(
|
||||||
START_TASKS_FROM_RECENTS, callingPid, callingUid);
|
START_TASKS_FROM_RECENTS, callingPid, callingUid);
|
||||||
|
|||||||
@@ -5074,6 +5074,9 @@ class Task extends TaskFragment {
|
|||||||
== ActivityOptions.ANIM_SCENE_TRANSITION) {
|
== ActivityOptions.ANIM_SCENE_TRANSITION) {
|
||||||
doShow = false;
|
doShow = false;
|
||||||
}
|
}
|
||||||
|
if (options != null && options.getDisableStartingWindow()) {
|
||||||
|
doShow = false;
|
||||||
|
}
|
||||||
if (r.mLaunchTaskBehind) {
|
if (r.mLaunchTaskBehind) {
|
||||||
// Don't do a starting window for mLaunchTaskBehind. More importantly make sure we
|
// Don't do a starting window for mLaunchTaskBehind. More importantly make sure we
|
||||||
// tell WindowManager that r is visible even though it is at the back of the root
|
// tell WindowManager that r is visible even though it is at the back of the root
|
||||||
|
|||||||
Reference in New Issue
Block a user