From Android 6 we have to handle overlay screen in application, I read somewhere that if application is downloaded from play store then by default overlay screen option is enable. I just want to make confirm is it true? Or for this we have to do extra coding. Currently I am using following code to call overlay screen enable for Android 6+ devices:
private void callOverlayScreen() {
if (!Settings.canDrawOverlays(this)) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + BuildConfig.APPLICATION_ID));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
}
}
Currently my if condition is always true. If suppose I release application on play store then it will not go in if condition until user manually disable overlay screen?
Can we check this behavior without downloading application from playstore?