summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
diff options
context:
space:
mode:
authorLucas Dupin <dupin@google.com>2019-08-09 17:41:15 -0700
committerLucas Dupin <dupin@google.com>2019-08-26 17:45:30 -0700
commit8968f6a9e932db1a343fbad6a3b2020adcb51204 (patch)
tree0ba854c24989fdfa1d023a4169e078f4e4d0e464 /packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
parent72d6d459f1a5736d81fd464c2d7224f187185404 (diff)
IPC StrictMode
This CL introduces a way of blocking IPCs on the main thread. This is enforced by StrictMode, and enabled on tests and eng builds. All current blocking IPCs were whitelisted and bugs will be filed, in order to fix them for R. Bug: 139360025 Test: adb logcat Test: atest SystemUITests Change-Id: I45af2619605ee36b6bae83ef080272c62754b654
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/BatteryMeterView.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/BatteryMeterView.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
index ffa69fa87436..ce61a00fefc3 100644
--- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
+++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
@@ -19,6 +19,7 @@ import static android.app.StatusBarManager.DISABLE2_SYSTEM_ICONS;
import static android.app.StatusBarManager.DISABLE_NONE;
import static android.provider.Settings.System.SHOW_BATTERY_PERCENT;
+import static com.android.systemui.DejankUtils.whitelistIpcs;
import static com.android.systemui.util.SysuiLifecycle.viewAttachLifecycle;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -382,9 +383,10 @@ public class BatteryMeterView extends LinearLayout implements
private void updateShowPercent() {
final boolean showing = mBatteryPercentView != null;
- final boolean systemSetting = 0 != Settings.System
+ // TODO(b/140051051)
+ final boolean systemSetting = 0 != whitelistIpcs(() -> Settings.System
.getIntForUser(getContext().getContentResolver(),
- SHOW_BATTERY_PERCENT, 0, mUser);
+ SHOW_BATTERY_PERCENT, 0, mUser));
if ((mShowPercentAvailable && systemSetting && mShowPercentMode != MODE_OFF)
|| mShowPercentMode == MODE_ON || mShowPercentMode == MODE_ESTIMATE) {