diff options
| author | 2016-12-16 09:05:54 +0000 | |
|---|---|---|
| committer | 2016-12-16 09:05:54 +0000 | |
| commit | cc43150bd76d1f61ff13e32d9c45ca3beb5d7edc (patch) | |
| tree | 0f4ba57991623c3e39f3a411c4b25daae38b6fa9 | |
| parent | 412ff4dde5fc412a305f6662c65f75f1104385f6 (diff) | |
| parent | 27b53cfe88df05f015c509259993071d54cdcb36 (diff) | |
Don't call into VrManagerService with AM lock.
am: 27b53cfe88
Change-Id: I9670487f160e9ef2af6b8da250943c7ad4749e5d
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index f3d484d55e67..e88b1fa90c21 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -1547,6 +1547,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int NOTIFY_FORCED_RESIZABLE_MSG = 67; static final int NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG = 68; static final int SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG = 69; + static final int NOTIFY_VR_SLEEPING_MSG = 70; static final int FIRST_ACTIVITY_STACK_MSG = 100; static final int FIRST_BROADCAST_QUEUE_MSG = 200; @@ -2362,6 +2363,8 @@ public final class ActivityManagerService extends ActivityManagerNative } } vrService.setVrMode(vrMode, requestedPackage, userId, callingPackage); + } case NOTIFY_VR_SLEEPING_MSG: { + notifyVrManagerOfSleepState(msg.arg1 != 0); } break; } } @@ -3166,6 +3169,11 @@ public final class ActivityManagerService extends ActivityManagerNative mHandler.obtainMessage(VR_MODE_CHANGE_MSG, 0, 0, r)); } + private void sendNotifyVrManagerOfSleepState(boolean isSleeping) { + mHandler.sendMessage( + mHandler.obtainMessage(NOTIFY_VR_SLEEPING_MSG, isSleeping ? 1 : 0, 0)); + } + private void notifyVrManagerOfSleepState(boolean isSleeping) { final VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class); if (vrService == null) { @@ -11710,7 +11718,7 @@ public final class ActivityManagerService extends ActivityManagerNative startTimeTrackingFocusedActivityLocked(); mTopProcessState = ActivityManager.PROCESS_STATE_TOP; mStackSupervisor.comeOutOfSleepIfNeededLocked(); - notifyVrManagerOfSleepState(false); + sendNotifyVrManagerOfSleepState(false); updateOomAdjLocked(); } else if (!mSleeping && shouldSleepLocked()) { mSleeping = true; @@ -11719,7 +11727,7 @@ public final class ActivityManagerService extends ActivityManagerNative } mTopProcessState = ActivityManager.PROCESS_STATE_TOP_SLEEPING; mStackSupervisor.goingToSleepLocked(); - notifyVrManagerOfSleepState(true); + sendNotifyVrManagerOfSleepState(true); updateOomAdjLocked(); // Initialize the wake times of all processes. |