diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index bd6851c939d47..ccf9b898d7b26 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -5534,7 +5534,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public void onServiceDisconnected(ComponentName name) { - notifyScreenshotError(); + synchronized (mScreenshotLock) { + if (mScreenshotConnection != null) { + mContext.unbindService(mScreenshotConnection); + mScreenshotConnection = null; + mHandler.removeCallbacks(mScreenshotTimeout); + notifyScreenshotError(); + } + } } }; if (mContext.bindServiceAsUser(serviceIntent, conn, @@ -7771,7 +7778,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { int delta = newRotation - oldRotation; if (delta < 0) delta += 4; // Likewise we don't rotate seamlessly for 180 degree rotations - // in this case the surfaces never resize, and our logic to + // in this case the surfaces never resize, and our logic to // revert the transformations on size change will fail. We could // fix this in the future with the "tagged" frames idea. if (delta == Surface.ROTATION_180) {