Merge "Merge "Fix unminimizing dock stack for AppTask.moveToFront" into nyc-dev am: 6321f42fbe am: a80c867adf" into nyc-mr1-dev-plus-aosp

This commit is contained in:
Android Build Merger (Role)
2016-06-02 22:22:55 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 7 deletions

View File

@@ -4404,6 +4404,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
"startActivityFromRecentsInner: Task " + taskId + " not found."); "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 (launchStackId != INVALID_STACK_ID) {
if (task.stack.mStackId != launchStackId) { if (task.stack.mStackId != launchStackId) {
moveTaskToStackLocked( moveTaskToStackLocked(
@@ -4428,6 +4434,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
if (launchStackId == DOCKED_STACK_ID) { if (launchStackId == DOCKED_STACK_ID) {
setResizingDuringAnimation(taskId); 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; return ActivityManager.START_TASK_TO_FRONT;
} }
callingUid = task.mCallingUid; callingUid = task.mCallingUid;

View File

@@ -540,12 +540,13 @@ class ActivityStarter {
} finally { } finally {
mService.mWindowManager.continueSurfaceLayout(); mService.mWindowManager.continueSurfaceLayout();
} }
postStartActivityUncheckedProcessing(r, err, stack.mStackId); postStartActivityUncheckedProcessing(r, err, stack.mStackId, mSourceRecord, mTargetStack);
return err; return err;
} }
void postStartActivityUncheckedProcessing( void postStartActivityUncheckedProcessing(
ActivityRecord r, int result, int prevFocusedStackId) { ActivityRecord r, int result, int prevFocusedStackId, ActivityRecord sourceRecord,
ActivityStack targetStack) {
if (result < START_SUCCESS) { if (result < START_SUCCESS) {
// If someone asked to have the keyguard dismissed on the next activity start, // 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) { if (r.task != null && r.task.stack != null) {
startedActivityStackId = r.task.stack.mStackId; startedActivityStackId = r.task.stack.mStackId;
} else if (mTargetStack != null) { } 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 // 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. // noDisplay activity will be finished shortly after.
// TODO: We should prevent noDisplay activities from affecting task/stack ordering and // TODO: We should prevent noDisplay activities from affecting task/stack ordering and
// visibility instead of using this flag. // visibility instead of using this flag.
final boolean noDisplayActivityOverHome = mSourceRecord != null final boolean noDisplayActivityOverHome = sourceRecord != null
&& mSourceRecord.noDisplay && sourceRecord.noDisplay
&& mSourceRecord.task.getTaskToReturnTo() == HOME_ACTIVITY_TYPE; && sourceRecord.task.getTaskToReturnTo() == HOME_ACTIVITY_TYPE;
if (startedActivityStackId == DOCKED_STACK_ID if (startedActivityStackId == DOCKED_STACK_ID
&& (prevFocusedStackId == HOME_STACK_ID || noDisplayActivityOverHome)) { && (prevFocusedStackId == HOME_STACK_ID || noDisplayActivityOverHome)) {
final ActivityStack homeStack = mSupervisor.getStack(HOME_STACK_ID); final ActivityStack homeStack = mSupervisor.getStack(HOME_STACK_ID);
@@ -1811,7 +1812,8 @@ class ActivityStarter {
final int result = startActivityUnchecked( final int result = startActivityUnchecked(
pal.r, pal.sourceRecord, null, null, pal.startFlags, resume, null, null); pal.r, pal.sourceRecord, null, null, pal.startFlags, resume, null, null);
postStartActivityUncheckedProcessing( postStartActivityUncheckedProcessing(
pal.r, result, mSupervisor.mFocusedStack.mStackId); pal.r, result, mSupervisor.mFocusedStack.mStackId, mSourceRecord,
mTargetStack);
} catch (Exception e) { } catch (Exception e) {
Slog.e(TAG, "Exception during pending activity launch pal=" + pal, e); Slog.e(TAG, "Exception during pending activity launch pal=" + pal, e);
pal.sendErrorResult(e.getMessage()); pal.sendErrorResult(e.getMessage());