Merge "Fix non-top activity being boosted while finishing."
This commit is contained in:
committed by
Android (Google) Code Review
commit
9e39a623e3
@@ -2606,7 +2606,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
|
||||
finishActivityResults(resultCode, resultData, resultGrants);
|
||||
|
||||
final boolean endTask = task.getActivityBelow(this) == null
|
||||
final boolean endTask = task.getTopNonFinishingActivity() == null
|
||||
&& !task.isClearingToReuseTask();
|
||||
final int transit = endTask ? TRANSIT_OLD_TASK_CLOSE : TRANSIT_OLD_ACTIVITY_CLOSE;
|
||||
if (isState(RESUMED)) {
|
||||
|
||||
@@ -1063,6 +1063,21 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
assertEquals(STOPPED, nextTop.getState());
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that finish bottom activity from a task won't boost it to top.
|
||||
*/
|
||||
@Test
|
||||
public void testFinishBottomActivityIfPossible_noZBoost() {
|
||||
final ActivityRecord bottomActivity = createActivityWithTask();
|
||||
final ActivityRecord topActivity = new ActivityBuilder(mAtm)
|
||||
.setTask(bottomActivity.getTask()).build();
|
||||
topActivity.mVisibleRequested = true;
|
||||
// simulating bottomActivity as a trampoline activity.
|
||||
bottomActivity.setState(RESUMED, "test");
|
||||
bottomActivity.finishIfPossible("test", false);
|
||||
assertFalse(bottomActivity.mNeedsZBoost);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that complete finish request for visible activity must be delayed before the next one
|
||||
* becomes visible.
|
||||
|
||||
Reference in New Issue
Block a user