AndroidUtilCode icon indicating copy to clipboard operation
AndroidUtilCode copied to clipboard

荣耀8 8.0 PermissionUtils.isGrantedDrawOverlays() 一直返回ture

Open zxq126 opened this issue 7 years ago • 6 comments

荣耀8 8.0 PermissionUtils.isGrantedDrawOverlays() 一直返回ture

  • 1.23.7
  • 荣耀8
  • API 26

The code of bug

PermissionUtils.isGrantedDrawOverlays();
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
    isOpen= PermissionUtils.isGrantedDrawOverlays();
}

手动打开或关闭悬浮窗开关 isOpen 一直为true;

zxq126 avatar May 06 '19 09:05 zxq126

https://blog.csdn.net/qq_24179679/article/details/84139408 延迟 500ms 试试

Blankj avatar May 06 '19 13:05 Blankj

有点疑问,isGrantedDrawOverlays里面的判断是不是有点问题?Settings是要求23以上的吧

Panjianan avatar May 07 '19 08:05 Panjianan

有大于 23 的注解,自己加上即可

Blankj avatar May 07 '19 08:05 Blankj

1.23.7 小米8 API 28 试了下,在设置里关闭了权限,isGrantedDrawOverlays大于26里面的部分一直是true。 是在Service里判断的,延迟500ms也没用。 另外用Settings.canDrawOverlays(this)去判断是正常的。

Panjianan avatar May 07 '19 08:05 Panjianan

下版本会修复

Blankj avatar May 07 '19 08:05 Blankj

isGrantedDrawOverlays 华为的很多机子会这样, 我也碰到了这个问题

lindexter avatar May 27 '19 09:05 lindexter