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

Commit 1c47a0be authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Customize camera gesture vibrator pattern"

parents a42d5770 f9fc128d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -48,6 +48,12 @@
    <!-- Whether or not we show the number in the bar. -->
    <bool name="config_statusBarShowNumber">false</bool>

    <!-- Vibrator pattern for camera gesture launch. -->
    <integer-array translatable="false" name="config_cameraLaunchGestureVibePattern">
        <item>0</item>
        <item>400</item>
    </integer-array>

    <!-- How many icons may be shown at once in the system bar. Includes any
         slots that may be reused for things like IME control. -->
    <integer name="config_maxNotificationIcons">5</integer>
+8 −1
Original line number Diff line number Diff line
@@ -561,6 +561,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    private int mLastCameraLaunchSource;
    private PowerManager.WakeLock mGestureWakeLock;
    private Vibrator mVibrator;
    private long[] mCameraLaunchGestureVibePattern;

    // Fingerprint (as computed by getLoggingFingerprint() of the last logged state.
    private int mLastLoggedStateFingerprint;
@@ -996,6 +997,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        mGestureWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK,
                "GestureWakeLock");
        mVibrator = mContext.getSystemService(Vibrator.class);
        int[] pattern = mContext.getResources().getIntArray(
                R.array.config_cameraLaunchGestureVibePattern);
        mCameraLaunchGestureVibePattern = new long[pattern.length];
        for (int i = 0; i < pattern.length; i++) {
            mCameraLaunchGestureVibePattern[i] = pattern[i];
        }

        // receive broadcasts
        IntentFilter filter = new IntentFilter();
@@ -4880,7 +4887,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

    private void vibrateForCameraGesture() {
        // Make sure to pass -1 for repeat so VibratorService doesn't stop us when going to sleep.
        mVibrator.vibrate(new long[]{0, 400}, -1 /* repeat */);
        mVibrator.vibrate(mCameraLaunchGestureVibePattern, -1 /* repeat */);
    }

    public void onScreenTurnedOn() {