Merge "Fix potential race condition problem" am: 91a15e8ad9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2278342 Change-Id: I76029ca539068c82b87ed090c451d2251db9c6fb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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