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

Commit 4bc37846 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Propagate AudioAttributes flags to VibrationAttributes" into rvc-dev...

Merge "Propagate AudioAttributes flags to VibrationAttributes" into rvc-dev am: 863c82fa am: 61e32caa am: 38570d08 am: f06368ec

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12218307

Change-Id: Ibf79adc0effaaa074fdd0634b0773cda5752d3e1
parents 24d2fa62 f06368ec
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -310,6 +310,7 @@ public final class VibrationAttributes implements Parcelable {
                @Nullable VibrationEffect effect) {
            mAudioAttributes = audio;
            setUsage(audio);
            setFlags(audio);
            applyHapticFeedbackHeuristics(effect);
        }

@@ -366,6 +367,12 @@ public final class VibrationAttributes implements Parcelable {
            }
        }

        private void setFlags(@NonNull AudioAttributes audio) {
            if ((audio.getAllFlags() & AudioAttributes.FLAG_BYPASS_INTERRUPTION_POLICY) != 0) {
                mFlags |= FLAG_BYPASS_INTERRUPTION_POLICY;
            }
        }

        /**
         * Combines all of the attributes that have been set and returns a new
         * {@link VibrationAttributes} object.