The Permission dialog box is an action that is placed on top of the activity stack. Therefore, when you call the requestPermission() method of the Activity method, the implementation requests the PackageManager to create an intent that will trigger this activity dialog. This intent has an ACTION_REQUEST_PERMISSIONS action .
You might need to listen to the changes in the activity stack and check if the activity has an ACTION_REQUEST_PERMISSIONS activity. I'm not sure that getting started tasks will give you this activity, because I did not try it myself, just to let you go.
source share