Loading services/java/com/android/server/WindowManagerService.java +49 −33 Original line number Diff line number Diff line Loading @@ -390,6 +390,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo final Rect mTempRect = new Rect(); final Configuration mTempConfiguration = new Configuration(); public static WindowManagerService main(Context context, PowerManagerService pm, boolean haveInputMethods) { WMThread thr = new WMThread(context, pm, haveInputMethods); Loading Loading @@ -2174,16 +2176,19 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo ActivityInfo.CONFIG_ORIENTATION); } } return computeNewConfiguration(); return computeNewConfigurationLocked(); } } // No obvious action we need to take, but if our current // state mismatches the activity maanager's, update it if (appConfig != null) { Configuration wmConfig = computeNewConfiguration(); if (wmConfig.diff(appConfig) != 0) { return wmConfig; mTempConfiguration.setToDefaults(); if (computeNewConfigurationLocked(mTempConfiguration)) { if (appConfig.diff(mTempConfiguration) != 0) { Log.i(TAG, "Config changed: " + mTempConfiguration); return new Configuration(mTempConfiguration); } } } } finally { Loading Loading @@ -3628,24 +3633,16 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo public Configuration computeNewConfiguration() { synchronized (mWindowMap) { if (mDisplay == null) { return null; return computeNewConfigurationLocked(); } } Configuration computeNewConfigurationLocked() { Configuration config = new Configuration(); mQueue.getInputConfiguration(config); final int dw = mDisplay.getWidth(); final int dh = mDisplay.getHeight(); int orientation = Configuration.ORIENTATION_SQUARE; if (dw < dh) { orientation = Configuration.ORIENTATION_PORTRAIT; } else if (dw > dh) { orientation = Configuration.ORIENTATION_LANDSCAPE; if (!computeNewConfigurationLocked(config)) { return null; } config.orientation = orientation; config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO; config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO; mPolicy.adjustConfigurationLw(config); Log.i(TAG, "Input configuration changed: " + config); Log.i(TAG, "Config changed: " + config); long now = SystemClock.uptimeMillis(); //Log.i(TAG, "Config changing, gc pending: " + mFreezeGcPending + ", now " + now); if (mFreezeGcPending != 0) { Loading @@ -3660,6 +3657,25 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo } return config; } boolean computeNewConfigurationLocked(Configuration config) { if (mDisplay == null) { return false; } mQueue.getInputConfiguration(config); final int dw = mDisplay.getWidth(); final int dh = mDisplay.getHeight(); int orientation = Configuration.ORIENTATION_SQUARE; if (dw < dh) { orientation = Configuration.ORIENTATION_PORTRAIT; } else if (dw > dh) { orientation = Configuration.ORIENTATION_LANDSCAPE; } config.orientation = orientation; config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO; config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO; mPolicy.adjustConfigurationLw(config); return true; } // ------------------------------------------------------------- Loading Loading
services/java/com/android/server/WindowManagerService.java +49 −33 Original line number Diff line number Diff line Loading @@ -390,6 +390,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo final Rect mTempRect = new Rect(); final Configuration mTempConfiguration = new Configuration(); public static WindowManagerService main(Context context, PowerManagerService pm, boolean haveInputMethods) { WMThread thr = new WMThread(context, pm, haveInputMethods); Loading Loading @@ -2174,16 +2176,19 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo ActivityInfo.CONFIG_ORIENTATION); } } return computeNewConfiguration(); return computeNewConfigurationLocked(); } } // No obvious action we need to take, but if our current // state mismatches the activity maanager's, update it if (appConfig != null) { Configuration wmConfig = computeNewConfiguration(); if (wmConfig.diff(appConfig) != 0) { return wmConfig; mTempConfiguration.setToDefaults(); if (computeNewConfigurationLocked(mTempConfiguration)) { if (appConfig.diff(mTempConfiguration) != 0) { Log.i(TAG, "Config changed: " + mTempConfiguration); return new Configuration(mTempConfiguration); } } } } finally { Loading Loading @@ -3628,24 +3633,16 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo public Configuration computeNewConfiguration() { synchronized (mWindowMap) { if (mDisplay == null) { return null; return computeNewConfigurationLocked(); } } Configuration computeNewConfigurationLocked() { Configuration config = new Configuration(); mQueue.getInputConfiguration(config); final int dw = mDisplay.getWidth(); final int dh = mDisplay.getHeight(); int orientation = Configuration.ORIENTATION_SQUARE; if (dw < dh) { orientation = Configuration.ORIENTATION_PORTRAIT; } else if (dw > dh) { orientation = Configuration.ORIENTATION_LANDSCAPE; if (!computeNewConfigurationLocked(config)) { return null; } config.orientation = orientation; config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO; config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO; mPolicy.adjustConfigurationLw(config); Log.i(TAG, "Input configuration changed: " + config); Log.i(TAG, "Config changed: " + config); long now = SystemClock.uptimeMillis(); //Log.i(TAG, "Config changing, gc pending: " + mFreezeGcPending + ", now " + now); if (mFreezeGcPending != 0) { Loading @@ -3660,6 +3657,25 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo } return config; } boolean computeNewConfigurationLocked(Configuration config) { if (mDisplay == null) { return false; } mQueue.getInputConfiguration(config); final int dw = mDisplay.getWidth(); final int dh = mDisplay.getHeight(); int orientation = Configuration.ORIENTATION_SQUARE; if (dw < dh) { orientation = Configuration.ORIENTATION_PORTRAIT; } else if (dw > dh) { orientation = Configuration.ORIENTATION_LANDSCAPE; } config.orientation = orientation; config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO; config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO; mPolicy.adjustConfigurationLw(config); return true; } // ------------------------------------------------------------- Loading