Skip to content
Commit 0f47284a authored by Michael Wachenschwanz's avatar Michael Wachenschwanz
Browse files

Refactor AppTimeLimitController for Session Observers

Introducing the concept of Usage Session Observers to UsageStats. A
session observer monitors usage within individual "continuous" sessions
(brief gaps of non usage may be allowed in a session and still be
considered continuous)

The new session observer in AppTimeLimitController are both similar and
different enough from the current app usage observer to warrant
refactoring TimeLimitGroup into an OOP friendly abstract base class.

Added some Observer App handling to avoid clash between registered
observers from multiple apps.

Reworded packages to observed and usage entities to accomodate future
changes, where usage may come from more than just app usage.

Reworded moveToForeground/Background to generic usage and allow multiple
usage entities to be active at the same time to accomodate future
changes, where more than just the foreground app can be considered used.

Test: atest FrameworksServicesTests:AppTimeLimitControllerTests
Bug: 111465038
Change-Id: I63aebf8b0aa5516111bd6d5e142525d0bee6ef58
parent 148eba15
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