Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Commit

Permalink
fix: Illegal null AudioFocusRequest exception (#261)
Browse files Browse the repository at this point in the history
* Fix #260 on native call
  • Loading branch information
matinzd authored and tanguyantoine committed May 24, 2019
1 parent da75be9 commit 351a1ab
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public void requestAudioFocus() {
}

public void abandonAudioFocus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && mAudioManager != null) {
mAudioManager.abandonAudioFocusRequest(mFocusRequest);
} else {
} else if ( mAudioManager != null ) {
mAudioManager.abandonAudioFocus(this);
}
}
Expand Down

0 comments on commit 351a1ab

Please sign in to comment.