Skip to content
Commit 5bcc89f1 authored by Kweku Adams's avatar Kweku Adams
Browse files

Fix BatterySaverStateMachineTest.

1. Disable actually posting a notification so that the test doesn't deal
with a SecurityException.
2. Verify that the notification is only posted when expected.
3. Put the state change from PENDING_STICKY_ON to OFF at the
beginning of the block. setStickyActive() calls putGlobalSetting(),
which ends up calling setSettingsLocked() which then goes back to
updateStateLocked(). Since this is all in the same thread, the test was
seeing the state machine post the notification twice. Putting the
state change at the beginning prevents the "second" notification.

Bug: 132620259
Test: atest com.android.server.power.batterysaver.BatterySaverStateMachineTest
Test: atest CtsBatterySavingTestCases
Change-Id: I1ceecc150bc57a37002d7de4ece09b503ec583c8
parent b3196e53
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment