Loading src/com/android/settings/display/DeviceStateAutoRotateSettingController.java +5 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,11 @@ public class DeviceStateAutoRotateSettingController extends TogglePreferenceCont @Override public boolean isChecked() { return !mAutoRotateSettingsManager.isRotationLocked(mDeviceState); // It is highly unlikely to receive null value here. In the improbable event of null, a // non-null update will follow shortly, and the users will potentially see incorrect // state for a short time. final Boolean isRotationLocked = mAutoRotateSettingsManager.isRotationLocked(mDeviceState); return isRotationLocked != null && !isRotationLocked; } @Override Loading src/com/android/settings/display/SmartAutoRotateController.java +7 −3 Original line number Diff line number Diff line Loading @@ -85,8 +85,7 @@ public class SmartAutoRotateController extends TogglePreferenceController implem mPrivacyManager = SensorPrivacyManager.getInstance(context); mPowerManager = context.getSystemService(PowerManager.class); mDeviceStateAutoRotateSettingsManager = DeviceStateAutoRotateSettingManagerProvider.getSingletonInstance( context); DeviceStateAutoRotateSettingManagerProvider.getSingletonInstance(context); } @Override Loading @@ -100,7 +99,12 @@ public class SmartAutoRotateController extends TogglePreferenceController implem protected boolean isRotationLocked() { if (DeviceStateAutoRotationHelper.isDeviceStateRotationEnabled(mContext)) { return mDeviceStateAutoRotateSettingsManager.isRotationLockedForAllStates(); // It is highly unlikely to receive null value here. In the improbable event of null, a // non-null update will follow shortly, and the users will potentially see incorrect // state for a short time. final Boolean isRotationLockedForAllStates = mDeviceStateAutoRotateSettingsManager.isRotationLockedForAllStates(); return isRotationLockedForAllStates == null || isRotationLockedForAllStates; } return RotationPolicy.isRotationLocked(mContext); } Loading Loading
src/com/android/settings/display/DeviceStateAutoRotateSettingController.java +5 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,11 @@ public class DeviceStateAutoRotateSettingController extends TogglePreferenceCont @Override public boolean isChecked() { return !mAutoRotateSettingsManager.isRotationLocked(mDeviceState); // It is highly unlikely to receive null value here. In the improbable event of null, a // non-null update will follow shortly, and the users will potentially see incorrect // state for a short time. final Boolean isRotationLocked = mAutoRotateSettingsManager.isRotationLocked(mDeviceState); return isRotationLocked != null && !isRotationLocked; } @Override Loading
src/com/android/settings/display/SmartAutoRotateController.java +7 −3 Original line number Diff line number Diff line Loading @@ -85,8 +85,7 @@ public class SmartAutoRotateController extends TogglePreferenceController implem mPrivacyManager = SensorPrivacyManager.getInstance(context); mPowerManager = context.getSystemService(PowerManager.class); mDeviceStateAutoRotateSettingsManager = DeviceStateAutoRotateSettingManagerProvider.getSingletonInstance( context); DeviceStateAutoRotateSettingManagerProvider.getSingletonInstance(context); } @Override Loading @@ -100,7 +99,12 @@ public class SmartAutoRotateController extends TogglePreferenceController implem protected boolean isRotationLocked() { if (DeviceStateAutoRotationHelper.isDeviceStateRotationEnabled(mContext)) { return mDeviceStateAutoRotateSettingsManager.isRotationLockedForAllStates(); // It is highly unlikely to receive null value here. In the improbable event of null, a // non-null update will follow shortly, and the users will potentially see incorrect // state for a short time. final Boolean isRotationLockedForAllStates = mDeviceStateAutoRotateSettingsManager.isRotationLockedForAllStates(); return isRotationLockedForAllStates == null || isRotationLockedForAllStates; } return RotationPolicy.isRotationLocked(mContext); } Loading