Skip to content

Commit 0447a81

Browse files
author
Craig Mautner
committed
Pull showStrictModeViolation off of local threads.
By moving the StrictModeViolation display onto the WindowManager Handler we avoid potential deadlocks as found in the bug below. Fixes bug 6537798. Change-Id: Ia46a43d1f7f6e55256f770b9e196602092669b49
1 parent ae14715 commit 0447a81

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5256,9 +5256,14 @@ public void setInTouchMode(boolean mode) {
52565256

52575257
// TODO: more accounting of which pid(s) turned it on, keep count,
52585258
// only allow disables from pids which have count on, etc.
5259+
@Override
52595260
public void showStrictModeViolation(boolean on) {
52605261
if (mHeadless) return;
5262+
mH.sendMessage(mH.obtainMessage(H.SHOW_STRICT_MODE_VIOLATION, on ? 1 : 0, 0));
5263+
}
52615264

5265+
private void showStrictModeViolation(int arg) {
5266+
final boolean on = arg != 0;
52625267
int pid = Binder.getCallingPid();
52635268
synchronized(mWindowMap) {
52645269
// Ignoring requests to enable the red border from clients
@@ -6706,6 +6711,7 @@ final class H extends Handler {
67066711
public static final int BOOT_TIMEOUT = 23;
67076712
public static final int WAITING_FOR_DRAWN_TIMEOUT = 24;
67086713
public static final int BULK_UPDATE_PARAMETERS = 25;
6714+
public static final int SHOW_STRICT_MODE_VIOLATION = 26;
67096715

67106716
public static final int ANIMATOR_WHAT_OFFSET = 100000;
67116717
public static final int SET_TRANSPARENT_REGION = ANIMATOR_WHAT_OFFSET + 1;
@@ -7171,6 +7177,11 @@ public void handleMessage(Message msg) {
71717177
break;
71727178
}
71737179

7180+
case SHOW_STRICT_MODE_VIOLATION: {
7181+
showStrictModeViolation(msg.arg1);
7182+
break;
7183+
}
7184+
71747185
// Animation messages. Move to Window{State}Animator
71757186
case SET_TRANSPARENT_REGION: {
71767187
Pair<WindowStateAnimator, Region> pair =

0 commit comments

Comments
 (0)