20 Commits

Author SHA1 Message Date
Adam Lesinski
0fb25fae8f UsageStatsService: Update file index to prevent double checkin
We seem to have renamed a file as checked-in twice, which means
we checked it in twice and created a malformed name with the suffix
"-c-c" instead of the correct suffix "-c".

Bug:18280677
Change-Id: Ie3164010898a333e5d9b97151d285ea376de799e
2014-11-07 17:36:27 -08:00
Adam Lesinski
32e580604d Fix bug where checking-in more than once would cause an infinite loop in UsageStatsService
- Forgot to increment loop variable :S

Bug:18239732
Change-Id: Ie37a83584d7849108dbfd3bd4cbb595520d488b1
2014-11-04 13:38:46 -08:00
Adam Lesinski
720a5c51be Merge "Add dumpsys output to UsageStatsService, along with --checkin support" into lmp-mr1-dev 2014-10-29 23:11:54 +00:00
Adam Lesinski
1bb18c435d Add dumpsys output to UsageStatsService, along with --checkin support
Bug:17814138
Change-Id: If414ae5f4b8e4a2838f63f52d80e764915cee934
2014-10-24 18:01:04 -07:00
Jeff Hao
7eb599b267 Get UsageStats if no PackageUsage is available for boot dexopt filtering.
Bug: 17191977
Change-Id: I33e18459e49afa42b8e8218574a2434e5205a6da
2014-10-23 11:27:42 -07:00
Brian Carlstrom
a39871ef5e Use VMRuntime.isBootClassPathOnDisk
Bug: 17679443
Change-Id: If53c236058a7237d735c2344a715cf0a36301f9b
2014-09-30 16:49:32 -07:00
Adam Lesinski
3bab7c188d Merge "UsageStats should deal with changing time" into lmp-dev 2014-09-12 01:42:21 +00:00
Adam Lesinski
66143fa5b3 UsageStats should deal with changing time
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
2014-09-11 18:39:01 -07:00
Amith Yamasani
8cd28b57ed Apply cross-user restrictions to Shell
Even though Shell user is allowed to perform cross-user actions,
lock that path down if the target user has restrictions imposed by
the profile owner device admin that prevents access via adb.

If the profile owner has imposed DISALLOW_DEBUGGING_FEATURES, don't
allow the shell user to make the following types of calls:
start activities, make service calls, access content providers,
send broadcasts, block/unblock packages, clear user data, etc.

Bug: 15086577
Change-Id: I9669fc165953076f786ed51cbc17d20d6fa995c3
2014-09-10 17:15:06 -07:00
Adam Lesinski
37a46b48dc Store time offsets for UsageStats XML
This will make adjusting for time changes easier
in the future.

Change-Id: I49d2dda4cc6dcb1378a58c814849924f585e0417
2014-09-05 23:57:42 +00:00
Adam Lesinski
d26bea3a14 Returns UsageEvents from previous days
- Avoid writing to disk when querying UsageStats.
- Use new UnixCalendar to avoid issues with Locale and TimeZone.

Bug: 16951313

Change-Id: I2473b8ef8dc1e2f6be22d4c689b96e346bdcafd5
2014-09-05 23:09:27 +00:00
Adam Lesinski
7f61e96db7 Add Configuration changes to UsageStats
Bug:17354208
Change-Id: I9b2f595e51b656607e30e798926cfb7e25134944
2014-09-04 12:15:32 -07:00
Adam Lesinski
9d9607527f Split up ComponentName in UsageEvents.Event
Some events in the future may not have originated
from a class, so we shouldn't be using ComponentName.

Bug:17259858
Change-Id: Id7fe3245b91596cf27ae4ec51655602f01665622
2014-08-26 12:41:31 -07:00
Narayan Kamath
29564cd245 Remove system_server classes from the boot image.
We set the system_server classpath in the environment
(like we do with BOOTCLASSPATH). After the zygote forks
the system_server, we dexopt the classpath (if needed)
and then launch the system server with the correct
PathClassLoader. This needed several small / medium
refactorings :

- The logic for connecting to installd is now in a separate
  class and belongs in the system_server.
- SystemService / SystemServiceManager have now moved to
  classes.jar. They are only used from there, and since they
  use Class.forName, we want them to be loaded by the
  system_server classloader, and not the bootclassloader.
- BootReceiver now moves to frameworks.jar, because it is
  used by ActivityThread and friends.

bug: 16555230

Change-Id: Ic84f0b2baf611eeedff6d123cb7191bb0259e600
2014-08-15 13:37:03 +01:00
Adam Lesinski
9a0b289f06 Fix NPE in UsageStats for new User
Bug:16946585

Change-Id: Ibd0d674681f3f49087305cea33ce7292f5d2229d
2014-08-12 20:25:37 +00:00
Adam Lesinski
3516800b61 Second iteration of the UsageStats API
Based on feedback from API council, updated the API.
Also added support for querying the event log.

Change-Id: Ibaa008b9e5bd145acdfe8e20c25c2ed2d96be123
2014-08-08 12:08:15 -07:00
Adam Lesinski
3c153519ca Add Per-User logging of UsageStats
Change-Id: I4518c5d3c56b3821292accb886f9fb21f3a8b25f
2014-07-25 17:18:54 +00:00
Adam Lesinski
e159e2e0b8 Add test UsageStats App
Also fixed UsageStatsService to do the right thing
when AppOps returns MODE_DEFAULT.

Change-Id: I0bdb28350fb2528daf2859cdcbbf9ca48d96dde9
2014-07-22 18:21:58 -07:00
Adam Lesinski
53ab92d890 Change UsageStatsService to check uses-permission
Have UsageStatsService check permission grants when AppOps
returns the default MODE_IGNORED mode for a package.

Change-Id: I784a708451a56863b13fc5f178e10bba6ce37a2f
2014-07-21 13:20:25 -07:00
Adam Lesinski
0debc9aff4 First iteration of a public UsageStats API
UsageStats API that allows apps to get a list of packages that have been
recently used, along with basic stats like how long they have been in
the foreground and the most recent time they were running.

Bug: 15165667

Change-Id: I2a2d1ff69bd0b5703ac3d9de1780df42ad90d439
2014-07-18 15:24:20 -07:00