1. Don't set app standby buckets when app idle is disabled. When the
bucket is set when app idle is disabled, AppStandbyController notifies
listeners, which then puts the listeners in an invalid state where
they think some apps are exempted from things like battery saver.
2. Remove uninstalled packages from AppStateTracker's exempted package
cache.
Bug: 156868557
Test: make cts -j 64 && cts-tradefed run commandAndExit cts -m CtsBatterySavingTestCases -t android.os.cts.batterysaving.BatterySaverAlarmTest
Test: make cts -j 64 && cts-tradefed run commandAndExit cts-on-gsi -m CtsBatterySavingTestCases -t android.os.cts.batterysaving.BatterySaverAlarmTest
Change-Id: If62c75eff0bc56ef1750e109335ba7e47832c128
Merged-In: 2a94051c04
When entering PiP from split-screen, there should be exact one
onPictureInPictureModeChanged callback with zero
onMultiWindowModeChanged since the multi-window mode is not changed.
When the stack is nested, we reparent the to-be-pinned stack to the
display area and later on set the stack windowing mode onto
ActivityRecord, which ends up WINDOWING_MODE_FULLSCREEN in this case.
Therefore, the windowing mode changes from split-screen-secondary to
fullscreen and then pinned. And client receives
onMultiWindowModeChanged(false), onPictureInPictureModeChanged(true),
onMultiWindowModeChanged(true) in sequence.
Fixes this by setting the windowing mode prior to re-parenting within
RootWindowContainer#moveActivityToPinnedStack
Bug: 157172491
Test: manually enter PiP from split screen and verifies lifecycle
Change-Id: Idf57235349ed6b78db96a632af9665b6e39edb78
If home stack is nested, it means we're in split or some
other non-fullscreen mode. In these cases, dismissing a pip
task should move it to the back of the home-stack parent
rather than the back of the display.
This behavior is the same as what was done for Activity.moveToBack,
so this CL pulled that functionality into positionTaskBehindHome()
so it could be shared
Bug: 157159929
Test: ActivityStack tests. Or attempt repro in bug.
Change-Id: Icf04f87edf4c00b47e3f1e0a45d80bf9b680ce1c
Add more dumps and logs to better help debug IME insets better
Logging can be enabled by setting InsetsController.DEBUG to true.
Bug: 154348613
Test: manually build and flash.
Verify showing and hiding IME shows logs.
verify adb shell dumpsys window windows has new dumps
Change-Id: Iad0a21d81a22d6acfaaf5c5ca8b5131eec411e79
The animating recents activity (e.g. home) is set as fixed-rotation-
launching-app to reduce extra enable/disable transform because it may
be the real top activity later (e.g. swipe to home or enter overview).
The actual state is only known when finishing the recents animation.
So during animating, it is not really the top activity that will change
the rotation of display.
If auto-rotate is disabled, there will have a rotation button when
device is rotated. And if the device is using gesture navigation, the
touch region of button may overlap with the navigation bar. Then when
pressing the button while device is in landscape, the recents activity
may also be triggered with fixed rotation in portrait, that causes
the rotation type is forced to be seamless. But the actual foreground
app is not rotated and does not declare to use seamless, therefore
the screen looks flickering by updating configuration directly.
Fixes: 157208761
Test: DisplayContentTests#testRotateSeamlesslyWithFixedRotation
Change-Id: If512ad14420ed7956fe888a0ce9f5d5006eb43a8
This fixes the issue that cause -1.0f to be added to the brightness
curves when a devices had 0 in the backlight configuration
(config_screenBrightnessBacklight) in config.xml.
This code is the same as it originally was before the float brightness changes.
Bug: 153290107
Test: manual, check values in `adb shell dumpsys display | grep -i
"spline\|mconfig\|mambientlux"`
Change-Id: I332fc09565b26bfc5f108fe32bf109f9584c60a2