am 71106558: Merge "Add thermal shutdown. If battery temp >= 68C." into froyo
Merge commit '711065587b46ea0279788757c49a273ff796f844' into froyo-plus-aosp * commit '711065587b46ea0279788757c49a273ff796f844': Add thermal shutdown. If battery temp >= 68C.
This commit is contained in:
@@ -177,6 +177,7 @@ class BatteryService extends Binder {
|
|||||||
void systemReady() {
|
void systemReady() {
|
||||||
// check our power situation now that it is safe to display the shutdown dialog.
|
// check our power situation now that it is safe to display the shutdown dialog.
|
||||||
shutdownIfNoPower();
|
shutdownIfNoPower();
|
||||||
|
shutdownIfOverTemp();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void shutdownIfNoPower() {
|
private final void shutdownIfNoPower() {
|
||||||
@@ -190,6 +191,17 @@ class BatteryService extends Binder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final void shutdownIfOverTemp() {
|
||||||
|
// shut down gracefully if temperature is too high (> 68.0C)
|
||||||
|
// wait until the system has booted before attempting to display the shutdown dialog.
|
||||||
|
if (mBatteryTemperature > 680 && ActivityManagerNative.isSystemReady()) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_REQUEST_SHUTDOWN);
|
||||||
|
intent.putExtra(Intent.EXTRA_KEY_CONFIRM, false);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private native void native_update();
|
private native void native_update();
|
||||||
|
|
||||||
private synchronized final void update() {
|
private synchronized final void update() {
|
||||||
@@ -199,6 +211,7 @@ class BatteryService extends Binder {
|
|||||||
long dischargeDuration = 0;
|
long dischargeDuration = 0;
|
||||||
|
|
||||||
shutdownIfNoPower();
|
shutdownIfNoPower();
|
||||||
|
shutdownIfOverTemp();
|
||||||
|
|
||||||
mBatteryLevelCritical = mBatteryLevel <= CRITICAL_BATTERY_LEVEL;
|
mBatteryLevelCritical = mBatteryLevel <= CRITICAL_BATTERY_LEVEL;
|
||||||
if (mAcOnline) {
|
if (mAcOnline) {
|
||||||
|
|||||||
Reference in New Issue
Block a user