diff options
| -rw-r--r-- | services/java/com/android/server/status/StatusBarPolicy.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/status/StatusBarPolicy.java b/services/java/com/android/server/status/StatusBarPolicy.java index 7a8d4e5ed40b..a4b47b523baa 100644 --- a/services/java/com/android/server/status/StatusBarPolicy.java +++ b/services/java/com/android/server/status/StatusBarPolicy.java @@ -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) { |