Loading core/java/android/provider/Settings.java +11 −3 Original line number Diff line number Diff line Loading @@ -1913,11 +1913,19 @@ public final class Settings { public static final String BUTTON_BACKLIGHT_TIMEOUT = "button_backlight_timeout"; /** * Whether to enable the electron beam animation when turning screen off * * @hide */ * Control whether the screen off animation should be shown * @hide */ public static final String SCREEN_OFF_ANIMATION = "screen_off_animation"; /** * Control which animation to use when turning the screen off * 0 = electron beam * 1 = fade * @hide */ public static final String SCREEN_ANIMATION_STYLE = "screen_animation_style"; /** * Control whether the process CPU usage meter should be shown. * Loading core/res/res/values/config.xml +1 −5 Original line number Diff line number Diff line Loading @@ -1366,11 +1366,7 @@ <item>353</item> </string-array> <!-- Values greater or equal to 0 will enable electronbeam screen-on animation with the specified delay (in milliseconds), -1 will disable the animation --> <integer name="config_screenOnAnimation">-1</integer> <!-- True will enable the electron beam screen-off animation. --> <!-- True will enable the screen-off animation. --> <bool name="config_screenOffAnimation">true</bool> <!-- Timeout in MS for how long you have to long-press the back key to Loading core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1855,7 +1855,7 @@ <!-- Gesture Sensor --> <java-symbol type="bool" name="config_enableGestureService" /> <!-- Electron Beam --> <!-- Screen off animation --> <java-symbol type="bool" name="config_screenOffAnimation" /> <!-- Privacy Guard --> Loading services/java/com/android/server/power/DisplayPowerController.java +13 −12 Original line number Diff line number Diff line Loading @@ -237,7 +237,16 @@ final class DisplayPowerController { // True if we should fade the screen while turning it off, false if we should play // a stylish electron beam animation instead. private boolean mElectronBeamFadesConfig; private boolean mElectronBeamFadesConfig() { return Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_ANIMATION_STYLE, 0) == 1; } // True if we should allow showing the screen-off animation private boolean useScreenOffAnimation() { return Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_OFF_ANIMATION, 1) == 1; } // The pending power request. // Initially null until the first call to requestPowerState. Loading Loading @@ -430,9 +439,6 @@ final class DisplayPowerController { updateAutomaticBrightnessSettings(); } mElectronBeamFadesConfig = resources.getBoolean( com.android.internal.R.bool.config_animateScreenLights); if (!DEBUG_PRETEND_PROXIMITY_SENSOR_ABSENT) { mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); if (mProximitySensor != null) { Loading Loading @@ -789,7 +795,7 @@ final class DisplayPowerController { if (mPowerState.getElectronBeamLevel() == 1.0f) { mPowerState.dismissElectronBeam(); } else if (mPowerState.prepareElectronBeam( mElectronBeamFadesConfig ? mElectronBeamFadesConfig() ? ElectronBeam.MODE_FADE : ElectronBeam.MODE_WARM_UP)) { mElectronBeamOnAnimator.start(); Loading @@ -812,7 +818,7 @@ final class DisplayPowerController { setScreenOn(false); unblockScreenOn(); } else if (mPowerState.prepareElectronBeam( mElectronBeamFadesConfig ? mElectronBeamFadesConfig() ? ElectronBeam.MODE_FADE : ElectronBeam.MODE_COOL_DOWN) && mPowerState.isScreenOn() Loading Loading @@ -1514,9 +1520,4 @@ final class DisplayPowerController { updatePowerState(); } }; private boolean useScreenOffAnimation() { return Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_OFF_ANIMATION, 1) == 1; } } Loading
core/java/android/provider/Settings.java +11 −3 Original line number Diff line number Diff line Loading @@ -1913,11 +1913,19 @@ public final class Settings { public static final String BUTTON_BACKLIGHT_TIMEOUT = "button_backlight_timeout"; /** * Whether to enable the electron beam animation when turning screen off * * @hide */ * Control whether the screen off animation should be shown * @hide */ public static final String SCREEN_OFF_ANIMATION = "screen_off_animation"; /** * Control which animation to use when turning the screen off * 0 = electron beam * 1 = fade * @hide */ public static final String SCREEN_ANIMATION_STYLE = "screen_animation_style"; /** * Control whether the process CPU usage meter should be shown. * Loading
core/res/res/values/config.xml +1 −5 Original line number Diff line number Diff line Loading @@ -1366,11 +1366,7 @@ <item>353</item> </string-array> <!-- Values greater or equal to 0 will enable electronbeam screen-on animation with the specified delay (in milliseconds), -1 will disable the animation --> <integer name="config_screenOnAnimation">-1</integer> <!-- True will enable the electron beam screen-off animation. --> <!-- True will enable the screen-off animation. --> <bool name="config_screenOffAnimation">true</bool> <!-- Timeout in MS for how long you have to long-press the back key to Loading
core/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1855,7 +1855,7 @@ <!-- Gesture Sensor --> <java-symbol type="bool" name="config_enableGestureService" /> <!-- Electron Beam --> <!-- Screen off animation --> <java-symbol type="bool" name="config_screenOffAnimation" /> <!-- Privacy Guard --> Loading
services/java/com/android/server/power/DisplayPowerController.java +13 −12 Original line number Diff line number Diff line Loading @@ -237,7 +237,16 @@ final class DisplayPowerController { // True if we should fade the screen while turning it off, false if we should play // a stylish electron beam animation instead. private boolean mElectronBeamFadesConfig; private boolean mElectronBeamFadesConfig() { return Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_ANIMATION_STYLE, 0) == 1; } // True if we should allow showing the screen-off animation private boolean useScreenOffAnimation() { return Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_OFF_ANIMATION, 1) == 1; } // The pending power request. // Initially null until the first call to requestPowerState. Loading Loading @@ -430,9 +439,6 @@ final class DisplayPowerController { updateAutomaticBrightnessSettings(); } mElectronBeamFadesConfig = resources.getBoolean( com.android.internal.R.bool.config_animateScreenLights); if (!DEBUG_PRETEND_PROXIMITY_SENSOR_ABSENT) { mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); if (mProximitySensor != null) { Loading Loading @@ -789,7 +795,7 @@ final class DisplayPowerController { if (mPowerState.getElectronBeamLevel() == 1.0f) { mPowerState.dismissElectronBeam(); } else if (mPowerState.prepareElectronBeam( mElectronBeamFadesConfig ? mElectronBeamFadesConfig() ? ElectronBeam.MODE_FADE : ElectronBeam.MODE_WARM_UP)) { mElectronBeamOnAnimator.start(); Loading @@ -812,7 +818,7 @@ final class DisplayPowerController { setScreenOn(false); unblockScreenOn(); } else if (mPowerState.prepareElectronBeam( mElectronBeamFadesConfig ? mElectronBeamFadesConfig() ? ElectronBeam.MODE_FADE : ElectronBeam.MODE_COOL_DOWN) && mPowerState.isScreenOn() Loading Loading @@ -1514,9 +1520,4 @@ final class DisplayPowerController { updatePowerState(); } }; private boolean useScreenOffAnimation() { return Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_OFF_ANIMATION, 1) == 1; } }