diff options
author | 2022-02-17 11:24:57 +0100 | |
---|---|---|
committer | 2022-02-17 11:06:19 +0000 | |
commit | dbcf8a0aaba568fc31730fded1dcd893f48e745a (patch) | |
tree | 27a65a05dfc67b33a7cd04aaf646a8c2fe5bd7fb /tools/aapt2/ResourceParser.cpp | |
parent | b8bfc0a0d872bd9c72ef60d0da9d14bb3123fe7c (diff) |
Set DreamsActivateOnSleepSetting and handle Sandman in tests
Two PowerManagerServiceTest were failing on TV:
- testRemovedDisplayGroupWakeLock_affectsNoDisplayGroups
- testWakeLock_affectsProperDisplayGroup
These tests expected the device to be DOZING at the end of the test,
but the devices was found to be DREAMING.
This difference came from `mDreamsActivateOnSleepSetting`, which was
not set for phones, but is set on TV.
Two tests are added to test the behaviour of this setting.
This CL also changes a call to `Handler#sendMessage` to
`Handler#sendMessageAtTime`, which schedules the message according to
the time of the test clock, instead of the real SystemClock.
This causes `handleSandman` to actually run during the test,
which would put the device to sleep if DOZING and dream couldn't be
started, so when #startDream is called on the DreamManager mock,
we set #isDreaming on the mock.
Bug: 205837239
Test: atest PowerManagerServiceTest
Change-Id: I6f27ea6a5cf8ddb1b7735c8d6ef67f27a5eb3747
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
0 files changed, 0 insertions, 0 deletions