Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +5 −3 Original line number Diff line number Diff line Loading @@ -228,7 +228,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { * manager with lock held. (This lock will be acquired in places * where the window manager is calling in with its own lock held.) */ final Object mLock = new Object(); private final Object mLock = new Object(); Context mContext; IWindowManager mWindowManager; Loading Loading @@ -694,9 +694,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Double the time it takes to take a screenshot from the keyguard return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER * ViewConfiguration.getGlobalActionKeyTimeout()); } else { return ViewConfiguration.getGlobalActionKeyTimeout(); } return ViewConfiguration.getGlobalActionKeyTimeout(); } private void cancelPendingScreenshotChordAction() { Loading Loading @@ -739,6 +738,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { }; private final Runnable mScreenshotRunnable = new Runnable() { @Override public void run() { takeScreenshot(); } Loading Loading @@ -845,6 +845,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public void init(Context context, IWindowManager windowManager, WindowManagerFuncs windowManagerFuncs) { mContext = context; Loading Loading @@ -947,6 +948,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } @Override public void setInitialDisplaySize(Display display, int width, int height, int density) { mDisplay = display; Loading services/java/com/android/server/display/DisplayManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -118,6 +118,9 @@ public final class DisplayManagerService extends IDisplayManager.Stub { // The synchronization root for the display manager. // This lock guards most of the display manager's state. // NOTE: This is synchronized on while holding WindowManagerService.mWindowMap so never call // into WindowManagerService methods that require mWindowMap while holding this unless you are // very very sure that no deadlock can occur. private final SyncRoot mSyncRoot = new SyncRoot(); // True if in safe mode. Loading Loading @@ -158,7 +161,7 @@ public final class DisplayManagerService extends IDisplayManager.Stub { new CopyOnWriteArrayList<DisplayTransactionListener>(); // Set to true if all displays have been blanked by the power manager. private int mAllDisplayBlankStateFromPowerManager; private int mAllDisplayBlankStateFromPowerManager = DISPLAY_BLANK_STATE_UNKNOWN; // Set to true when there are pending display changes that have yet to be applied // to the surface flinger state. Loading Loading @@ -541,9 +544,8 @@ public final class DisplayManagerService extends IDisplayManager.Stub { synchronized (mSyncRoot) { if (mWifiDisplayAdapter != null) { return mWifiDisplayAdapter.getWifiDisplayStatusLocked(); } else { return new WifiDisplayStatus(); } return new WifiDisplayStatus(); } } finally { Binder.restoreCallingIdentity(token); Loading Loading @@ -812,11 +814,9 @@ public final class DisplayManagerService extends IDisplayManager.Stub { Slog.w(TAG, "Missing logical display to use for physical display device: " + device.getDisplayDeviceInfoLocked()); return; } else { boolean isBlanked = (mAllDisplayBlankStateFromPowerManager == DISPLAY_BLANK_STATE_BLANKED); display.configureDisplayInTransactionLocked(device, isBlanked); } boolean isBlanked = (mAllDisplayBlankStateFromPowerManager == DISPLAY_BLANK_STATE_BLANKED); display.configureDisplayInTransactionLocked(device, isBlanked); // Update the viewports if needed. DisplayDeviceInfo info = device.getDisplayDeviceInfoLocked(); Loading services/java/com/android/server/wm/ScreenRotationAnimation.java +1 −2 Original line number Diff line number Diff line Loading @@ -267,8 +267,7 @@ class ScreenRotationAnimation { private void setSnapshotTransformInTransaction(Matrix matrix, float alpha) { if (mSurface != null) { matrix.getValues(mTmpFloats); mSurface.setPosition(mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]); mSurface.setPosition(mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]); mSurface.setMatrix( mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y], mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]); Loading services/java/com/android/server/wm/WindowManagerService.java +36 −61 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public class WindowManagerService extends IWindowManager.Stub // This is held as long as we have the screen frozen, to give us time to // perform a rotation animation when turning off shows the lock screen which // changes the orientation. PowerManager.WakeLock mScreenFrozenLock; private PowerManager.WakeLock mScreenFrozenLock; final AppTransition mAppTransition; boolean mStartingIconInTransition = false; Loading Loading @@ -762,8 +762,7 @@ public class WindowManagerService extends IWindowManager.Stub mPowerManager = pm; mPowerManager.setPolicy(mPolicy); PowerManager pmc = (PowerManager)context.getSystemService(Context.POWER_SERVICE); mScreenFrozenLock = pmc.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SCREEN_FROZEN"); mScreenFrozenLock = pmc.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SCREEN_FROZEN"); mScreenFrozenLock.setReferenceCounted(false); mAppTransition = new AppTransition(context, mH); Loading Loading @@ -2248,8 +2247,6 @@ public class WindowManagerService extends IWindowManager.Stub // Don't do layout here, the window must call // relayout to be displayed, so we'll do it there. //dump(); if (focusChanged) { finishUpdateFocusedWindowAfterAssignLayersLocked(false /*updateInputWindows*/); } Loading Loading @@ -2352,9 +2349,7 @@ public class WindowManagerService extends IWindowManager.Stub removeWindowInnerLocked(session, win); // Removing a visible window will effect the computed orientation // So just update orientation if needed. if (wasVisible && computeForcedAppOrientationLocked() != mForcedAppOrientation && updateOrientationFromAppTokensLocked(false)) { if (wasVisible && updateOrientationFromAppTokensLocked(false)) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/); Loading Loading @@ -3461,11 +3456,9 @@ public class WindowManagerService extends IWindowManager.Stub if (updateOrientationFromAppTokensLocked(false)) { if (freezeThisOneIfNeeded != null) { AppWindowToken atoken = findAppWindowToken( freezeThisOneIfNeeded); AppWindowToken atoken = findAppWindowToken(freezeThisOneIfNeeded); if (atoken != null) { startAppFreezingScreenLocked(atoken, ActivityInfo.CONFIG_ORIENTATION); startAppFreezingScreenLocked(atoken, ActivityInfo.CONFIG_ORIENTATION); } } config = computeNewConfigurationLocked(); Loading Loading @@ -3507,7 +3500,10 @@ public class WindowManagerService extends IWindowManager.Stub boolean updateOrientationFromAppTokensLocked(boolean inTransaction) { long ident = Binder.clearCallingIdentity(); try { int req = computeForcedAppOrientationLocked(); int req = getOrientationFromWindowsLocked(); if (req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { req = getOrientationFromAppTokensLocked(); } if (req != mForcedAppOrientation) { mForcedAppOrientation = req; Loading @@ -3526,14 +3522,6 @@ public class WindowManagerService extends IWindowManager.Stub } } int computeForcedAppOrientationLocked() { int req = getOrientationFromWindowsLocked(); if (req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { req = getOrientationFromAppTokensLocked(); } return req; } @Override public void setNewConfiguration(Configuration config) { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, Loading Loading @@ -4557,40 +4545,6 @@ public class WindowManagerService extends IWindowManager.Stub } } private void moveAppWindowsLocked(AppWindowToken wtoken, int tokenPos, boolean updateFocusAndLayout) { // First remove all of the windows from the list. tmpRemoveAppWindowsLocked(wtoken); // And now add them back at the correct place. DisplayContentsIterator iterator = new DisplayContentsIterator(); while (iterator.hasNext()) { final DisplayContent displayContent = iterator.next(); final WindowList windows = displayContent.getWindowList(); final int pos = findWindowOffsetLocked(windows, tokenPos); final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken); if (pos != newPos) { displayContent.layoutNeeded = true; } if (updateFocusAndLayout && !updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES, false /*updateInputWindows*/)) { assignLayersLocked(windows); } } if (updateFocusAndLayout) { mInputMonitor.setUpdateInputWindowsNeededLw(); // Note that the above updateFocusedWindowLocked conditional used to sit here. if (!mInLayout) { performLayoutAndPlaceSurfacesLocked(); } mInputMonitor.updateInputWindowsLw(false /*force*/); } } private void moveAppWindowsLocked(List<IBinder> tokens, int tokenPos) { // First remove all of the windows from the list. final int N = tokens.size(); Loading Loading @@ -4635,6 +4589,7 @@ public class WindowManagerService extends IWindowManager.Stub //dump(); } @Override public void moveAppTokensToTop(List<IBinder> tokens) { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, "moveAppTokensToTop()")) { Loading Loading @@ -4776,12 +4731,14 @@ public class WindowManagerService extends IWindowManager.Stub /** * @see android.app.KeyguardManager#exitKeyguardSecurely */ @Override public void exitKeyguardSecurely(final IOnKeyguardExitResult callback) { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires DISABLE_KEYGUARD permission"); } mPolicy.exitKeyguardSecurely(new WindowManagerPolicy.OnKeyguardExitResult() { @Override public void onKeyguardExitResult(boolean success) { try { callback.onKeyguardExitResult(success); Loading @@ -4792,18 +4749,22 @@ public class WindowManagerService extends IWindowManager.Stub }); } @Override public boolean inKeyguardRestrictedInputMode() { return mPolicy.inKeyguardRestrictedKeyInputMode(); } @Override public boolean isKeyguardLocked() { return mPolicy.isKeyguardLocked(); } @Override public boolean isKeyguardSecure() { return mPolicy.isKeyguardSecure(); } @Override public void dismissKeyguard() { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) != PackageManager.PERMISSION_GRANTED) { Loading @@ -4814,6 +4775,7 @@ public class WindowManagerService extends IWindowManager.Stub } } @Override public void closeSystemDialogs(String reason) { synchronized(mWindowMap) { final AllWindowsIterator iterator = new AllWindowsIterator(); Loading @@ -4835,6 +4797,7 @@ public class WindowManagerService extends IWindowManager.Stub return Math.abs(scale); } @Override public void setAnimationScale(int which, float scale) { if (!checkCallingPermission(android.Manifest.permission.SET_ANIMATION_SCALE, "setAnimationScale()")) { Loading Loading @@ -5568,8 +5531,7 @@ public class WindowManagerService extends IWindowManager.Stub mWindowsFreezingScreen = true; mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION); mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION); mWaitingForConfig = true; getDefaultDisplayContentLocked().layoutNeeded = true; startFreezingDisplayLocked(inTransaction, 0, 0); Loading Loading @@ -5642,13 +5604,16 @@ public class WindowManagerService extends IWindowManager.Stub return true; } @Override public int getRotation() { return mRotation; } @Override public int watchRotation(IRotationWatcher watcher) { final IBinder watcherBinder = watcher.asBinder(); IBinder.DeathRecipient dr = new IBinder.DeathRecipient() { @Override public void binderDied() { synchronized (mWindowMap) { for (int i=0; i<mRotationWatchers.size(); i++) { Loading Loading @@ -8380,7 +8345,10 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_LAYOUT_REPEATS) debugLayoutRepeats("On entry to LockedInner", displayContent.pendingLayoutChanges); if ((adjustWallpaperWindowsLocked() & ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) { if ((displayContent.pendingLayoutChanges & WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER) != 0 && (adjustWallpaperWindowsLocked() & ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) { assignLayersLocked(windows); displayContent.layoutNeeded = true; } Loading Loading @@ -8902,6 +8870,7 @@ public class WindowManagerService extends IWindowManager.Stub } } @Override public boolean waitForWindowDrawn(IBinder token, IRemoteCallback callback) { if (token != null && callback != null) { synchronized (mWindowMap) { Loading Loading @@ -9425,9 +9394,10 @@ public class WindowManagerService extends IWindowManager.Stub File file = new File("/system/etc/setup.conf"); FileInputStream in = null; DataInputStream ind = null; try { in = new FileInputStream(file); DataInputStream ind = new DataInputStream(in); ind = new DataInputStream(in); String line = ind.readLine(); if (line != null) { String[] toks = line.split("%"); Loading @@ -9439,7 +9409,12 @@ public class WindowManagerService extends IWindowManager.Stub } catch (FileNotFoundException e) { } catch (IOException e) { } finally { if (in != null) { if (ind != null) { try { ind.close(); } catch (IOException e) { } } else if (in != null) { try { in.close(); } catch (IOException e) { Loading services/java/com/android/server/wm/WindowState.java +24 −16 Original line number Diff line number Diff line Loading @@ -215,36 +215,44 @@ final class WindowState implements WindowManagerPolicy.WindowState { int mXOffset; int mYOffset; // This is set after IWindowSession.relayout() has been called at // least once for the window. It allows us to detect the situation // where we don't yet have a surface, but should have one soon, so // we can give the window focus before waiting for the relayout. /** * This is set after IWindowSession.relayout() has been called at * least once for the window. It allows us to detect the situation * where we don't yet have a surface, but should have one soon, so * we can give the window focus before waiting for the relayout. */ boolean mRelayoutCalled; // If the application has called relayout() with changes that can // impact its window's size, we need to perform a layout pass on it // even if it is not currently visible for layout. This is set // when in that case until the layout is done. /** * If the application has called relayout() with changes that can * impact its window's size, we need to perform a layout pass on it * even if it is not currently visible for layout. This is set * when in that case until the layout is done. */ boolean mLayoutNeeded; // Currently running an exit animation? /** Currently running an exit animation? */ boolean mExiting; // Currently on the mDestroySurface list? /** Currently on the mDestroySurface list? */ boolean mDestroying; // Completely remove from window manager after exit animation? /** Completely remove from window manager after exit animation? */ boolean mRemoveOnExit; // Set when the orientation is changing and this window has not yet // been updated for the new orientation. /** * Set when the orientation is changing and this window has not yet * been updated for the new orientation. */ boolean mOrientationChanging; // Is this window now (or just being) removed? /** Is this window now (or just being) removed? */ boolean mRemoved; // Temp for keeping track of windows that have been removed when // rebuilding window list. /** * Temp for keeping track of windows that have been removed when * rebuilding window list. */ boolean mRebuilding; // Input channel and input window handle used by the input dispatcher. Loading Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +5 −3 Original line number Diff line number Diff line Loading @@ -228,7 +228,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { * manager with lock held. (This lock will be acquired in places * where the window manager is calling in with its own lock held.) */ final Object mLock = new Object(); private final Object mLock = new Object(); Context mContext; IWindowManager mWindowManager; Loading Loading @@ -694,9 +694,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Double the time it takes to take a screenshot from the keyguard return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER * ViewConfiguration.getGlobalActionKeyTimeout()); } else { return ViewConfiguration.getGlobalActionKeyTimeout(); } return ViewConfiguration.getGlobalActionKeyTimeout(); } private void cancelPendingScreenshotChordAction() { Loading Loading @@ -739,6 +738,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { }; private final Runnable mScreenshotRunnable = new Runnable() { @Override public void run() { takeScreenshot(); } Loading Loading @@ -845,6 +845,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public void init(Context context, IWindowManager windowManager, WindowManagerFuncs windowManagerFuncs) { mContext = context; Loading Loading @@ -947,6 +948,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } @Override public void setInitialDisplaySize(Display display, int width, int height, int density) { mDisplay = display; Loading
services/java/com/android/server/display/DisplayManagerService.java +7 −7 Original line number Diff line number Diff line Loading @@ -118,6 +118,9 @@ public final class DisplayManagerService extends IDisplayManager.Stub { // The synchronization root for the display manager. // This lock guards most of the display manager's state. // NOTE: This is synchronized on while holding WindowManagerService.mWindowMap so never call // into WindowManagerService methods that require mWindowMap while holding this unless you are // very very sure that no deadlock can occur. private final SyncRoot mSyncRoot = new SyncRoot(); // True if in safe mode. Loading Loading @@ -158,7 +161,7 @@ public final class DisplayManagerService extends IDisplayManager.Stub { new CopyOnWriteArrayList<DisplayTransactionListener>(); // Set to true if all displays have been blanked by the power manager. private int mAllDisplayBlankStateFromPowerManager; private int mAllDisplayBlankStateFromPowerManager = DISPLAY_BLANK_STATE_UNKNOWN; // Set to true when there are pending display changes that have yet to be applied // to the surface flinger state. Loading Loading @@ -541,9 +544,8 @@ public final class DisplayManagerService extends IDisplayManager.Stub { synchronized (mSyncRoot) { if (mWifiDisplayAdapter != null) { return mWifiDisplayAdapter.getWifiDisplayStatusLocked(); } else { return new WifiDisplayStatus(); } return new WifiDisplayStatus(); } } finally { Binder.restoreCallingIdentity(token); Loading Loading @@ -812,11 +814,9 @@ public final class DisplayManagerService extends IDisplayManager.Stub { Slog.w(TAG, "Missing logical display to use for physical display device: " + device.getDisplayDeviceInfoLocked()); return; } else { boolean isBlanked = (mAllDisplayBlankStateFromPowerManager == DISPLAY_BLANK_STATE_BLANKED); display.configureDisplayInTransactionLocked(device, isBlanked); } boolean isBlanked = (mAllDisplayBlankStateFromPowerManager == DISPLAY_BLANK_STATE_BLANKED); display.configureDisplayInTransactionLocked(device, isBlanked); // Update the viewports if needed. DisplayDeviceInfo info = device.getDisplayDeviceInfoLocked(); Loading
services/java/com/android/server/wm/ScreenRotationAnimation.java +1 −2 Original line number Diff line number Diff line Loading @@ -267,8 +267,7 @@ class ScreenRotationAnimation { private void setSnapshotTransformInTransaction(Matrix matrix, float alpha) { if (mSurface != null) { matrix.getValues(mTmpFloats); mSurface.setPosition(mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]); mSurface.setPosition(mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]); mSurface.setMatrix( mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y], mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]); Loading
services/java/com/android/server/wm/WindowManagerService.java +36 −61 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public class WindowManagerService extends IWindowManager.Stub // This is held as long as we have the screen frozen, to give us time to // perform a rotation animation when turning off shows the lock screen which // changes the orientation. PowerManager.WakeLock mScreenFrozenLock; private PowerManager.WakeLock mScreenFrozenLock; final AppTransition mAppTransition; boolean mStartingIconInTransition = false; Loading Loading @@ -762,8 +762,7 @@ public class WindowManagerService extends IWindowManager.Stub mPowerManager = pm; mPowerManager.setPolicy(mPolicy); PowerManager pmc = (PowerManager)context.getSystemService(Context.POWER_SERVICE); mScreenFrozenLock = pmc.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SCREEN_FROZEN"); mScreenFrozenLock = pmc.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SCREEN_FROZEN"); mScreenFrozenLock.setReferenceCounted(false); mAppTransition = new AppTransition(context, mH); Loading Loading @@ -2248,8 +2247,6 @@ public class WindowManagerService extends IWindowManager.Stub // Don't do layout here, the window must call // relayout to be displayed, so we'll do it there. //dump(); if (focusChanged) { finishUpdateFocusedWindowAfterAssignLayersLocked(false /*updateInputWindows*/); } Loading Loading @@ -2352,9 +2349,7 @@ public class WindowManagerService extends IWindowManager.Stub removeWindowInnerLocked(session, win); // Removing a visible window will effect the computed orientation // So just update orientation if needed. if (wasVisible && computeForcedAppOrientationLocked() != mForcedAppOrientation && updateOrientationFromAppTokensLocked(false)) { if (wasVisible && updateOrientationFromAppTokensLocked(false)) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/); Loading Loading @@ -3461,11 +3456,9 @@ public class WindowManagerService extends IWindowManager.Stub if (updateOrientationFromAppTokensLocked(false)) { if (freezeThisOneIfNeeded != null) { AppWindowToken atoken = findAppWindowToken( freezeThisOneIfNeeded); AppWindowToken atoken = findAppWindowToken(freezeThisOneIfNeeded); if (atoken != null) { startAppFreezingScreenLocked(atoken, ActivityInfo.CONFIG_ORIENTATION); startAppFreezingScreenLocked(atoken, ActivityInfo.CONFIG_ORIENTATION); } } config = computeNewConfigurationLocked(); Loading Loading @@ -3507,7 +3500,10 @@ public class WindowManagerService extends IWindowManager.Stub boolean updateOrientationFromAppTokensLocked(boolean inTransaction) { long ident = Binder.clearCallingIdentity(); try { int req = computeForcedAppOrientationLocked(); int req = getOrientationFromWindowsLocked(); if (req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { req = getOrientationFromAppTokensLocked(); } if (req != mForcedAppOrientation) { mForcedAppOrientation = req; Loading @@ -3526,14 +3522,6 @@ public class WindowManagerService extends IWindowManager.Stub } } int computeForcedAppOrientationLocked() { int req = getOrientationFromWindowsLocked(); if (req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { req = getOrientationFromAppTokensLocked(); } return req; } @Override public void setNewConfiguration(Configuration config) { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, Loading Loading @@ -4557,40 +4545,6 @@ public class WindowManagerService extends IWindowManager.Stub } } private void moveAppWindowsLocked(AppWindowToken wtoken, int tokenPos, boolean updateFocusAndLayout) { // First remove all of the windows from the list. tmpRemoveAppWindowsLocked(wtoken); // And now add them back at the correct place. DisplayContentsIterator iterator = new DisplayContentsIterator(); while (iterator.hasNext()) { final DisplayContent displayContent = iterator.next(); final WindowList windows = displayContent.getWindowList(); final int pos = findWindowOffsetLocked(windows, tokenPos); final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken); if (pos != newPos) { displayContent.layoutNeeded = true; } if (updateFocusAndLayout && !updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES, false /*updateInputWindows*/)) { assignLayersLocked(windows); } } if (updateFocusAndLayout) { mInputMonitor.setUpdateInputWindowsNeededLw(); // Note that the above updateFocusedWindowLocked conditional used to sit here. if (!mInLayout) { performLayoutAndPlaceSurfacesLocked(); } mInputMonitor.updateInputWindowsLw(false /*force*/); } } private void moveAppWindowsLocked(List<IBinder> tokens, int tokenPos) { // First remove all of the windows from the list. final int N = tokens.size(); Loading Loading @@ -4635,6 +4589,7 @@ public class WindowManagerService extends IWindowManager.Stub //dump(); } @Override public void moveAppTokensToTop(List<IBinder> tokens) { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, "moveAppTokensToTop()")) { Loading Loading @@ -4776,12 +4731,14 @@ public class WindowManagerService extends IWindowManager.Stub /** * @see android.app.KeyguardManager#exitKeyguardSecurely */ @Override public void exitKeyguardSecurely(final IOnKeyguardExitResult callback) { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires DISABLE_KEYGUARD permission"); } mPolicy.exitKeyguardSecurely(new WindowManagerPolicy.OnKeyguardExitResult() { @Override public void onKeyguardExitResult(boolean success) { try { callback.onKeyguardExitResult(success); Loading @@ -4792,18 +4749,22 @@ public class WindowManagerService extends IWindowManager.Stub }); } @Override public boolean inKeyguardRestrictedInputMode() { return mPolicy.inKeyguardRestrictedKeyInputMode(); } @Override public boolean isKeyguardLocked() { return mPolicy.isKeyguardLocked(); } @Override public boolean isKeyguardSecure() { return mPolicy.isKeyguardSecure(); } @Override public void dismissKeyguard() { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DISABLE_KEYGUARD) != PackageManager.PERMISSION_GRANTED) { Loading @@ -4814,6 +4775,7 @@ public class WindowManagerService extends IWindowManager.Stub } } @Override public void closeSystemDialogs(String reason) { synchronized(mWindowMap) { final AllWindowsIterator iterator = new AllWindowsIterator(); Loading @@ -4835,6 +4797,7 @@ public class WindowManagerService extends IWindowManager.Stub return Math.abs(scale); } @Override public void setAnimationScale(int which, float scale) { if (!checkCallingPermission(android.Manifest.permission.SET_ANIMATION_SCALE, "setAnimationScale()")) { Loading Loading @@ -5568,8 +5531,7 @@ public class WindowManagerService extends IWindowManager.Stub mWindowsFreezingScreen = true; mH.removeMessages(H.WINDOW_FREEZE_TIMEOUT); mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION); mH.sendEmptyMessageDelayed(H.WINDOW_FREEZE_TIMEOUT, WINDOW_FREEZE_TIMEOUT_DURATION); mWaitingForConfig = true; getDefaultDisplayContentLocked().layoutNeeded = true; startFreezingDisplayLocked(inTransaction, 0, 0); Loading Loading @@ -5642,13 +5604,16 @@ public class WindowManagerService extends IWindowManager.Stub return true; } @Override public int getRotation() { return mRotation; } @Override public int watchRotation(IRotationWatcher watcher) { final IBinder watcherBinder = watcher.asBinder(); IBinder.DeathRecipient dr = new IBinder.DeathRecipient() { @Override public void binderDied() { synchronized (mWindowMap) { for (int i=0; i<mRotationWatchers.size(); i++) { Loading Loading @@ -8380,7 +8345,10 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_LAYOUT_REPEATS) debugLayoutRepeats("On entry to LockedInner", displayContent.pendingLayoutChanges); if ((adjustWallpaperWindowsLocked() & ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) { if ((displayContent.pendingLayoutChanges & WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER) != 0 && (adjustWallpaperWindowsLocked() & ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) { assignLayersLocked(windows); displayContent.layoutNeeded = true; } Loading Loading @@ -8902,6 +8870,7 @@ public class WindowManagerService extends IWindowManager.Stub } } @Override public boolean waitForWindowDrawn(IBinder token, IRemoteCallback callback) { if (token != null && callback != null) { synchronized (mWindowMap) { Loading Loading @@ -9425,9 +9394,10 @@ public class WindowManagerService extends IWindowManager.Stub File file = new File("/system/etc/setup.conf"); FileInputStream in = null; DataInputStream ind = null; try { in = new FileInputStream(file); DataInputStream ind = new DataInputStream(in); ind = new DataInputStream(in); String line = ind.readLine(); if (line != null) { String[] toks = line.split("%"); Loading @@ -9439,7 +9409,12 @@ public class WindowManagerService extends IWindowManager.Stub } catch (FileNotFoundException e) { } catch (IOException e) { } finally { if (in != null) { if (ind != null) { try { ind.close(); } catch (IOException e) { } } else if (in != null) { try { in.close(); } catch (IOException e) { Loading
services/java/com/android/server/wm/WindowState.java +24 −16 Original line number Diff line number Diff line Loading @@ -215,36 +215,44 @@ final class WindowState implements WindowManagerPolicy.WindowState { int mXOffset; int mYOffset; // This is set after IWindowSession.relayout() has been called at // least once for the window. It allows us to detect the situation // where we don't yet have a surface, but should have one soon, so // we can give the window focus before waiting for the relayout. /** * This is set after IWindowSession.relayout() has been called at * least once for the window. It allows us to detect the situation * where we don't yet have a surface, but should have one soon, so * we can give the window focus before waiting for the relayout. */ boolean mRelayoutCalled; // If the application has called relayout() with changes that can // impact its window's size, we need to perform a layout pass on it // even if it is not currently visible for layout. This is set // when in that case until the layout is done. /** * If the application has called relayout() with changes that can * impact its window's size, we need to perform a layout pass on it * even if it is not currently visible for layout. This is set * when in that case until the layout is done. */ boolean mLayoutNeeded; // Currently running an exit animation? /** Currently running an exit animation? */ boolean mExiting; // Currently on the mDestroySurface list? /** Currently on the mDestroySurface list? */ boolean mDestroying; // Completely remove from window manager after exit animation? /** Completely remove from window manager after exit animation? */ boolean mRemoveOnExit; // Set when the orientation is changing and this window has not yet // been updated for the new orientation. /** * Set when the orientation is changing and this window has not yet * been updated for the new orientation. */ boolean mOrientationChanging; // Is this window now (or just being) removed? /** Is this window now (or just being) removed? */ boolean mRemoved; // Temp for keeping track of windows that have been removed when // rebuilding window list. /** * Temp for keeping track of windows that have been removed when * rebuilding window list. */ boolean mRebuilding; // Input channel and input window handle used by the input dispatcher. Loading