From 697650b3b7605fbef1d507de87a704751497fe66 Mon Sep 17 00:00:00 2001 From: Nate Myren Date: Thu, 23 Jan 2020 13:25:06 -0800 Subject: Disable user-facing historical app ops methods Disable the ability to see historical app ops using dumpsys, and by calling "getHistoricalOps", unless the calling package has an instrumentation, or is the statsd package. Fixes: 148227477 Test: attempt to call into getHistoricalOps while not an instrumented application or statsd. The method should return an empty bundle. Run "adb shell dumpsys appops --history" should return "no such arg", and "adb shell dumpsys appops -h" should not show "--history" in the args. Change-Id: Ie5ad9a90ffc0473aba958199450bcff9315f71a6 --- core/java/android/os/Process.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/java/android/os/Process.java') diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index 5d80ab6453cc..8afbcefe0403 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -172,6 +172,12 @@ public class Process { */ public static final int OTA_UPDATE_UID = 1061; + /** + * Defines the UID used for statsd + * @hide + */ + public static final int STATSD_UID = 1066; + /** * Defines the UID used for incidentd. * @hide -- cgit v1.2.3