Merge "Wake up dream after resuming the moving to front task" into tm-qpr-dev am: 4c430266c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20443850 Change-Id: Id12a95fbfebd7df4e50374007f6a748ffb3c0781 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1970,12 +1970,6 @@ class ActivityStarter {
|
|||||||
? targetTask.getTopNonFinishingActivity()
|
? targetTask.getTopNonFinishingActivity()
|
||||||
: targetTaskTop;
|
: targetTaskTop;
|
||||||
|
|
||||||
// At this point we are certain we want the task moved to the front. If we need to dismiss
|
|
||||||
// any other always-on-top root tasks, now is the time to do it.
|
|
||||||
if (targetTaskTop.canTurnScreenOn() && mService.isDreaming()) {
|
|
||||||
targetTaskTop.mTaskSupervisor.wakeUp("recycleTask#turnScreenOnFlag");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mMovedToFront) {
|
if (mMovedToFront) {
|
||||||
// We moved the task to front, use starting window to hide initial drawn delay.
|
// We moved the task to front, use starting window to hide initial drawn delay.
|
||||||
targetTaskTop.showStartingWindow(true /* taskSwitch */);
|
targetTaskTop.showStartingWindow(true /* taskSwitch */);
|
||||||
@@ -1987,6 +1981,12 @@ class ActivityStarter {
|
|||||||
// And for paranoia, make sure we have correctly resumed the top activity.
|
// And for paranoia, make sure we have correctly resumed the top activity.
|
||||||
resumeTargetRootTaskIfNeeded();
|
resumeTargetRootTaskIfNeeded();
|
||||||
|
|
||||||
|
// This is moving an existing task to front. But since dream activity has a higher z-order
|
||||||
|
// to cover normal activities, it needs the awakening event to be dismissed.
|
||||||
|
if (mService.isDreaming() && targetTaskTop.canTurnScreenOn()) {
|
||||||
|
targetTaskTop.mTaskSupervisor.wakeUp("recycleTask#turnScreenOnFlag");
|
||||||
|
}
|
||||||
|
|
||||||
mLastStartActivityRecord = targetTaskTop;
|
mLastStartActivityRecord = targetTaskTop;
|
||||||
return mMovedToFront ? START_TASK_TO_FRONT : START_DELIVERED_TO_TOP;
|
return mMovedToFront ? START_TASK_TO_FRONT : START_DELIVERED_TO_TOP;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1136,6 +1136,26 @@ public class ActivityStarterTests extends WindowTestsBase {
|
|||||||
assertThat(starter.mAddingToTask).isTrue();
|
assertThat(starter.mAddingToTask).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRecycleTaskWakeUpWhenDreaming() {
|
||||||
|
doNothing().when(mWm.mAtmService.mTaskSupervisor).wakeUp(anyString());
|
||||||
|
doReturn(true).when(mWm.mAtmService).isDreaming();
|
||||||
|
final ActivityStarter starter = prepareStarter(0 /* flags */);
|
||||||
|
final ActivityRecord target = new ActivityBuilder(mAtm).setCreateTask(true).build();
|
||||||
|
starter.mStartActivity = target;
|
||||||
|
target.mVisibleRequested = false;
|
||||||
|
target.setTurnScreenOn(true);
|
||||||
|
// Assume the flag was consumed by relayout.
|
||||||
|
target.setCurrentLaunchCanTurnScreenOn(false);
|
||||||
|
startActivityInner(starter, target, null /* source */, null /* options */,
|
||||||
|
null /* inTask */, null /* inTaskFragment */);
|
||||||
|
// The flag should be set again when resuming (from recycleTask) the target as top.
|
||||||
|
assertTrue(target.currentLaunchCanTurnScreenOn());
|
||||||
|
// In real case, dream activity has a higher priority (TaskDisplayArea#getPriority) that
|
||||||
|
// will be put at a higher z-order. So it relies on wakeUp() to be dismissed.
|
||||||
|
verify(mWm.mAtmService.mTaskSupervisor).wakeUp(anyString());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTargetTaskInSplitScreen() {
|
public void testTargetTaskInSplitScreen() {
|
||||||
final ActivityStarter starter =
|
final ActivityStarter starter =
|
||||||
|
|||||||
Reference in New Issue
Block a user