Reload video devices in settings after granting CAMERA permission

This commit is contained in:
Sylvain Berfini 2020-04-24 15:20:18 +02:00
parent bb4328f216
commit 667b17a8c7
2 changed files with 3 additions and 1 deletions

View file

@ -78,6 +78,8 @@ class VideoSettingsFragment : Fragment() {
val granted = grantResults[0] == PackageManager.PERMISSION_GRANTED
if (granted) {
Log.i("[Video Settings] CAMERA permission granted")
coreContext.core.reloadVideoDevices()
viewModel.initCameraDevicesList()
} else {
Log.w("[Video Settings] CAMERA permission denied")
}

View file

@ -120,7 +120,7 @@ class VideoSettingsViewModel : GenericSettingsViewModel() {
bandwidthLimit.value = core.downloadBandwidth
}
private fun initCameraDevicesList() {
fun initCameraDevicesList() {
val labels = arrayListOf<String>()
for (camera in core.videoDevicesList) {
if (prefs.hideStaticImageCamera && camera.startsWith("StaticImage")) {