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

Commit 23a44a88 authored by Erik Wolsheimer's avatar Erik Wolsheimer Committed by android-build-merger
Browse files

Merge "Respect empty vibration effect configs in PhoneWindowManager and...

Merge "Respect empty vibration effect configs in PhoneWindowManager and VibratorService" into oc-dev am: 4c6a49ed
am: 837e4b34

Change-Id: I402f0b15f529d9456b603d30cac09134316ee4e4
parents 72f378d0 837e4b34
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -222,7 +222,9 @@ public class VibratorService extends IVibratorService.Stub
        long[] clickEffectTimings = getLongIntArray(context.getResources(),
                com.android.internal.R.array.config_virtualKeyVibePattern);
        VibrationEffect clickEffect;
        if (clickEffectTimings.length == 1) {
        if (clickEffectTimings.length == 0) {
            clickEffect = null;
        } else if (clickEffectTimings.length == 1) {
            clickEffect = VibrationEffect.createOneShot(
                    clickEffectTimings[0], VibrationEffect.DEFAULT_AMPLITUDE);
        } else {
@@ -232,7 +234,6 @@ public class VibratorService extends IVibratorService.Stub
                new long[] {0, 30, 100, 30} /*timings*/, -1);

        mFallbackEffects = new VibrationEffect[] { clickEffect, doubleClickEffect };

    }

    public void systemReady() {
@@ -701,7 +702,7 @@ public class VibratorService extends IVibratorService.Stub
                }
            }
            final int id = prebaked.getId();
            if (id < 0 || id >= mFallbackEffects.length) {
            if (id < 0 || id >= mFallbackEffects.length || mFallbackEffects[id] == null) {
                Slog.w(TAG, "Failed to play prebaked effect, no fallback");
                return 0;
            }
+4 −1
Original line number Diff line number Diff line
@@ -7701,7 +7701,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            default:
                return null;
        }
        if (pattern.length == 1) {
        if (pattern.length == 0) {
            // No vibration
            return null;
        } else if (pattern.length == 1) {
            // One-shot vibration
            return VibrationEffect.createOneShot(pattern[0], VibrationEffect.DEFAULT_AMPLITUDE);
        } else {