Skip to content

Commit

Permalink
Add permissions for modify audio settings for webview activity (#1850)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshokouhi authored Oct 29, 2021
1 parent 8631b3d commit e881a8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,14 @@ class WebViewActivity : BaseActivity(), io.homeassistant.companion.android.webvi
AUDIO_REQUEST_CODE
)
}
} else if (it == PermissionRequest.RESOURCE_AUDIO_CAPTURE) {
if (ActivityCompat.checkSelfPermission(
context,
android.Manifest.permission.MODIFY_AUDIO_SETTINGS
) == PackageManager.PERMISSION_GRANTED
) {
request.grant(arrayOf(it))
}
}
}
} else {
Expand Down

0 comments on commit e881a8a

Please sign in to comment.