Merge "Clear mTranslucentActivityWaiting if the activity is going to relaunch" into sc-dev am: 874dc67f8f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14233152 Change-Id: I1293aaf73f1fc4041dfe47e0eabca25e56767717
This commit is contained in:
@@ -5154,6 +5154,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
// Task#ensureActivitiesVisible will bring the activity to a proper
|
||||
// active state.
|
||||
if (!isState(STARTED, RESUMED, PAUSED, STOPPED, STOPPING)
|
||||
// TODO (b/185876784) Check could we remove the check condition
|
||||
// mTranslucentActivityWaiting != null here
|
||||
|| getRootTask().mTranslucentActivityWaiting != null) {
|
||||
return false;
|
||||
}
|
||||
@@ -7802,7 +7804,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
configChangeFlags = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not waiting for translucent activity if it is going to relaunch.
|
||||
final Task rootTask = getRootTask();
|
||||
if (rootTask != null && rootTask.mTranslucentActivityWaiting == this) {
|
||||
rootTask.checkTranslucentActivityWaiting(null);
|
||||
}
|
||||
final boolean andResume = shouldBeResumed(null /*activeActivity*/);
|
||||
List<ResultInfo> pendingResults = null;
|
||||
List<ReferrerIntent> pendingNewIntents = null;
|
||||
|
||||
@@ -386,6 +386,27 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
activity.mRelaunchReason);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRelaunchClearTopWaitingTranslucent() {
|
||||
final ActivityRecord activity = createActivityWithTask();
|
||||
final Task task = activity.getTask();
|
||||
activity.setState(Task.ActivityState.RESUMED, "Testing");
|
||||
|
||||
task.onRequestedOverrideConfigurationChanged(task.getConfiguration());
|
||||
activity.setLastReportedConfiguration(new MergedConfiguration(new Configuration(),
|
||||
activity.getConfiguration()));
|
||||
|
||||
activity.info.configChanges &= ~CONFIG_ORIENTATION;
|
||||
final Configuration newConfig = new Configuration(task.getConfiguration());
|
||||
newConfig.orientation = newConfig.orientation == ORIENTATION_PORTRAIT
|
||||
? ORIENTATION_LANDSCAPE
|
||||
: ORIENTATION_PORTRAIT;
|
||||
task.onRequestedOverrideConfigurationChanged(newConfig);
|
||||
task.mTranslucentActivityWaiting = activity;
|
||||
ensureActivityConfiguration(activity);
|
||||
assertNull(task.mTranslucentActivityWaiting);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetsRelaunchReason_NonResizeConfigChanges() {
|
||||
final ActivityRecord activity = createActivityWithTask();
|
||||
|
||||
Reference in New Issue
Block a user