Merge "Clear mTranslucentActivityWaiting if the activity is going to relaunch" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
874dc67f8f
@@ -5154,6 +5154,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
// Task#ensureActivitiesVisible will bring the activity to a proper
|
// Task#ensureActivitiesVisible will bring the activity to a proper
|
||||||
// active state.
|
// active state.
|
||||||
if (!isState(STARTED, RESUMED, PAUSED, STOPPED, STOPPING)
|
if (!isState(STARTED, RESUMED, PAUSED, STOPPED, STOPPING)
|
||||||
|
// TODO (b/185876784) Check could we remove the check condition
|
||||||
|
// mTranslucentActivityWaiting != null here
|
||||||
|| getRootTask().mTranslucentActivityWaiting != null) {
|
|| getRootTask().mTranslucentActivityWaiting != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -7802,7 +7804,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
configChangeFlags = 0;
|
configChangeFlags = 0;
|
||||||
return;
|
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*/);
|
final boolean andResume = shouldBeResumed(null /*activeActivity*/);
|
||||||
List<ResultInfo> pendingResults = null;
|
List<ResultInfo> pendingResults = null;
|
||||||
List<ReferrerIntent> pendingNewIntents = null;
|
List<ReferrerIntent> pendingNewIntents = null;
|
||||||
|
|||||||
@@ -386,6 +386,27 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
activity.mRelaunchReason);
|
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
|
@Test
|
||||||
public void testSetsRelaunchReason_NonResizeConfigChanges() {
|
public void testSetsRelaunchReason_NonResizeConfigChanges() {
|
||||||
final ActivityRecord activity = createActivityWithTask();
|
final ActivityRecord activity = createActivityWithTask();
|
||||||
|
|||||||
Reference in New Issue
Block a user