Skip to content
Commit 6d5a29bc authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Introduce monitoring behavior changes for USI devices (3/n)

Extend USI battery timeout when stylus presence is detected.

The kernel only sends a UEvent for a battery node if there is a change
in the battery state. For example, when a stylus is first being used,
its battery value will be reported via a UEvent. If the stylus is used
again the next day and its battery level has not changed, no UEvent will
be produced.

To address this case, we will validate the USI battery state whenever
the presence of a stylus is detected and extend the validity timeout.

The only exception is when the stylus battery capacity is 0. When
Android first boots, the USI battery capacity will be repoted as 0. In
the event that stylus presence is detected before the battery level is
updated, we do not want to notify listeners of the capacity being 0.

Bug: 243005009
Test: atest BatteryControllerTests
Change-Id: I746496b618d7a6f51f34db65e69e7eb88c92fc87
parent 54559260
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