Skip to content
Snippets Groups Projects
Commit 860ce027 authored by Michael Bestas's avatar Michael Bestas Committed by Dhina17
Browse files

fixup! SystemUI: Bring back good ol' circle battery style

Change-Id: Id2d3081add9865bf473ad1e4c658a8090fb3a11c
parent cf783915
No related branches found
No related tags found
No related merge requests found
......@@ -509,15 +509,16 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver {
}
// TODO(b/140051051)
final boolean systemSetting = 0 != whitelistIpcs(() -> Settings.System
.getIntForUser(getContext().getContentResolver(),
SHOW_BATTERY_PERCENT, getContext().getResources().getBoolean(
com.android.internal.R.bool.config_defaultBatteryPercentageSetting)
? 1 : 0, UserHandle.USER_CURRENT));
final int showBatteryPercent = Settings.System.getIntForUser(
getContext().getContentResolver(), STATUS_BAR_SHOW_BATTERY_PERCENT, 0,
UserHandle.USER_CURRENT);
final boolean drawPercentInside = mShowPercentMode == MODE_DEFAULT &&
showBatteryPercent == 1;
final boolean drawPercentOnly = mShowPercentMode == MODE_ESTIMATE ||
showBatteryPercent == 2;
boolean shouldShow =
(mShowPercentAvailable && systemSetting && mShowPercentMode != MODE_OFF)
|| mShowPercentMode == MODE_ON;
(drawPercentOnly && (!drawPercentInside || isCharging()) ||
getBatteryStyle() == BATTERY_STYLE_TEXT);
shouldShow = shouldShow && !mBatteryStateUnknown;
setBatteryDrawableState(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment