Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72a641c8 authored by DvTonder's avatar DvTonder Committed by Gerrit Code Review
Browse files

Merge "Framework: Add support to enable/disable Electron Beam (1/2)" into cm-10.1

parents 51dddfa0 b9fe80f4
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -1750,17 +1750,11 @@ public final class Settings {
         */
        public static final String AUTO_BRIGHTNESS_RESPONSIVENESS = "auto_brightness_responsiveness";

        /**
         * Whether to enable the electron beam animation when turning screen on
         *
         * @hide */
        public static final String ELECTRON_BEAM_ANIMATION_ON = "electron_beam_animation_on";

        /**
         * Whether to enable the electron beam animation when turning screen off
         *
         * @hide */
        public static final String ELECTRON_BEAM_ANIMATION_OFF = "electron_beam_animation_off";
        public static final String SCREEN_OFF_ANIMATION = "screen_off_animation";

        /**
         * Control whether the process CPU usage meter should be shown.
+0 −4
Original line number Diff line number Diff line
@@ -1057,10 +1057,6 @@
    <!-- Flag indicating if the speed up audio on mt call code should be executed -->
    <bool name="config_speed_up_audio_on_mt_calls">false</bool>

    <!-- 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. -->
    <bool name="config_screenOffAnimation">true</bool>

+4 −0
Original line number Diff line number Diff line
@@ -1999,4 +1999,8 @@
  <java-symbol type="dimen" name="pie_trigger_thickness" />
  <java-symbol type="dimen" name="pie_trigger_distance" />
  <java-symbol type="dimen" name="pie_perpendicular_distance" />

  <!-- Electron Beam -->
  <java-symbol type="bool" name="config_screenOffAnimation" />

</resources>
+8 −2
Original line number Diff line number Diff line
@@ -797,7 +797,8 @@ final class DisplayPowerController {
                                mElectronBeamFadesConfig ?
                                        ElectronBeam.MODE_FADE :
                                        ElectronBeam.MODE_COOL_DOWN)
                                && mPowerState.isScreenOn()) {
                                && mPowerState.isScreenOn()
                                && useScreenOffAnimation()) {
                            mElectronBeamOffAnimator.start();
                        } else {
                            mElectronBeamOffAnimator.end();
@@ -1454,4 +1455,9 @@ final class DisplayPowerController {
            updatePowerState();
        }
    };

    private boolean useScreenOffAnimation() {
        return Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.SCREEN_OFF_ANIMATION, 1) == 1;
    }
}