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

Commit 2b65964e authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge remote-tracking branch 'origin/lineage-21.0' into v1-u

parents 79535388 629cf3b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ key BUTTON_START {
}

key BUTTON_SELECT {
    base:                               fallback MENU
    base:                               fallback BACK
}

key BUTTON_MODE {
+11 −1
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver {
    private int mShowPercentMode = MODE_DEFAULT;
    private String mEstimateText = null;
    private boolean mPluggedIn;
    private boolean mPresent;
    private boolean mPowerSaveEnabled;
    private boolean mIsBatteryDefender;
    private boolean mIsIncompatibleCharging;
@@ -389,6 +390,10 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver {
        mBatteryEstimateFetcher = fetcher;
    }

    void setBatteryPresence(boolean isPresent) {
        mPresent = isPresent;
    }

    void setDisplayShieldEnabled(boolean displayShieldEnabled) {
        mDisplayShieldEnabled = displayShieldEnabled;
    }
@@ -605,7 +610,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver {
        mBatteryStateUnknown = isUnknown;
        updateContentDescription();

        if (mBatteryStateUnknown) {
        if (mBatteryStateUnknown && mPresent) {
            mBatteryIconView.setImageDrawable(getUnknownStateDrawable());
        } else {
            updateDrawable();
@@ -693,6 +698,10 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver {
    }

    private void updateDrawable() {
        if (!mPresent) {
            return;
        }

        switch (getBatteryStyle()) {
            case BATTERY_STYLE_PORTRAIT:
                mBatteryIconView.setImageDrawable(mAccessorizedDrawable);
@@ -808,6 +817,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver {
        pw.println("    mBatteryStateUnknown: " + mBatteryStateUnknown);
        pw.println("    mIsIncompatibleCharging: " + mIsIncompatibleCharging);
        pw.println("    mPluggedIn: " + mPluggedIn);
        pw.println("    mPresent: " + mPresent);
        pw.println("    mLevel: " + mLevel);
        pw.println("    mMode: " + mShowPercentMode);
    }
+4 −0
Original line number Diff line number Diff line
@@ -162,8 +162,12 @@ public class BatteryMeterViewController extends ViewController<BatteryMeterView>
        mBatteryController = batteryController;

        mView.setBatteryEstimateFetcher(mBatteryController::getEstimatedTimeRemainingString);
        mView.setBatteryPresence(mBatteryController.isPresent());
        mView.setDisplayShieldEnabled(
                getContext().getResources().getBoolean(R.bool.flag_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
@@ -580,7 +580,7 @@ public class KeyguardIndicationController {
    }

    private void updateLockScreenBatteryMsg(boolean animate) {
        if (mPowerPluggedIn || mEnableBatteryDefender) {
        if (mBatteryPresent && (mPowerPluggedIn || mEnableBatteryDefender)) {
            String powerIndication = computePowerIndication();
            if (DEBUG_CHARGING_SPEED) {
                powerIndication += ",  " + (mChargingWattage / 1000) + " mW";
@@ -596,7 +596,7 @@ public class KeyguardIndicationController {
                    animate);
        } else {
            mKeyguardLogger.log(TAG, LogLevel.DEBUG, "hide battery indication");
            // don't show the charging information if device isn't plugged in
            // don't show the charging information
            mRotateTextViewController.hideIndication(INDICATION_TYPE_BATTERY);
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -81,6 +81,11 @@ public interface BatteryController extends DemoMode,
        return false;
    }

    /**
     * Returns {@code true} if there's a battery present in the device.
     */
    boolean isPresent();

    /**
     * Returns {@code true} if the device is currently in power save mode.
     */
Loading