Loading data/etc/services.core.protolog.json +6 −0 Original line number Diff line number Diff line Loading @@ -2749,6 +2749,12 @@ "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "1105210816": { "message": "Skipping config check in destroyed state %s", "level": "VERBOSE", "group": "WM_DEBUG_CONFIGURATION", "at": "com\/android\/server\/wm\/ActivityRecord.java" }, "1112047265": { "message": "finishDrawingWindow: %s mDrawState=%s", "level": "DEBUG", Loading services/core/java/com/android/server/wm/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -7076,6 +7076,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return true; } if (isState(DESTROYED)) { ProtoLog.v(WM_DEBUG_CONFIGURATION, "Skipping config check " + "in destroyed state %s", this); return true; } if (!ignoreVisibility && (mState == STOPPING || mState == STOPPED || !shouldBeVisible())) { ProtoLog.v(WM_DEBUG_CONFIGURATION, "Skipping config check " + "invisible: %s", this); Loading services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +22 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.clearInvocations; import static org.mockito.Mockito.never; Loading Loading @@ -375,6 +376,27 @@ public class ActivityRecordTests extends WindowTestsBase { activity.mRelaunchReason); } @Test public void testDestroyedActivityNotScheduleConfigChanged() throws RemoteException { final ActivityRecord activity = new ActivityBuilder(mAtm) .setCreateTask(true) .setConfigChanges(CONFIG_ORIENTATION) .build(); final Task task = activity.getTask(); activity.setState(DESTROYED, "Testing"); final Configuration newConfig = new Configuration(task.getConfiguration()); newConfig.orientation = newConfig.orientation == ORIENTATION_PORTRAIT ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT; task.onRequestedOverrideConfigurationChanged(newConfig); ensureActivityConfiguration(activity); verify(mAtm.getLifecycleManager(), never()) .scheduleTransaction(any(), any(), isA(ActivityConfigurationChangeItem.class)); } @Test public void testSetRequestedOrientationUpdatesConfiguration() throws Exception { final ActivityRecord activity = new ActivityBuilder(mAtm) Loading Loading
data/etc/services.core.protolog.json +6 −0 Original line number Diff line number Diff line Loading @@ -2749,6 +2749,12 @@ "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "1105210816": { "message": "Skipping config check in destroyed state %s", "level": "VERBOSE", "group": "WM_DEBUG_CONFIGURATION", "at": "com\/android\/server\/wm\/ActivityRecord.java" }, "1112047265": { "message": "finishDrawingWindow: %s mDrawState=%s", "level": "DEBUG", Loading
services/core/java/com/android/server/wm/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -7076,6 +7076,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return true; } if (isState(DESTROYED)) { ProtoLog.v(WM_DEBUG_CONFIGURATION, "Skipping config check " + "in destroyed state %s", this); return true; } if (!ignoreVisibility && (mState == STOPPING || mState == STOPPED || !shouldBeVisible())) { ProtoLog.v(WM_DEBUG_CONFIGURATION, "Skipping config check " + "invisible: %s", this); Loading
services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +22 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.clearInvocations; import static org.mockito.Mockito.never; Loading Loading @@ -375,6 +376,27 @@ public class ActivityRecordTests extends WindowTestsBase { activity.mRelaunchReason); } @Test public void testDestroyedActivityNotScheduleConfigChanged() throws RemoteException { final ActivityRecord activity = new ActivityBuilder(mAtm) .setCreateTask(true) .setConfigChanges(CONFIG_ORIENTATION) .build(); final Task task = activity.getTask(); activity.setState(DESTROYED, "Testing"); final Configuration newConfig = new Configuration(task.getConfiguration()); newConfig.orientation = newConfig.orientation == ORIENTATION_PORTRAIT ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT; task.onRequestedOverrideConfigurationChanged(newConfig); ensureActivityConfiguration(activity); verify(mAtm.getLifecycleManager(), never()) .scheduleTransaction(any(), any(), isA(ActivityConfigurationChangeItem.class)); } @Test public void testSetRequestedOrientationUpdatesConfiguration() throws Exception { final ActivityRecord activity = new ActivityBuilder(mAtm) Loading