Loading core/java/android/window/flags/windowing_frontend.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -69,17 +69,6 @@ flag { bug: "291870756" } flag { name: "skip_sleeping_when_switching_display" namespace: "windowing_frontend" description: "Reduce unnecessary visibility or lifecycle changes when changing fold state" bug: "303241079" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } flag { name: "introduce_smoother_dimmer" namespace: "windowing_frontend" Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +7 −9 Original line number Diff line number Diff line Loading @@ -5496,9 +5496,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // In case startedGoingToSleep is called after screenTurnedOff (the source caller is in // order but the methods run on different threads) and updateScreenOffSleepToken was // skipped. Then acquire sleep token if screen was off. if (!mDefaultDisplayPolicy.isScreenOnFully() && !mDefaultDisplayPolicy.isScreenOnEarly() && com.android.window.flags.Flags.skipSleepingWhenSwitchingDisplay()) { updateScreenOffSleepToken(true /* acquire */, false /* isSwappingDisplay */); if (!mDefaultDisplayPolicy.isScreenOnFully() && !mDefaultDisplayPolicy.isScreenOnEarly()) { updateScreenOffSleepToken(true /* acquire */); } if (mKeyguardDelegate != null) { Loading Loading @@ -5661,9 +5660,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (DEBUG_WAKEUP) Slog.i(TAG, "Display" + displayId + " turned off..."); if (displayId == DEFAULT_DISPLAY) { if (!isSwappingDisplay || mIsGoingToSleepDefaultDisplay || !com.android.window.flags.Flags.skipSleepingWhenSwitchingDisplay()) { updateScreenOffSleepToken(true /* acquire */, isSwappingDisplay); if (!isSwappingDisplay || mIsGoingToSleepDefaultDisplay) { updateScreenOffSleepToken(true /* acquire */); } mRequestedOrSleepingDefaultDisplay = false; mDefaultDisplayPolicy.screenTurnedOff(); Loading Loading @@ -5722,7 +5720,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (displayId == DEFAULT_DISPLAY) { Trace.asyncTraceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "screenTurningOn", 0 /* cookie */); updateScreenOffSleepToken(false /* acquire */, false /* isSwappingDisplay */); updateScreenOffSleepToken(false /* acquire */); mDefaultDisplayPolicy.screenTurningOn(screenOnListener); mBootAnimationDismissable = false; Loading Loading @@ -6228,9 +6226,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { } // TODO (multidisplay): Support multiple displays in WindowManagerPolicy. private void updateScreenOffSleepToken(boolean acquire, boolean isSwappingDisplay) { private void updateScreenOffSleepToken(boolean acquire) { if (acquire) { mScreenOffSleepTokenAcquirer.acquire(DEFAULT_DISPLAY, isSwappingDisplay); mScreenOffSleepTokenAcquirer.acquire(DEFAULT_DISPLAY); } else { mScreenOffSleepTokenAcquirer.release(DEFAULT_DISPLAY); } Loading services/core/java/com/android/server/wm/ActivityRecord.java +0 −10 Original line number Diff line number Diff line Loading @@ -8998,16 +8998,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return inTransitionSelfOrParent(); } boolean isDisplaySleepingAndSwapping() { for (int i = mDisplayContent.mAllSleepTokens.size() - 1; i >= 0; i--) { RootWindowContainer.SleepToken sleepToken = mDisplayContent.mAllSleepTokens.get(i); if (sleepToken.isDisplaySwapping()) { return true; } } return false; } /** * Whether this activity is letterboxed for fixed orientation. If letterboxed due to fixed * orientation then aspect ratio restrictions are also already respected. Loading services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +0 −7 Original line number Diff line number Diff line Loading @@ -144,13 +144,6 @@ public abstract class ActivityTaskManagerInternal { */ void acquire(int displayId); /** * Acquires a sleep token. * @param displayId The display to apply to. * @param isSwappingDisplay Whether the display is swapping to another physical display. */ void acquire(int displayId, boolean isSwappingDisplay); /** * Releases the sleep token. * @param displayId The display to apply to. Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −7 Original line number Diff line number Diff line Loading @@ -5056,16 +5056,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Override public void acquire(int displayId) { acquire(displayId, false /* isSwappingDisplay */); } @Override public void acquire(int displayId, boolean isSwappingDisplay) { synchronized (mGlobalLock) { if (!mSleepTokens.contains(displayId)) { mSleepTokens.append(displayId, mRootWindowContainer.createSleepToken(mTag, displayId, isSwappingDisplay)); mRootWindowContainer.createSleepToken(mTag, displayId)); updateSleepIfNeededLocked(); } } Loading Loading
core/java/android/window/flags/windowing_frontend.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -69,17 +69,6 @@ flag { bug: "291870756" } flag { name: "skip_sleeping_when_switching_display" namespace: "windowing_frontend" description: "Reduce unnecessary visibility or lifecycle changes when changing fold state" bug: "303241079" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } flag { name: "introduce_smoother_dimmer" namespace: "windowing_frontend" Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +7 −9 Original line number Diff line number Diff line Loading @@ -5496,9 +5496,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // In case startedGoingToSleep is called after screenTurnedOff (the source caller is in // order but the methods run on different threads) and updateScreenOffSleepToken was // skipped. Then acquire sleep token if screen was off. if (!mDefaultDisplayPolicy.isScreenOnFully() && !mDefaultDisplayPolicy.isScreenOnEarly() && com.android.window.flags.Flags.skipSleepingWhenSwitchingDisplay()) { updateScreenOffSleepToken(true /* acquire */, false /* isSwappingDisplay */); if (!mDefaultDisplayPolicy.isScreenOnFully() && !mDefaultDisplayPolicy.isScreenOnEarly()) { updateScreenOffSleepToken(true /* acquire */); } if (mKeyguardDelegate != null) { Loading Loading @@ -5661,9 +5660,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (DEBUG_WAKEUP) Slog.i(TAG, "Display" + displayId + " turned off..."); if (displayId == DEFAULT_DISPLAY) { if (!isSwappingDisplay || mIsGoingToSleepDefaultDisplay || !com.android.window.flags.Flags.skipSleepingWhenSwitchingDisplay()) { updateScreenOffSleepToken(true /* acquire */, isSwappingDisplay); if (!isSwappingDisplay || mIsGoingToSleepDefaultDisplay) { updateScreenOffSleepToken(true /* acquire */); } mRequestedOrSleepingDefaultDisplay = false; mDefaultDisplayPolicy.screenTurnedOff(); Loading Loading @@ -5722,7 +5720,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (displayId == DEFAULT_DISPLAY) { Trace.asyncTraceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "screenTurningOn", 0 /* cookie */); updateScreenOffSleepToken(false /* acquire */, false /* isSwappingDisplay */); updateScreenOffSleepToken(false /* acquire */); mDefaultDisplayPolicy.screenTurningOn(screenOnListener); mBootAnimationDismissable = false; Loading Loading @@ -6228,9 +6226,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { } // TODO (multidisplay): Support multiple displays in WindowManagerPolicy. private void updateScreenOffSleepToken(boolean acquire, boolean isSwappingDisplay) { private void updateScreenOffSleepToken(boolean acquire) { if (acquire) { mScreenOffSleepTokenAcquirer.acquire(DEFAULT_DISPLAY, isSwappingDisplay); mScreenOffSleepTokenAcquirer.acquire(DEFAULT_DISPLAY); } else { mScreenOffSleepTokenAcquirer.release(DEFAULT_DISPLAY); } Loading
services/core/java/com/android/server/wm/ActivityRecord.java +0 −10 Original line number Diff line number Diff line Loading @@ -8998,16 +8998,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return inTransitionSelfOrParent(); } boolean isDisplaySleepingAndSwapping() { for (int i = mDisplayContent.mAllSleepTokens.size() - 1; i >= 0; i--) { RootWindowContainer.SleepToken sleepToken = mDisplayContent.mAllSleepTokens.get(i); if (sleepToken.isDisplaySwapping()) { return true; } } return false; } /** * Whether this activity is letterboxed for fixed orientation. If letterboxed due to fixed * orientation then aspect ratio restrictions are also already respected. Loading
services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +0 −7 Original line number Diff line number Diff line Loading @@ -144,13 +144,6 @@ public abstract class ActivityTaskManagerInternal { */ void acquire(int displayId); /** * Acquires a sleep token. * @param displayId The display to apply to. * @param isSwappingDisplay Whether the display is swapping to another physical display. */ void acquire(int displayId, boolean isSwappingDisplay); /** * Releases the sleep token. * @param displayId The display to apply to. Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −7 Original line number Diff line number Diff line Loading @@ -5056,16 +5056,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Override public void acquire(int displayId) { acquire(displayId, false /* isSwappingDisplay */); } @Override public void acquire(int displayId, boolean isSwappingDisplay) { synchronized (mGlobalLock) { if (!mSleepTokens.contains(displayId)) { mSleepTokens.append(displayId, mRootWindowContainer.createSleepToken(mTag, displayId, isSwappingDisplay)); mRootWindowContainer.createSleepToken(mTag, displayId)); updateSleepIfNeededLocked(); } } Loading