From 20a90f9fcf1bfd3da10210cc06f1428edbe92389 Mon Sep 17 00:00:00 2001 From: MSe1969 Date: Thu, 20 Dec 2018 22:12:35 +0100 Subject: [PATCH] AppOps: Default GET_USAGE_STATS to MODE_IGNORED The AppOp OP_GET_USAGE_STATS is defaulted with MODE_DEFAULT and this is resolved to default to ALLOW, if the permission PACKAGE_USAGE_STATS is requested. This can be switched off in a specific settings menu, hence an opt-out is implemented in AOSP. Letting 3rd parties analyze the behavior does not really add any value for the device holder, hence an opt-in makes more sense. Usage stats collection is now disabled by default for apps requesting that permission. If the user wants to allow stats collection, he can enter the respective menu in settings and allow the app to collect usage data. Change-Id: I9e08822851cf660277e45f3023aa80d8918f45ae --- core/java/android/app/AppOpsManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index e13947335d2a..19287b3c13a4 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -930,7 +930,7 @@ AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, - AppOpsManager.MODE_DEFAULT, // OP_GET_USAGE_STATS + AppOpsManager.MODE_IGNORED, // OP_GET_USAGE_STATS AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_IGNORED, // OP_PROJECT_MEDIA @@ -1007,7 +1007,7 @@ AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION AppOpsManager.MODE_ASK, // OP_MONITOR_HIGH_POWER_LOCATION - AppOpsManager.MODE_DEFAULT, // OP_GET_USAGE_STATS + AppOpsManager.MODE_IGNORED, // OP_GET_USAGE_STATS AppOpsManager.MODE_ALLOWED, // OP_MUTE_MICROPHONE AppOpsManager.MODE_ALLOWED, // OP_TOAST_WINDOW AppOpsManager.MODE_IGNORED, // OP_PROJECT_MEDIA