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

Commit 837e4b34 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

Change-Id: Ib92f2dbad240bae9f46a23aa61eb2b7d09a96896
parents 44cb1486 4c6a49ed
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
@@ -7691,7 +7691,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 {