Loading core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -798,4 +798,8 @@ <!-- Name of that key handler class --> <string name="config_deviceKeyHandlerClass"></string> <!-- Whether to set a system prop (sys.orientation.landscape) when rotating for devices that have rotating buttons --> <bool name="config_setLandscapeProp">false</bool> </resources> services/java/com/android/server/wm/WindowManagerService.java +11 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,8 @@ public class WindowManagerService extends IWindowManager.Stub final boolean mLimitedAlphaCompositing; final boolean mSetLandscapeProperty; final WindowManagerPolicy mPolicy = PolicyManager.makeNewWindowManager(); final IActivityManager mActivityManager; Loading Loading @@ -755,6 +757,8 @@ public class WindowManagerService extends IWindowManager.Stub mAllowBootMessages = showBootMsgs; mLimitedAlphaCompositing = context.getResources().getBoolean( com.android.internal.R.bool.config_sf_limitedAlpha); mSetLandscapeProperty = context.getResources().getBoolean( com.android.internal.R.bool.config_setLandscapeProp); mPowerManager = pm; mPowerManager.setPolicy(mPolicy); Loading Loading @@ -5050,6 +5054,11 @@ public class WindowManagerService extends IWindowManager.Stub SystemProperties.set(StrictMode.VISUAL_PROPERTY, value); } public void setLandscapeProperty(String value) { if (!mSetLandscapeProperty) return; SystemProperties.set("sys.orientation.landscape", value); } /** * Takes a snapshot of the screen. In landscape mode this grabs the whole screen. * In portrait mode, it grabs the upper region of the screen based on the vertical dimension Loading Loading @@ -6063,8 +6072,10 @@ public class WindowManagerService extends IWindowManager.Stub int orientation = Configuration.ORIENTATION_SQUARE; if (dw < dh) { orientation = Configuration.ORIENTATION_PORTRAIT; setLandscapeProperty("0"); } else if (dw > dh) { orientation = Configuration.ORIENTATION_LANDSCAPE; setLandscapeProperty("1"); } config.orientation = orientation; Loading Loading
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -798,4 +798,8 @@ <!-- Name of that key handler class --> <string name="config_deviceKeyHandlerClass"></string> <!-- Whether to set a system prop (sys.orientation.landscape) when rotating for devices that have rotating buttons --> <bool name="config_setLandscapeProp">false</bool> </resources>
services/java/com/android/server/wm/WindowManagerService.java +11 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,8 @@ public class WindowManagerService extends IWindowManager.Stub final boolean mLimitedAlphaCompositing; final boolean mSetLandscapeProperty; final WindowManagerPolicy mPolicy = PolicyManager.makeNewWindowManager(); final IActivityManager mActivityManager; Loading Loading @@ -755,6 +757,8 @@ public class WindowManagerService extends IWindowManager.Stub mAllowBootMessages = showBootMsgs; mLimitedAlphaCompositing = context.getResources().getBoolean( com.android.internal.R.bool.config_sf_limitedAlpha); mSetLandscapeProperty = context.getResources().getBoolean( com.android.internal.R.bool.config_setLandscapeProp); mPowerManager = pm; mPowerManager.setPolicy(mPolicy); Loading Loading @@ -5050,6 +5054,11 @@ public class WindowManagerService extends IWindowManager.Stub SystemProperties.set(StrictMode.VISUAL_PROPERTY, value); } public void setLandscapeProperty(String value) { if (!mSetLandscapeProperty) return; SystemProperties.set("sys.orientation.landscape", value); } /** * Takes a snapshot of the screen. In landscape mode this grabs the whole screen. * In portrait mode, it grabs the upper region of the screen based on the vertical dimension Loading Loading @@ -6063,8 +6072,10 @@ public class WindowManagerService extends IWindowManager.Stub int orientation = Configuration.ORIENTATION_SQUARE; if (dw < dh) { orientation = Configuration.ORIENTATION_PORTRAIT; setLandscapeProperty("0"); } else if (dw > dh) { orientation = Configuration.ORIENTATION_LANDSCAPE; setLandscapeProperty("1"); } config.orientation = orientation; Loading