summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-05-18 23:06:43 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-18 23:06:43 +0000
commitc845303e20c3a81c8d7f07faf876f65cea2899de (patch)
tree791d2dfecf40ccdda3c173e9a273324e62065b9b
parent48b46c858ba4ca30fde1648afee1baaf8d0b2c8e (diff)
parenta13acb632e6fb049b70e5a378a86dc8ee52d02c0 (diff)
downloadCellBroadcastReceiver-c845303e20c3a81c8d7f07faf876f65cea2899de.tar.gz
Snap for 5582428 from a13acb632e6fb049b70e5a378a86dc8ee52d02c0 to qt-release
Change-Id: I15cd2e03c0a642391faa42eff22c3e0b42b4a4f5
-rw-r--r--src/com/android/cellbroadcastreceiver/CellBroadcastAlertAudio.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertAudio.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertAudio.java
index ee8db74e2..8d913dfe1 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertAudio.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertAudio.java
@@ -344,7 +344,8 @@ public class CellBroadcastAlertAudio extends Service implements TextToSpeech.OnI
// stop() checks to see if we are already playing.
stop();
- log("playAlertTone: alertType=" + alertType);
+ log("playAlertTone: alertType=" + alertType + ", mEnableVibrate=" + mEnableVibrate
+ + ", mEnableAudio=" + mEnableAudio + ", mUseFullVolume=" + mUseFullVolume);
Resources res =
CellBroadcastSettings.getResourcesForDefaultSmsSubscriptionId(
getApplicationContext());
@@ -365,10 +366,13 @@ public class CellBroadcastAlertAudio extends Service implements TextToSpeech.OnI
vibrateDuration += patternArray[i];
}
- // Use the alarm channel so it can vibrate in DnD mode, unless alarms are
- // specifically disabled in DnD.
AudioAttributes.Builder attrBuilder = new AudioAttributes.Builder();
attrBuilder.setUsage(AudioAttributes.USAGE_ALARM);
+ if (mUseFullVolume) {
+ // Set the flags to bypass DnD mode if the user enables use full volume option.
+ attrBuilder.setFlags(AudioAttributes.FLAG_BYPASS_INTERRUPTION_POLICY
+ | AudioAttributes.FLAG_BYPASS_MUTE);
+ }
AudioAttributes attr = attrBuilder.build();
// If we only play the tone once, then we also play the vibration pattern once.
int repeatIndex = (customAlertDuration < 0)