Watchdog and sluggishness due to multiple virtual displays created by third party apps

Problem: {
            1.Install third party app which creates virtual displays on screen off like easy boost cleaner app
            2.Open easy.booster.clean.tool
            3.Press power button to lock and then unlock
            4.repeat the step 3 for 500 times or usage over the time without reboot
}

Solution: {
    1. Over the time the snapshot time taken for multiple virtual displays takes over a minutes.
    2. Avoid taking snapshot of DEFAULT_DISPLAY for virtual displays, since we have already taken snapshot for default display.
}

Bug: 288536413
Change-Id: Iad61fe589ade31c7a78820a5655986198b8ae0f8
This commit is contained in:
sai.gairuboina-IN009276
2023-06-23 19:24:57 +05:30
parent 037244751d
commit d8cdd3ef82

View File

@@ -199,7 +199,8 @@ class KeyguardController {
// handle the snapshot.
// - The display state is ON. Because if AOD is not on or pulsing, the display state will
// be OFF or DOZE (the path of screen off may have handled it).
if (((aodShowing ^ keyguardShowing) || (aodShowing && aodChanged && keyguardChanged))
if (displayId == DEFAULT_DISPLAY
&& ((aodShowing ^ keyguardShowing) || (aodShowing && aodChanged && keyguardChanged))
&& !state.mKeyguardGoingAway && Display.isOnState(
mRootWindowContainer.getDefaultDisplay().getDisplayInfo().state)) {
mWindowManager.mTaskSnapshotController.snapshotForSleeping(DEFAULT_DISPLAY);