Friday 19 May 2023

DRAW OVER OTHER app permission - condition to find 'this feature not available' devices

Hi I am working on a taxi driver application , in which I need to keep the driver online and app in background , I asked MANAGE_OVERLAY_PERMISSION as runtime permission . but in some devices (in Go edition , android 11) it shows 'feature not available' alert . I have read the developer doc and could find the reason . now my requirement is to ask MANAGE_OVERLAY_PERMISSION runtime permission alert to the devices which support this feature . Which condition should I use to differentiate it?

Here is my code .

*if (//TODO Condition to check whether this feature is available on device?) {*  
                         if (!Settings.canDrawOverlays(currentAct)) {
                             checkForOverlay(activity); //asking permission for popup
                         }

                }

Also I read draw over permission removed for Version Q and higher it will be granted to apps automatically here , but it is not granting automatically.

I tried activityManager.isLowRamDevice() , but I dont think it is right solution.

how can I resolve these issues.



from DRAW OVER OTHER app permission - condition to find 'this feature not available' devices

No comments:

Post a Comment