This counts the number of times the app was launched from outside
the app and ignores intra-app activity transitions.
Introduce a new permission for registering to observe app usage.
Fixes a bug where Settings couldn't force the app into another
bucket if it was recently launched.
Bug: 74335821
Fixes: 76100712
Test: Manual test using Settings
Test: UsageStatsTest to verify permission change
Change-Id: Ibd343c1cfa37089a3ac6fc30ba3194e21a9be499
Allow setting groups of apps to control usage time limits on.
Applies only to activity time in the foreground.
Updated UsageStatsTest app to be able to add an observer for
a 30 second timeout across multiple comma separated package
names.
Bug: 74335821
Test: atest FrameworksServicesTests:AppTimeLimitControllerTests
Install and run frameworks/base/tests/UsageStatsTest
Change-Id: I677c30b4f211f7acf72c9766df3d8c1ac56a4b4e
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.
Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.
Test: make relevant packages
Bug: 73535841
Change-Id: I4233b9091d9066c4fa69f3d24aaf367ea500f760
- Events are obfuscated based on whether the app was instant or not at
the time each event was logged.
- UsageStats are obfuscated based on whether each app is instant or
not at the moment.
Bug 38202133
Test: Manual test using UsageStatsTest and instant apps
Change-Id: I3c74309196b88d010d317cb0dd6749bf4624e876
SYSTEM_INTERACTION events are signals to the system for a package's
implicit actions (service bound, etc).
These should not affect the API visible stats like lastTimeUsed, etc.
USER_INTERACTION is for user initiated actions (notification interaction, etc).
Bug:21761781
Change-Id: I4585cf35fbb158612a3c737710108bec34e89183
This will allow for updating a package's last time used
property for packages that are interacted in ways other than
launching their activities (interacting with notifications, etc.)
Change-Id: Ic6f9519f46fa04abd37ea6fc9475bcd9ea721003
When the system time is changed, the UsageStats API
will modify all existing entries to correspond with the
new time change. If the time changed when the device was
off, stats in the future will be deleted.
Change-Id: Ica3e9917d4d1a180f97700e52ab390e3673e1e82
- Fix documentation to mention units of time in APIs.
- Return a Map instead of an ArrayMap
Bug:17289531
Change-Id: I0a2cfdc0bc003eeeb65a16e37bb7b991624b2853
Some events in the future may not have originated
from a class, so we shouldn't be using ComponentName.
Bug:17259858
Change-Id: Id7fe3245b91596cf27ae4ec51655602f01665622
Based on feedback from API council, updated the API.
Also added support for querying the event log.
Change-Id: Ibaa008b9e5bd145acdfe8e20c25c2ed2d96be123