Loading services/core/java/com/android/server/wm/WindowManagerService.java +21 −10 Original line number Diff line number Diff line Loading @@ -441,8 +441,15 @@ public class WindowManagerService extends IWindowManager.Stub int mRotation = 0; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; boolean mAltOrientation = false; ArrayList<IRotationWatcher> mRotationWatchers = new ArrayList<IRotationWatcher>(); class RotationWatcher { IRotationWatcher watcher; IBinder.DeathRecipient dr; RotationWatcher(IRotationWatcher w, IBinder.DeathRecipient d) { watcher = w; dr = d; } } ArrayList<RotationWatcher> mRotationWatchers = new ArrayList<RotationWatcher>(); int mDeferredRotationPauseCount; int mSystemDecorLayer = 0; Loading Loading @@ -6076,7 +6083,7 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=mRotationWatchers.size()-1; i>=0; i--) { try { mRotationWatchers.get(i).onRotationChanged(rotation); mRotationWatchers.get(i).watcher.onRotationChanged(rotation); } catch (RemoteException e) { } } Loading Loading @@ -6108,10 +6115,10 @@ public class WindowManagerService extends IWindowManager.Stub public void binderDied() { synchronized (mWindowMap) { for (int i=0; i<mRotationWatchers.size(); i++) { if (watcherBinder == mRotationWatchers.get(i).asBinder()) { IRotationWatcher removed = mRotationWatchers.remove(i); if (watcherBinder == mRotationWatchers.get(i).watcher.asBinder()) { RotationWatcher removed = mRotationWatchers.remove(i); if (removed != null) { removed.asBinder().unlinkToDeath(this, 0); removed.watcher.asBinder().unlinkToDeath(this, 0); } i--; } Loading @@ -6123,7 +6130,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { try { watcher.asBinder().linkToDeath(dr, 0); mRotationWatchers.add(watcher); mRotationWatchers.add(new RotationWatcher(watcher, dr)); } catch (RemoteException e) { // Client died, no cleanup needed. } Loading @@ -6137,13 +6144,17 @@ public class WindowManagerService extends IWindowManager.Stub final IBinder watcherBinder = watcher.asBinder(); synchronized (mWindowMap) { for (int i=0; i<mRotationWatchers.size(); i++) { if (watcherBinder == mRotationWatchers.get(i).asBinder()) { mRotationWatchers.remove(i); RotationWatcher rotationWatcher = mRotationWatchers.get(i); if (watcherBinder == rotationWatcher.watcher.asBinder()) { RotationWatcher removed = mRotationWatchers.remove(i); if (removed != null) { removed.watcher.asBinder().unlinkToDeath(removed.dr, 0); i--; } } } } } /** * Apps that use the compact menu panel (as controlled by the panelMenuIsCompact Loading Loading
services/core/java/com/android/server/wm/WindowManagerService.java +21 −10 Original line number Diff line number Diff line Loading @@ -441,8 +441,15 @@ public class WindowManagerService extends IWindowManager.Stub int mRotation = 0; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; boolean mAltOrientation = false; ArrayList<IRotationWatcher> mRotationWatchers = new ArrayList<IRotationWatcher>(); class RotationWatcher { IRotationWatcher watcher; IBinder.DeathRecipient dr; RotationWatcher(IRotationWatcher w, IBinder.DeathRecipient d) { watcher = w; dr = d; } } ArrayList<RotationWatcher> mRotationWatchers = new ArrayList<RotationWatcher>(); int mDeferredRotationPauseCount; int mSystemDecorLayer = 0; Loading Loading @@ -6076,7 +6083,7 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=mRotationWatchers.size()-1; i>=0; i--) { try { mRotationWatchers.get(i).onRotationChanged(rotation); mRotationWatchers.get(i).watcher.onRotationChanged(rotation); } catch (RemoteException e) { } } Loading Loading @@ -6108,10 +6115,10 @@ public class WindowManagerService extends IWindowManager.Stub public void binderDied() { synchronized (mWindowMap) { for (int i=0; i<mRotationWatchers.size(); i++) { if (watcherBinder == mRotationWatchers.get(i).asBinder()) { IRotationWatcher removed = mRotationWatchers.remove(i); if (watcherBinder == mRotationWatchers.get(i).watcher.asBinder()) { RotationWatcher removed = mRotationWatchers.remove(i); if (removed != null) { removed.asBinder().unlinkToDeath(this, 0); removed.watcher.asBinder().unlinkToDeath(this, 0); } i--; } Loading @@ -6123,7 +6130,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { try { watcher.asBinder().linkToDeath(dr, 0); mRotationWatchers.add(watcher); mRotationWatchers.add(new RotationWatcher(watcher, dr)); } catch (RemoteException e) { // Client died, no cleanup needed. } Loading @@ -6137,13 +6144,17 @@ public class WindowManagerService extends IWindowManager.Stub final IBinder watcherBinder = watcher.asBinder(); synchronized (mWindowMap) { for (int i=0; i<mRotationWatchers.size(); i++) { if (watcherBinder == mRotationWatchers.get(i).asBinder()) { mRotationWatchers.remove(i); RotationWatcher rotationWatcher = mRotationWatchers.get(i); if (watcherBinder == rotationWatcher.watcher.asBinder()) { RotationWatcher removed = mRotationWatchers.remove(i); if (removed != null) { removed.watcher.asBinder().unlinkToDeath(removed.dr, 0); i--; } } } } } /** * Apps that use the compact menu panel (as controlled by the panelMenuIsCompact Loading