To make this jar available to all system APKs, load it as bootjar:
```
PRODUCT_PACKAGES += \
xiaomi-telephony-stub
PRODUCT_BOOT_JARS += \
xiaomi-telephony-stub
```
Change-Id: I69006732e6f915dc2a5cd1a3262b7ccf37372986
Currently, all sessions get boosted any time DISPLAY_UPDATE_IMMINENT is
sent from SurfaceFlinger which can lead to large, unnecessary boosts.
This patch aims to change that by removing the wakeup behavior, relying
instead on sessions to boost themselves with new load change hints.
* Remove wakeup() from PowerHintSession
* Remove wakeSessions from PowerSessionManager
* Remove related timers and message handlers
* Remove DISPLAY_UPDATE_IMMINENT behavior entirely
Test: manual
Bug: b/260136431
Change-Id: I4610edfefe8fcbef7d4cdbf5768830a9392a54f7
Reset traced hint value to -1 on reportActualWorkDuration or stale
timeout, and rewrite existing tracing for readability.
Bug: b/243973548
Test: manual
Change-Id: I135ec5f8971a9902d880e4089b0df746f5b917e2
To send ADPF_FIRST_FRAME hint when reportWorkDurations was called first
time after stale state.
Bug: 243025173
Test: PtsUiBench & CUJ
Change-Id: I4377b1f549646bcf44bdf26b2657b7bc0646f9a4
Merged-In: I4377b1f549646bcf44bdf26b2657b7bc0646f9a4
Send a hint only when the system can support the hint.
Bug: 243025173
Test: PtsUiBench & CUJ
Change-Id: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
Merged-In: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
The main problem is the timer thread could be woken after the session
was destroyed. We did have a closed flag which was set in destructor and the flag would be checked before handleMessage accessing the session
instance. To fix the problem, the operations of flag checking and session instance accessing should be guarded by the lock.
Bug: 236674672
Test: manual test
Change-Id: I49a18efbc135b1bc070b101038a8a0bcc6e19fec
(cherry picked from commit 5c75978f530b27bd976d8695ed79acd336c24776)
Merged-In: I49a18efbc135b1bc070b101038a8a0bcc6e19fec
Optimize boost:
A more efficient way is to trigger the wakeup boost through mTidSessionListMap, so the time
complexity reduce from O(n^3) to O(n^2).
The original code path:
PSM:wakeSessions() contains a loop that is O(n),
inside the loop, it calls to PHS::wakeup() which call to
PSM::setUclampMinLocked(), and
PSM::setUclampMinLocked() contains two loops O(n^2)
The new code path:
PSM::wakeSessions() directly checks all the ADPF tasks O(n) and
get the wakeup boost value O(n), then directly set the uclamp.min
The time complexity lower to O(n^2).
Fix unstable boost:
The original flow is to find max boost and wake it up from stale state
one by one. But the previous woken ones would not be counted when the later ones finding their max boost value.
The new flow boost all the tasks first, then wake up all those sessions.
Bug: 235510337
Test: Manually playing UIBench -> Transitions -> ActivityTransition
Change-Id: I995673b74401e198eb72188134ba1ebc134f971c
For DISPLAY_UPDATE_IMMINENT wakeup signal, non-stale
session's timer should be also extended. This resolves
the performance issue caused those sessions to go stale
prematurely.
Bug: 241621485
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I06330e064060248bb556ae35e0cb8fd302cef231
* use standard sensor type
* ignore non-wakeup sensor variant
* ignore events that do not properly match a pickup
Change-Id: I32bb097afb33603190dfd00a21202301a56bda08