Let dig into the Android source code:
Battery service
BatteryService, , , , . , , .
/* The ACTION_BATTERY_LOW broadcast is sent in these situations:
* - is just un-plugged (previously was plugged) and battery level is
* less than or equal to WARNING, or
* - is not plugged and battery level falls to WARNING boundary
* (becomes <= mLowBatteryWarningLevel).
*/
final boolean sendBatteryLow = !plugged
&& mBatteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN
&& mBatteryLevel <= mLowBatteryWarningLevel
&& (oldPlugged || mLastBatteryLevel > mLowBatteryWarningLevel);
...
if (sendBatteryLow) {
mSentLowBatteryBroadcast = true;
statusIntent.setAction(Intent.ACTION_BATTERY_LOW);
mContext.sendBroadcast(statusIntent);
}
, Android. , mLowBatteryWarningLevel, com.android.internal.R.integer.config_lowBatteryWarningLevel. root , .
StatusBarPolicy
, , BatteryService , . , . , , , " ". , , StatusBarPolicy. . onBatteryLow() showLowBatteryWarning().
. , .
, , root. root, , ( ).