getActivity / XXPermissions

Android 权限请求框架,已适配 Android 14
Apache License 2.0
5.44k stars 735 forks source link

[Bug]:蓝牙权限在请求时,如果安卓12以下设备,有个细节Bug #278

Closed ChawLoo closed 3 weeks ago

ChawLoo commented 1 month ago

Framework Version [Required]

18.63

Issue Description [Required]

按照标准的请求方式,12以下的设备是会转变成请求ACCESS_FINE_LOCATION,如果拒绝,在回调中显示的拒绝的权限是BLUETOOTH_CONNECT。是不是可以优化一下?

Steps to Reproduce [Required]

安卓11的小米手机,请求蓝牙权限,定位权限已经拒绝并不在提醒,此时一直显示拒绝的是BLUETOOTH_CONNECT

Is the Issue Reproducible? [Required]

Yes

Project targetSdkVersion [Required]

34

Device Information [Required]

小米9

Android Version [Required]

11

Issue Source Channel [Required]

Encountered by myself

Is it specific to certain device models? [Required]

12以下

Does the latest version of the framework have this issue? [Required]

Yes

Is the issue mentioned in the framework documentation? [Required]

No

Did you consult the framework documentation but couldn't find a solution? [Required]

Yes

Has a similar issue been reported in the issue list? [Required]

No

Have you searched the issue list but couldn't find a solution? [Required]

Yes

Can the issue be reproduced with a demo project? [Required]

Yes

Provide Error Stack Trace

No response

Provide Screenshots or Videos

No response

Provide a Solution

No response

getActivity commented 1 month ago

小伙子,框架的思想是让外层申请的人淡忘甚至不用管新旧权限的兼容问题,这个问题不是什么 Bug,而是框架的设计就是这样的。

ChawLoo commented 1 month ago

那只能让申请人自己去了解底层逻辑去发现咯?

getActivity commented 1 month ago

@ChawLoo 不需要你了解底层逻辑,你在申请蓝牙权限的时候,如果没有在清单文件中注册定位权限,框架会抛出来异常告诉你。

getActivity commented 1 month ago
image
getActivity commented 1 month ago

那只能让申请人自己去了解底层逻辑去发现咯?

不需要你去了解,框架的代码注释都有写,只是你不爱看注释,所以没有留意到而已。