mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
committed by
Cody Henthorne
parent
30eff93fa1
commit
59401e18ed
@@ -243,13 +243,17 @@ public abstract class AudioManagerCompat {
|
||||
Log.w(TAG, "Trying again to request audio focus");
|
||||
}
|
||||
|
||||
int result = audioManager.requestAudioFocus(audioFocusRequest);
|
||||
try {
|
||||
int result = audioManager.requestAudioFocus(audioFocusRequest);
|
||||
|
||||
if (result != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
|
||||
Log.w(TAG, "Audio focus not granted. Result code: " + result);
|
||||
if (result != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
|
||||
Log.w(TAG, "Audio focus not granted. Result code: " + result);
|
||||
return false;
|
||||
}
|
||||
} catch (SecurityException ex) {
|
||||
Log.w(TAG, "Encountered security exception when requesting audio focus.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user