Notification access for specific application not change the switch state to ON while permission is granted. I face this issue in android Galaxy A10.
val componentName = ComponentName(requireActivity().packageName, NLService::class.java.name)
val notificationAccessSettings = Intent(Intent(Settings.ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS))
notificationAccessSettings.putExtra(Settings.EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME, componentName.flattenToString())
resultLauncher.launch(notificationAccessSettings)
read this two link ( first and second ) which I have implemented but the problem is to not change the switch while permission is granted.