Loading core/res/res/values/config.xml +0 −5 Original line number Diff line number Diff line Loading @@ -774,11 +774,6 @@ we rely on gravity to determine the effective orientation. --> <bool name="config_deskDockEnablesAccelerometer">true</bool> <!-- Control whether nosensor and locked orientation requests are respected from the app when config_deskDockEnablesAccelerometer is set to false. TODO(b/274763533): Consider making true by default and removing this. --> <bool name="config_deskRespectsNoSensorAndLockedWithoutAccelerometer">false</bool> <!-- Car dock behavior --> <!-- The number of degrees to rotate the display when the device is in a car dock. Loading core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -1698,7 +1698,6 @@ <java-symbol type="bool" name="config_carDockEnablesAccelerometer" /> <java-symbol type="bool" name="config_customUserSwitchUi" /> <java-symbol type="bool" name="config_deskDockEnablesAccelerometer" /> <java-symbol type="bool" name="config_deskRespectsNoSensorAndLockedWithoutAccelerometer" /> <java-symbol type="bool" name="config_disableMenuKeyInLockScreen" /> <java-symbol type="bool" name="config_enableCarDockHomeLaunch" /> <java-symbol type="bool" name="config_enableLockBeforeUnlockScreen" /> Loading services/core/java/com/android/server/wm/DisplayPolicy.java +0 −9 Original line number Diff line number Diff line Loading @@ -184,7 +184,6 @@ public class DisplayPolicy { private final boolean mCarDockEnablesAccelerometer; private final boolean mDeskDockEnablesAccelerometer; private final boolean mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer; private final AccessibilityManager mAccessibilityManager; private final ImmersiveModeConfirmation mImmersiveModeConfirmation; private final ScreenshotHelper mScreenshotHelper; Loading Loading @@ -394,8 +393,6 @@ public class DisplayPolicy { final Resources r = mContext.getResources(); mCarDockEnablesAccelerometer = r.getBoolean(R.bool.config_carDockEnablesAccelerometer); mDeskDockEnablesAccelerometer = r.getBoolean(R.bool.config_deskDockEnablesAccelerometer); mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer = r.getBoolean(R.bool.config_deskRespectsNoSensorAndLockedWithoutAccelerometer); mCanSystemBarsBeShownByUser = !r.getBoolean( R.bool.config_remoteInsetsControllerControlsSystemBars) || r.getBoolean( R.bool.config_remoteInsetsControllerSystemBarsCanBeShownByUserAction); Loading Loading @@ -707,10 +704,6 @@ public class DisplayPolicy { return mDeskDockEnablesAccelerometer; } boolean isDeskDockRespectsNoSensorAndLockedWithoutAccelerometer() { return mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer; } public void setPersistentVrModeEnabled(boolean persistentVrModeEnabled) { mPersistentVrModeEnabled = persistentVrModeEnabled; } Loading Loading @@ -2514,8 +2507,6 @@ public class DisplayPolicy { pw.print("mCarDockEnablesAccelerometer="); pw.print(mCarDockEnablesAccelerometer); pw.print(" mDeskDockEnablesAccelerometer="); pw.println(mDeskDockEnablesAccelerometer); pw.print(" mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer="); pw.println(mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer); pw.print(prefix); pw.print("mDockMode="); pw.print(Intent.dockStateToString(mDockMode)); pw.print(" mLidState="); pw.println(WindowManagerFuncs.lidStateToString(mLidState)); pw.print(prefix); pw.print("mAwake="); pw.print(mAwake); Loading services/core/java/com/android/server/wm/DisplayRotation.java +3 −7 Original line number Diff line number Diff line Loading @@ -1239,10 +1239,6 @@ public class DisplayRotation { mDisplayPolicy.isCarDockEnablesAccelerometer(); final boolean deskDockEnablesAccelerometer = mDisplayPolicy.isDeskDockEnablesAccelerometer(); final boolean deskDockRespectsNoSensorAndLockedWithoutAccelerometer = mDisplayPolicy.isDeskDockRespectsNoSensorAndLockedWithoutAccelerometer() && (orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED || orientation == ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); @Surface.Rotation final int preferredRotation; Loading @@ -1263,10 +1259,10 @@ public class DisplayRotation { || dockMode == Intent.EXTRA_DOCK_STATE_LE_DESK || dockMode == Intent.EXTRA_DOCK_STATE_HE_DESK) && (deskDockEnablesAccelerometer || mDeskDockRotation >= 0) && !deskDockRespectsNoSensorAndLockedWithoutAccelerometer) { && !(orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED || orientation == ActivityInfo.SCREEN_ORIENTATION_NOSENSOR)) { // Ignore sensor when in desk dock unless explicitly enabled. // This case can override the behavior of NOSENSOR, and can also // enable 180 degree rotation while docked. // This case can enable 180 degree rotation while docked. preferredRotation = deskDockEnablesAccelerometer ? sensorRotation : mDeskDockRotation; } else if (hdmiPlugged && mDemoHdmiRotationLock) { // Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled. Loading services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java +0 −2 Original line number Diff line number Diff line Loading @@ -940,8 +940,6 @@ public class DisplayRotationTests { @Test public void testIgnoresDeskDockRotation_whenNoSensorAndLockedRespected() throws Exception { mBuilder.setDeskDockRotation(Surface.ROTATION_270).build(); when(mMockDisplayPolicy.isDeskDockRespectsNoSensorAndLockedWithoutAccelerometer()) .thenReturn(true); configureDisplayRotation(SCREEN_ORIENTATION_LANDSCAPE, false, false); when(mMockDisplayPolicy.getDockMode()).thenReturn(Intent.EXTRA_DOCK_STATE_DESK); Loading Loading
core/res/res/values/config.xml +0 −5 Original line number Diff line number Diff line Loading @@ -774,11 +774,6 @@ we rely on gravity to determine the effective orientation. --> <bool name="config_deskDockEnablesAccelerometer">true</bool> <!-- Control whether nosensor and locked orientation requests are respected from the app when config_deskDockEnablesAccelerometer is set to false. TODO(b/274763533): Consider making true by default and removing this. --> <bool name="config_deskRespectsNoSensorAndLockedWithoutAccelerometer">false</bool> <!-- Car dock behavior --> <!-- The number of degrees to rotate the display when the device is in a car dock. Loading
core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -1698,7 +1698,6 @@ <java-symbol type="bool" name="config_carDockEnablesAccelerometer" /> <java-symbol type="bool" name="config_customUserSwitchUi" /> <java-symbol type="bool" name="config_deskDockEnablesAccelerometer" /> <java-symbol type="bool" name="config_deskRespectsNoSensorAndLockedWithoutAccelerometer" /> <java-symbol type="bool" name="config_disableMenuKeyInLockScreen" /> <java-symbol type="bool" name="config_enableCarDockHomeLaunch" /> <java-symbol type="bool" name="config_enableLockBeforeUnlockScreen" /> Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +0 −9 Original line number Diff line number Diff line Loading @@ -184,7 +184,6 @@ public class DisplayPolicy { private final boolean mCarDockEnablesAccelerometer; private final boolean mDeskDockEnablesAccelerometer; private final boolean mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer; private final AccessibilityManager mAccessibilityManager; private final ImmersiveModeConfirmation mImmersiveModeConfirmation; private final ScreenshotHelper mScreenshotHelper; Loading Loading @@ -394,8 +393,6 @@ public class DisplayPolicy { final Resources r = mContext.getResources(); mCarDockEnablesAccelerometer = r.getBoolean(R.bool.config_carDockEnablesAccelerometer); mDeskDockEnablesAccelerometer = r.getBoolean(R.bool.config_deskDockEnablesAccelerometer); mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer = r.getBoolean(R.bool.config_deskRespectsNoSensorAndLockedWithoutAccelerometer); mCanSystemBarsBeShownByUser = !r.getBoolean( R.bool.config_remoteInsetsControllerControlsSystemBars) || r.getBoolean( R.bool.config_remoteInsetsControllerSystemBarsCanBeShownByUserAction); Loading Loading @@ -707,10 +704,6 @@ public class DisplayPolicy { return mDeskDockEnablesAccelerometer; } boolean isDeskDockRespectsNoSensorAndLockedWithoutAccelerometer() { return mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer; } public void setPersistentVrModeEnabled(boolean persistentVrModeEnabled) { mPersistentVrModeEnabled = persistentVrModeEnabled; } Loading Loading @@ -2514,8 +2507,6 @@ public class DisplayPolicy { pw.print("mCarDockEnablesAccelerometer="); pw.print(mCarDockEnablesAccelerometer); pw.print(" mDeskDockEnablesAccelerometer="); pw.println(mDeskDockEnablesAccelerometer); pw.print(" mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer="); pw.println(mDeskDockRespectsNoSensorAndLockedWithoutAccelerometer); pw.print(prefix); pw.print("mDockMode="); pw.print(Intent.dockStateToString(mDockMode)); pw.print(" mLidState="); pw.println(WindowManagerFuncs.lidStateToString(mLidState)); pw.print(prefix); pw.print("mAwake="); pw.print(mAwake); Loading
services/core/java/com/android/server/wm/DisplayRotation.java +3 −7 Original line number Diff line number Diff line Loading @@ -1239,10 +1239,6 @@ public class DisplayRotation { mDisplayPolicy.isCarDockEnablesAccelerometer(); final boolean deskDockEnablesAccelerometer = mDisplayPolicy.isDeskDockEnablesAccelerometer(); final boolean deskDockRespectsNoSensorAndLockedWithoutAccelerometer = mDisplayPolicy.isDeskDockRespectsNoSensorAndLockedWithoutAccelerometer() && (orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED || orientation == ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); @Surface.Rotation final int preferredRotation; Loading @@ -1263,10 +1259,10 @@ public class DisplayRotation { || dockMode == Intent.EXTRA_DOCK_STATE_LE_DESK || dockMode == Intent.EXTRA_DOCK_STATE_HE_DESK) && (deskDockEnablesAccelerometer || mDeskDockRotation >= 0) && !deskDockRespectsNoSensorAndLockedWithoutAccelerometer) { && !(orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED || orientation == ActivityInfo.SCREEN_ORIENTATION_NOSENSOR)) { // Ignore sensor when in desk dock unless explicitly enabled. // This case can override the behavior of NOSENSOR, and can also // enable 180 degree rotation while docked. // This case can enable 180 degree rotation while docked. preferredRotation = deskDockEnablesAccelerometer ? sensorRotation : mDeskDockRotation; } else if (hdmiPlugged && mDemoHdmiRotationLock) { // Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled. Loading
services/tests/wmtests/src/com/android/server/wm/DisplayRotationTests.java +0 −2 Original line number Diff line number Diff line Loading @@ -940,8 +940,6 @@ public class DisplayRotationTests { @Test public void testIgnoresDeskDockRotation_whenNoSensorAndLockedRespected() throws Exception { mBuilder.setDeskDockRotation(Surface.ROTATION_270).build(); when(mMockDisplayPolicy.isDeskDockRespectsNoSensorAndLockedWithoutAccelerometer()) .thenReturn(true); configureDisplayRotation(SCREEN_ORIENTATION_LANDSCAPE, false, false); when(mMockDisplayPolicy.getDockMode()).thenReturn(Intent.EXTRA_DOCK_STATE_DESK); Loading