diff options
| author | Robert Horvath <robhor@google.com> | 2022-02-17 11:24:57 +0100 |
|---|---|---|
| committer | Robert Horvath <robhor@google.com> | 2022-02-25 15:58:51 +0000 |
| commit | 1dd3129e14965b565d721a83fd829e124fe6d4d2 (patch) | |
| tree | b0a8ce411bcd692217873129486b9da5db1591d6 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 5012d490b65cb630d3c77c07e0ce45e303bb824e (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
(cherry picked from commit dbcf8a0aaba568fc31730fded1dcd893f48e745a)
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
0 files changed, 0 insertions, 0 deletions
