From 6bf75d288d3532eba2f68cb21f4e51d1d6c86893 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Thu, 24 Jan 2019 08:14:09 -0800 Subject: [PATCH] Check a flag to see whether or not to show permission usage information. Bug: 122615235 Test: Manually set/unset flag, see/don't see usage information. Change-Id: I2d743fc28c5676a2304dac73ae96734241f3fe1d --- res/xml/location_settings.xml | 2 +- ...entLocationAccessPreferenceController.java | 5 +++- ...ermissionBarChartPreferenceController.java | 6 ++++- ...ocationAccessPreferenceControllerTest.java | 24 +++++++++++++++++++ ...ssionBarChartPreferenceControllerTest.java | 22 ++++++++++++++++- .../testutils/shadow/ShadowDeviceConfig.java | 21 ++++++++++++---- 6 files changed, 71 insertions(+), 9 deletions(-) diff --git a/res/xml/location_settings.xml b/res/xml/location_settings.xml index 72ea3122eb7..29d4048c22f 100644 --- a/res/xml/location_settings.xml +++ b/res/xml/location_settings.xml @@ -28,7 +28,7 @@ + settings:initialExpandedChildrenCount="2"> sPropertyMaps = new HashMap<>(); + + @Resetter + public static void reset() { + sPropertyMaps.clear(); + } @Implementation - protected static boolean setProperty( - String namespace, String name, String value, boolean makeDefault) { - configValue = value; + public static boolean setProperty( + String namespace, String name, String value, boolean makeDefault) { + sPropertyMaps.put(name, value); return true; } @Implementation - protected static String getProperty(String ns, String key) { return configValue; } + public static String getProperty(String namespace, String name) { + return sPropertyMaps.get(name); + } }