Auto-revoke permissions for unused apps

android.permission.PACKAGE_USAGE_STATS is the minimal required
permission to get app usage stats, as confirmed by the API author
and usage stats is the only place giving us historical app-usage information.

Test: reduce thresholds and test with a toy app
Change-Id: Id8767cab93802d3fc90dc32a93ffb20a53f45ad9
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index d9b3a6c..1c2b087 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -6336,6 +6336,8 @@
         USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
         // permission was automatically revoked after one-time permission expired
         AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
+        // permission was automatically revoked for unused app
+        AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
     }
     // The result of the permission grant
     optional Result result = 6;