Merge "Fix unminimizing dock stack for AppTask.moveToFront" into nyc-dev
am: 6321f42fbe
* commit '6321f42fbee425745de9636d45e4973fa6c470b9':
Fix unminimizing dock stack for AppTask.moveToFront
Change-Id: I82b844611cb1761a681f91e2e26b25308202c6da
This commit is contained in:
@@ -4404,6 +4404,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
"startActivityFromRecentsInner: Task " + taskId + " not found.");
|
||||
}
|
||||
|
||||
// Since we don't have an actual source record here, we assume that the currently focused
|
||||
// activity was the source.
|
||||
final ActivityStack focusedStack = getFocusedStack();
|
||||
final ActivityRecord sourceRecord =
|
||||
focusedStack != null ? focusedStack.topActivity() : null;
|
||||
|
||||
if (launchStackId != INVALID_STACK_ID) {
|
||||
if (task.stack.mStackId != launchStackId) {
|
||||
moveTaskToStackLocked(
|
||||
@@ -4428,6 +4434,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
if (launchStackId == DOCKED_STACK_ID) {
|
||||
setResizingDuringAnimation(taskId);
|
||||
}
|
||||
|
||||
mService.mActivityStarter.postStartActivityUncheckedProcessing(task.getTopActivity(),
|
||||
ActivityManager.START_TASK_TO_FRONT,
|
||||
sourceRecord != null ? sourceRecord.task.stack.mStackId : INVALID_STACK_ID,
|
||||
sourceRecord, task.stack);
|
||||
return ActivityManager.START_TASK_TO_FRONT;
|
||||
}
|
||||
callingUid = task.mCallingUid;
|
||||
|
||||
@@ -540,12 +540,13 @@ class ActivityStarter {
|
||||
} finally {
|
||||
mService.mWindowManager.continueSurfaceLayout();
|
||||
}
|
||||
postStartActivityUncheckedProcessing(r, err, stack.mStackId);
|
||||
postStartActivityUncheckedProcessing(r, err, stack.mStackId, mSourceRecord, mTargetStack);
|
||||
return err;
|
||||
}
|
||||
|
||||
void postStartActivityUncheckedProcessing(
|
||||
ActivityRecord r, int result, int prevFocusedStackId) {
|
||||
ActivityRecord r, int result, int prevFocusedStackId, ActivityRecord sourceRecord,
|
||||
ActivityStack targetStack) {
|
||||
|
||||
if (result < START_SUCCESS) {
|
||||
// If someone asked to have the keyguard dismissed on the next activity start,
|
||||
@@ -559,7 +560,7 @@ class ActivityStarter {
|
||||
if (r.task != null && r.task.stack != null) {
|
||||
startedActivityStackId = r.task.stack.mStackId;
|
||||
} else if (mTargetStack != null) {
|
||||
startedActivityStackId = mTargetStack.mStackId;
|
||||
startedActivityStackId = targetStack.mStackId;
|
||||
}
|
||||
|
||||
// If we launched the activity from a no display activity that was launched from the home
|
||||
@@ -567,9 +568,9 @@ class ActivityStarter {
|
||||
// noDisplay activity will be finished shortly after.
|
||||
// TODO: We should prevent noDisplay activities from affecting task/stack ordering and
|
||||
// visibility instead of using this flag.
|
||||
final boolean noDisplayActivityOverHome = mSourceRecord != null
|
||||
&& mSourceRecord.noDisplay
|
||||
&& mSourceRecord.task.getTaskToReturnTo() == HOME_ACTIVITY_TYPE;
|
||||
final boolean noDisplayActivityOverHome = sourceRecord != null
|
||||
&& sourceRecord.noDisplay
|
||||
&& sourceRecord.task.getTaskToReturnTo() == HOME_ACTIVITY_TYPE;
|
||||
if (startedActivityStackId == DOCKED_STACK_ID
|
||||
&& (prevFocusedStackId == HOME_STACK_ID || noDisplayActivityOverHome)) {
|
||||
final ActivityStack homeStack = mSupervisor.getStack(HOME_STACK_ID);
|
||||
@@ -1811,7 +1812,8 @@ class ActivityStarter {
|
||||
final int result = startActivityUnchecked(
|
||||
pal.r, pal.sourceRecord, null, null, pal.startFlags, resume, null, null);
|
||||
postStartActivityUncheckedProcessing(
|
||||
pal.r, result, mSupervisor.mFocusedStack.mStackId);
|
||||
pal.r, result, mSupervisor.mFocusedStack.mStackId, mSourceRecord,
|
||||
mTargetStack);
|
||||
} catch (Exception e) {
|
||||
Slog.e(TAG, "Exception during pending activity launch pal=" + pal, e);
|
||||
pal.sendErrorResult(e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user