I have a hard time finding the proper manifest query permission declaration when using AlarmClock intent, related with android 11 package visibility.
val intent = Intent(AlarmClock.ACTION_SET_TIMER)
intent.resolveActivity(requireContext().packageManager) // <= returns null
If I add into manifest:
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
then I get the right component, but I know that QUERY_ALL_PACKAGES
is not recommended so:
What is the right declaration for AlarmClock package visibility ?