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
Loading
Please register or sign in to comment