Change the thread for handling shutdown of PowerManagerService.
Symptom: Watchdog due to blocked handler PowerManagerService during shutdown sequence. Root cause: While creating the dialogue for shutdown, HashMap object is accessed by createView() at LayoutInflater. This object is not excluded at multi threads. When this issue is occurred, multiple threads accesses this object. As the result, invalid state is generated inside HashMap object. And circulating reference is occurred at getEntry method. So system cannot get out of "for" loop. It blockes the processing of PowerManagerService thread and causes watchdog. That thing is happening. Solution: Change the thread for handling shutdown from "PowerManagerService" to "android.ui" thread. As the result, exclusive control is not needed. Bug: 35791029 Test: Manual Change-Id: Icbc12fb2706fb3c7e859f53bbb4c65f488850ce6
This commit is contained in:
@@ -87,6 +87,7 @@ import com.android.server.LockGuard;
|
||||
import com.android.server.RescueParty;
|
||||
import com.android.server.ServiceThread;
|
||||
import com.android.server.SystemService;
|
||||
import com.android.server.UiThread;
|
||||
import com.android.server.Watchdog;
|
||||
import com.android.server.am.BatteryStatsService;
|
||||
import com.android.server.lights.Light;
|
||||
@@ -2728,9 +2729,9 @@ public final class PowerManagerService extends SystemService
|
||||
};
|
||||
|
||||
// ShutdownThread must run on a looper capable of displaying the UI.
|
||||
Message msg = Message.obtain(mHandler, runnable);
|
||||
Message msg = Message.obtain(UiThread.getHandler(), runnable);
|
||||
msg.setAsynchronous(true);
|
||||
mHandler.sendMessage(msg);
|
||||
UiThread.getHandler().sendMessage(msg);
|
||||
|
||||
// PowerManager.reboot() is documented not to return so just wait for the inevitable.
|
||||
if (wait) {
|
||||
|
||||
Reference in New Issue
Block a user