Merge "Fix potential race condition problem"
This commit is contained in:
@@ -4212,8 +4212,8 @@ public final class PowerManagerService extends SystemService
|
||||
}
|
||||
|
||||
private boolean forceSuspendInternal(int uid) {
|
||||
try {
|
||||
synchronized (mLock) {
|
||||
synchronized (mLock) {
|
||||
try {
|
||||
mForceSuspendActive = true;
|
||||
// Place the system in an non-interactive state
|
||||
for (int idx = 0; idx < mPowerGroups.size(); idx++) {
|
||||
@@ -4223,16 +4223,14 @@ public final class PowerManagerService extends SystemService
|
||||
|
||||
// Disable all the partial wake locks as well
|
||||
updateWakeLockDisabledStatesLocked();
|
||||
}
|
||||
|
||||
Slog.i(TAG, "Force-Suspending (uid " + uid + ")...");
|
||||
boolean success = mNativeWrapper.nativeForceSuspend();
|
||||
if (!success) {
|
||||
Slog.i(TAG, "Force-Suspending failed in native.");
|
||||
}
|
||||
return success;
|
||||
} finally {
|
||||
synchronized (mLock) {
|
||||
Slog.i(TAG, "Force-Suspending (uid " + uid + ")...");
|
||||
boolean success = mNativeWrapper.nativeForceSuspend();
|
||||
if (!success) {
|
||||
Slog.i(TAG, "Force-Suspending failed in native.");
|
||||
}
|
||||
return success;
|
||||
} finally {
|
||||
mForceSuspendActive = false;
|
||||
// Re-enable wake locks once again.
|
||||
updateWakeLockDisabledStatesLocked();
|
||||
|
||||
Reference in New Issue
Block a user