Screen overlay detected blocks Android permissions

后端 未结 7 1987
花落未央
花落未央 2020-11-30 02:27

I\'ve noticed a strange issue with my Android app on my new phone. SDK 23 permission popups like external storage are blocked by the attached alert below. I initially though

相关标签:
7条回答
  • 2020-11-30 02:40

    Usually, this is caused by the use a floating app.

    For Samsung Android Phone users:

    Open the Settings
    Then Applications > Application manager
    Press on More > Apps that can appear on top
    

    If you find an app with a bubble, display screen overlay. If an app adjusts your phone’s brightness, disable screen overlay option on those apps as well. Point is, you have to figure out the culprit app and disable screen overlay.

    Source: Fix Screen Overlay Detected Error On Android

    0 讨论(0)
  • 2020-11-30 02:42

    I've fixed this issue by installing Alert Window Checker: https://play.google.com/store/apps/details?id=jp.sfapps.alertwindowchecker. It indicates you which applications are currently using the screen overlay feature.

    In my case, I had to disable the swipe detector in application ES FileExplorer to fix this issue

    0 讨论(0)
  • 2020-11-30 02:44

    It's not an issue, You just have an overlay app installed, The most common are

    • Facebook Messenger
    • Whatsapp with Pop-up enabled
    • Seebye Chat heads
    • Viber
    • Any app that shows a menu or something on the screen is an Overlay App.

    just close it, Then try.

    0 讨论(0)
  • 2020-11-30 02:47

    I googled for so many solution but nothing worked. Then I tried with all the options in settings :)

    Finally I can give you definite way to disable overlay -

    Go to Setting > Application > Default application > Device Assistance > "Turn of Read Text on screen" option

    0 讨论(0)
  • 2020-11-30 03:03

    This popup became an issue with the inclusion of the permissions manager in Android Marshmallow. If you have any apps installed on you phone that have permission to overlay on the screen there are a number of permission settings, File access included, that you can't change without disabling those screen overlay permissions first. For me, my text app and the facebook messenger app are the culprits. Every time I want to give any other app the requested permissions I have to click the Open Settings option on that popup and revoke the screen overlay access for the two aforementioned apps, then reopen the app in question to get the permission prompt again. Then I have to re-enable the overlay permissions again if I want my message popups or my chat heads. It's really annoying. I think your app is fine, android's permissions management is just a confusing mess.

    0 讨论(0)
  • 2020-11-30 03:07

    This popup is caused by the manifest.PERMISSION.SYSTEM_ALERT_WINDOW permission declared by the manifest. The are 3 categories of permissions, that developer must be aware of.:

    1. Normal permission - do nothing with them, just declare in the Manifest
    2. Vulnerable permissions - declare in Manifest and ask for permission at first time. They can be changed through system settings
    3. Above dangerous permissions: SYSTEM_ALERT_WINDOW and WRITE_SETTINGS belong to this category. They must be granted, but are not visible in system settings. To request for it you don't use a standard way (int checkSelfPermission (String permission)) but you have to check Settings.canDrawOverlays() or Settings.System.canWrite() appropriately

    If you don't have SYSTEM_ALERT_WINDOW permission:

    1. check if you have a Toast visible when interacting with the permissions popup. Though the Overlay Detected popup doesn't mention it, a Toast also counts as an overlay
    2. check if any of your dependencies require it.

    If you're not sure if you're using this permission, there are a couple of test cases that you can do:

    1. Request this permission by yourself:

      public class MainActivity extends AppCompatActivity {
      
          public final static int REQUEST_CODE = 10101;
      
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
              if (checkDrawOverlayPermission()) {
                  startService(new Intent(this, PowerButtonService.class));
              }
          }
      
          public boolean checkDrawOverlayPermission() {
              if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
                  return true;
              }
              if (!Settings.canDrawOverlays(this)) {
                  Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                      Uri.parse("package:" + getPackageName()));
                  startActivityForResult(intent, REQUEST_CODE);
                  return false;
              } else {
                  return true;
              }
          }
      
          @Override
          @TargetApi(Build.VERSION_CODES.M)
          protected void onActivityResult(int requestCode, int resultCode, Intent data) {
              if (requestCode == REQUEST_CODE) {
                  if (Settings.canDrawOverlays(this)) {
                      startService(new Intent(this, PowerButtonService.class));
                  }
              }
          }
      }
      
    2. Check if this or this is not your case

    3. Check out this post to be aware, that when installing app through Play Store this permission is automatically granted (I have not checked is, therefore cannot confirm)

    The permission model can be understood, just sometimes requires more digging.

    0 讨论(0)
提交回复
热议问题