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

Commit 0816e0ee authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #1985606 (Boot crash when battery level of < 15% is reported) in Donut

Actually I don't think it is really an issue here, because the status bar doesn't
start itself up like this until after we have booted, but let's be safe.

And DO NOT MERGE since this code has changed in master.
parent 3e1663a2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -626,7 +626,9 @@ public class StatusBarPolicy {
                        && mBatteryThreshold > BATTERY_THRESHOLD_WARNING))) {
            // Broadcast the low battery warning
            mSentLowBatteryBroadcast = true;
            mContext.sendBroadcast(new Intent(Intent.ACTION_BATTERY_LOW));
            Intent batIntent = new Intent(Intent.ACTION_BATTERY_LOW);
            batIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
            mContext.sendBroadcast(batIntent);

            if (SHOW_LOW_BATTERY_WARNING) {
                if (false) {
@@ -644,7 +646,9 @@ public class StatusBarPolicy {
        } else if (mBatteryThreshold < BATTERY_THRESHOLD_WARNING) {
            if (mSentLowBatteryBroadcast == true) {
                mSentLowBatteryBroadcast = false;
                mContext.sendBroadcast(new Intent(Intent.ACTION_BATTERY_OKAY));
                Intent batIntent = new Intent(Intent.ACTION_BATTERY_OKAY);
                batIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
                mContext.sendBroadcast(batIntent);
            }
            if (SHOW_LOW_BATTERY_WARNING) {
                if (mLowBatteryDialog != null) {