Propagate AudioAttributes flags to VibrationAttributes
Set supported flags from AudioAttributes into VibrationAttributes on the
builder constructor.
Fix: b/161761418
Test: manual
Change-Id: I4a8e1db278843b2f9f19aba43b0b8f264cb696bd
(cherry picked from commit c2777148df)
This commit is contained in:
committed by
android-build-team Robot
parent
35c84e1293
commit
dc21a3c479
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user