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

Commit eece668f authored by Bruno Martins's avatar Bruno Martins
Browse files

fixup!^2 BatteryMeterView: Hide icon on battery-less devices

This reverts commit 39483371
and fixes commit 4d1a8699.

Change-Id: I117883d945f64aec1f9fc45d4206d59861dea1d9
parent 60d7470e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver {
    private int mShowPercentMode = MODE_DEFAULT;
    private String mEstimateText = null;
    private boolean mCharging;
    private boolean mPresent = true;
    private boolean mPresent;
    private boolean mIsOverheated;
    private boolean mDisplayShieldEnabled;
    // Error state where we know nothing about the current battery state
+4 −0
Original line number Diff line number Diff line
@@ -146,7 +146,11 @@ public class BatteryMeterViewController extends ViewController<BatteryMeterView>
        mBatteryController = batteryController;

        mView.setBatteryEstimateFetcher(mBatteryController::getEstimatedTimeRemainingString);
        mView.setBatteryPresence(mBatteryController.isPresent());
        mView.setDisplayShieldEnabled(featureFlags.isEnabled(Flags.BATTERY_SHIELD_ICON));
        if (!mBatteryController.isPresent()) {
            mView.setVisibility(View.GONE);
        }

        mSlotBattery = getResources().getString(com.android.internal.R.string.status_bar_battery);
        mSettingObserver = new SettingObserver(mMainHandler);
+2 −2
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC

    protected int mLevel;
    protected boolean mPluggedIn;
    protected boolean mPresent = true;
    protected boolean mPresent;
    private int mPluggedChargingSource;
    protected boolean mCharging;
    private boolean mStateUnknown = false;
@@ -235,7 +235,7 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC
                fireBatteryPresentChanged();
            }

            boolean unknown = !mPresent;
            boolean unknown = !present;
            if (unknown != mStateUnknown) {
                mStateUnknown = unknown;
                fireBatteryUnknownStateChanged();