Loading src/com/android/settings/spa/app/specialaccess/VoiceActivationApps.kt +4 −8 Original line number Diff line number Diff line Loading @@ -56,12 +56,9 @@ class VoiceActivationAppsListModel(context: Context) : AppOpPermissionListModel( override val appOp = AppOpsManager.OP_RECEIVE_SANDBOX_TRIGGER_AUDIO override val permission = Manifest.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO override val setModeByUid = true private var receiveDetectionTrainingDataOpController:AppOpsController? = null override fun setAllowed(record: AppOpPermissionRecord, newAllowed: Boolean) { super.setAllowed(record, newAllowed) if (!newAllowed && receiveDetectionTrainingDataOpController != null) { receiveDetectionTrainingDataOpController!!.setAllowed(false) } logPermissionChange(newAllowed) } Loading @@ -82,21 +79,20 @@ class VoiceActivationAppsListModel(context: Context) : AppOpPermissionListModel( isReceiveSandBoxTriggerAudioOpAllowed: () -> Boolean? ): ReceiveDetectionTrainingDataOpSwitchModel { val context = LocalContext.current receiveDetectionTrainingDataOpController = remember { val ReceiveDetectionTrainingDataOpController = remember { AppOpsController( context = context, app = record.app, op = AppOpsManager.OP_RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA, ) } val isReceiveDetectionTrainingDataOpAllowed = isReceiveDetectionTrainingDataOpAllowed(record, receiveDetectionTrainingDataOpController!!) val isReceiveDetectionTrainingDataOpAllowed = isReceiveDetectionTrainingDataOpAllowed(record, ReceiveDetectionTrainingDataOpController) return remember(record) { ReceiveDetectionTrainingDataOpSwitchModel( context, record, isReceiveSandBoxTriggerAudioOpAllowed, receiveDetectionTrainingDataOpController!!, ReceiveDetectionTrainingDataOpController, isReceiveDetectionTrainingDataOpAllowed, ) }.also { model -> LaunchedEffect(model, Dispatchers.Default) { model.initState() } } Loading Loading
src/com/android/settings/spa/app/specialaccess/VoiceActivationApps.kt +4 −8 Original line number Diff line number Diff line Loading @@ -56,12 +56,9 @@ class VoiceActivationAppsListModel(context: Context) : AppOpPermissionListModel( override val appOp = AppOpsManager.OP_RECEIVE_SANDBOX_TRIGGER_AUDIO override val permission = Manifest.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO override val setModeByUid = true private var receiveDetectionTrainingDataOpController:AppOpsController? = null override fun setAllowed(record: AppOpPermissionRecord, newAllowed: Boolean) { super.setAllowed(record, newAllowed) if (!newAllowed && receiveDetectionTrainingDataOpController != null) { receiveDetectionTrainingDataOpController!!.setAllowed(false) } logPermissionChange(newAllowed) } Loading @@ -82,21 +79,20 @@ class VoiceActivationAppsListModel(context: Context) : AppOpPermissionListModel( isReceiveSandBoxTriggerAudioOpAllowed: () -> Boolean? ): ReceiveDetectionTrainingDataOpSwitchModel { val context = LocalContext.current receiveDetectionTrainingDataOpController = remember { val ReceiveDetectionTrainingDataOpController = remember { AppOpsController( context = context, app = record.app, op = AppOpsManager.OP_RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA, ) } val isReceiveDetectionTrainingDataOpAllowed = isReceiveDetectionTrainingDataOpAllowed(record, receiveDetectionTrainingDataOpController!!) val isReceiveDetectionTrainingDataOpAllowed = isReceiveDetectionTrainingDataOpAllowed(record, ReceiveDetectionTrainingDataOpController) return remember(record) { ReceiveDetectionTrainingDataOpSwitchModel( context, record, isReceiveSandBoxTriggerAudioOpAllowed, receiveDetectionTrainingDataOpController!!, ReceiveDetectionTrainingDataOpController, isReceiveDetectionTrainingDataOpAllowed, ) }.also { model -> LaunchedEffect(model, Dispatchers.Default) { model.initState() } } Loading