问题
My android app need display over other app permission which is screen overlay permission.
- Settings.ACTION_MANAGE_OVERLAY_PERMISSION
- SYSTEM_ALERT_WINDOW
In normal android OS device i can give permission easily using this code.
if (!Settings.canDrawOverlays(this) && !Constant.IsOverlayPermissionGiven) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivityForResult(intent, REQUEST_CODE);
handler.postDelayed(checkSettingOn, 200);
return false;
} else {
return true;
}
But in Android Go edition device permission screen displaying the message of "This feature is not available" with the caution of "This feature has been turned off because it slows down your phone"
How to get the information about the feature is available or not programmatically ? How to bypass the permission screen which device don't have screen overlay feature?
来源:https://stackoverflow.com/questions/63938787/how-to-check-detect-or-identify-the-settings-component-screen-overlay-or-any-fe