diff options
| author | 2020-07-25 00:10:39 +0000 | |
|---|---|---|
| committer | 2020-07-25 00:10:39 +0000 | |
| commit | 61e32caa0b43c0414f644e7ca953b102cb5de968 (patch) | |
| tree | e6f622f4114b89e6956e4b4780f4ccd6a178824e | |
| parent | 4f7fa277ab4ab84c35968ab34a4464602a674011 (diff) | |
| parent | 863c82fa76d3cc329be101fd7ae57a4395bef344 (diff) | |
Merge "Propagate AudioAttributes flags to VibrationAttributes" into rvc-dev am: 863c82fa76
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12218307
Change-Id: I3b5157ab8e234e349465ed94f15f6d9ef53cac5f
| -rw-r--r-- | core/java/android/os/VibrationAttributes.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/os/VibrationAttributes.java b/core/java/android/os/VibrationAttributes.java index 27782fa74dab..171aef400b07 100644 --- a/core/java/android/os/VibrationAttributes.java +++ b/core/java/android/os/VibrationAttributes.java @@ -304,6 +304,7 @@ public final class VibrationAttributes implements Parcelable { @Nullable VibrationEffect effect) { mAudioAttributes = audio; setUsage(audio); + setFlags(audio); applyHapticFeedbackHeuristics(effect); } @@ -360,6 +361,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. |