Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 068ab0a2 authored by Michael Bestas's avatar Michael Bestas
Browse files

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

Change-Id: Id2d3081add9865bf473ad1e4c658a8090fb3a11c
parent b7bc2193
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import android.content.res.TypedArray;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
@@ -511,15 +510,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 = LineageSettings.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(