Fix bug 1982892 - batteryservice turns off device even while plugged in
Also, make the battery service do it, not some keyguard thing.
This commit is contained in:
@ -44,6 +44,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import com.android.internal.app.ShutdownThread;
|
||||
|
||||
|
||||
/**
|
||||
@ -182,6 +183,11 @@ class BatteryService extends Binder {
|
||||
|
||||
boolean logOutlier = false;
|
||||
long dischargeDuration = 0;
|
||||
|
||||
// shut down gracefully if our battery is critically low and we are not powered
|
||||
if (mBatteryLevel == 0 && isPowered(0xffffffff)) {
|
||||
ShutdownThread.shutdown(mContext, false);
|
||||
}
|
||||
|
||||
mBatteryLevelCritical = mBatteryLevel <= CRITICAL_BATTERY_LEVEL;
|
||||
if (mAcOnline) {
|
||||
|
Reference in New Issue
Block a user