Merge "Propagate AudioAttributes flags to VibrationAttributes" into rvc-dev am: 863c82fa76 am: 61e32caa0b am: 38570d081d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12218307 Change-Id: I023d9c9ae8ca1b66866b5e1b40cb56e9fb1dc0e3
This commit is contained in:
@@ -304,6 +304,7 @@ public final class VibrationAttributes implements Parcelable {
|
|||||||
@Nullable VibrationEffect effect) {
|
@Nullable VibrationEffect effect) {
|
||||||
mAudioAttributes = audio;
|
mAudioAttributes = audio;
|
||||||
setUsage(audio);
|
setUsage(audio);
|
||||||
|
setFlags(audio);
|
||||||
applyHapticFeedbackHeuristics(effect);
|
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
|
* Combines all of the attributes that have been set and returns a new
|
||||||
* {@link VibrationAttributes} object.
|
* {@link VibrationAttributes} object.
|
||||||
|
|||||||
Reference in New Issue
Block a user