Merge "Fix potential race condition problem" am: 91a15e8ad9 am: 1e5e9923e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2278342 Change-Id: I171e9459c8740887953945075a962e178a2f98ca Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -4292,8 +4292,8 @@ public final class PowerManagerService extends SystemService
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean forceSuspendInternal(int uid) {
|
private boolean forceSuspendInternal(int uid) {
|
||||||
try {
|
synchronized (mLock) {
|
||||||
synchronized (mLock) {
|
try {
|
||||||
mForceSuspendActive = true;
|
mForceSuspendActive = true;
|
||||||
// Place the system in an non-interactive state
|
// Place the system in an non-interactive state
|
||||||
for (int idx = 0; idx < mPowerGroups.size(); idx++) {
|
for (int idx = 0; idx < mPowerGroups.size(); idx++) {
|
||||||
@@ -4303,16 +4303,14 @@ public final class PowerManagerService extends SystemService
|
|||||||
|
|
||||||
// Disable all the partial wake locks as well
|
// Disable all the partial wake locks as well
|
||||||
updateWakeLockDisabledStatesLocked();
|
updateWakeLockDisabledStatesLocked();
|
||||||
}
|
|
||||||
|
|
||||||
Slog.i(TAG, "Force-Suspending (uid " + uid + ")...");
|
Slog.i(TAG, "Force-Suspending (uid " + uid + ")...");
|
||||||
boolean success = mNativeWrapper.nativeForceSuspend();
|
boolean success = mNativeWrapper.nativeForceSuspend();
|
||||||
if (!success) {
|
if (!success) {
|
||||||
Slog.i(TAG, "Force-Suspending failed in native.");
|
Slog.i(TAG, "Force-Suspending failed in native.");
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
} finally {
|
} finally {
|
||||||
synchronized (mLock) {
|
|
||||||
mForceSuspendActive = false;
|
mForceSuspendActive = false;
|
||||||
// Re-enable wake locks once again.
|
// Re-enable wake locks once again.
|
||||||
updateWakeLockDisabledStatesLocked();
|
updateWakeLockDisabledStatesLocked();
|
||||||
|
|||||||
Reference in New Issue
Block a user