Merge change 7572 into donut

* changes:
  Fix issue #1985606 (Boot crash when battery level of < 15% is reported) in Donut
This commit is contained in:
Android (Google) Code Review
2009-07-16 15:18:38 -07:00

View File

@@ -626,7 +626,9 @@ public class StatusBarPolicy {
&& mBatteryThreshold > BATTERY_THRESHOLD_WARNING))) { && mBatteryThreshold > BATTERY_THRESHOLD_WARNING))) {
// Broadcast the low battery warning // Broadcast the low battery warning
mSentLowBatteryBroadcast = true; 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 (SHOW_LOW_BATTERY_WARNING) {
if (false) { if (false) {
@@ -644,7 +646,9 @@ public class StatusBarPolicy {
} else if (mBatteryThreshold < BATTERY_THRESHOLD_WARNING) { } else if (mBatteryThreshold < BATTERY_THRESHOLD_WARNING) {
if (mSentLowBatteryBroadcast == true) { if (mSentLowBatteryBroadcast == true) {
mSentLowBatteryBroadcast = false; 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 (SHOW_LOW_BATTERY_WARNING) {
if (mLowBatteryDialog != null) { if (mLowBatteryDialog != null) {