当前位置:网站首页>Vivo手机的权限管理
Vivo手机的权限管理
2022-06-28 11:38:00 【一杯苦芥】
最近搞的项目里遇到了权限管理的问题,由于手上的测试用机只有华为和vivo,所以这里仅以这两款机型讨论。调试代码时发现了一个问题,跟我在前面的一篇博客里写的一样,就是发现vivo手机上用android原生的api去检查权限(就以相机权限为例吧)发现是有这个权限的,但是我明明在设置(比较新的vivo手机上i管家和设置里的权限管理已经合为一套了)里禁止了该权限;在华为手机上则是正常的,禁止了就返回-1(没有权限),授予了就返回0(有权限)。原来,在比较新的vivo手机上默认把android原生的权限管理系统隐藏了,无论你检查什么权限,都会返回给你0(有权限),真正的权限管理系统是在i管家里的。
你在设置(也就是i管家,他们已经合为一套了)里禁止后,代码里用android原生权限检查返回0(有权限),那么岂不就没有办法根据返回值来处理自己的逻辑了? 通常情况下不必担心这个问题,因为当真正用到这个权限的时候,如果i管家发现你没有这个权限,会自动弹出权限管理的弹框,向你请求该权限,这个过程是不用我们来管理的,完全由i管家自动管理。当然了,程序为了与其他品牌的手机兼容,仍然需要按照常规的逻辑流程来写。
原文:https://blog.csdn.net/aabbwoshishei/article/details/78895510
边栏推荐
- Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
- Redis principle - List
- Web page tips this site is unsafe solution
- 5. Sum of N numbers
- Which programming language will attract excellent talents?
- The default point of this in JS and how to modify it to 2021.11.09
- Day37 JS note motion function 2021.10.11
- 【C语言】二叉树的实现及三种遍历
- [sciter]: use of sciter FS module scanning file API and its details
- 【C语言】如何很好的实现复数类型
猜你喜欢

多维度监控:智能监控的数据基础

开源项目维权成功案例: spug 开源运维平台成功维权

Cannot redeclare block range variables

js中this的默认指向及如何修改指向 2021.11.09

SEO优化的许多好处是与流量有直接关系
Three ways to implement LRU cache (recommended Collection)

Deployment and optimization of vsftpd service

Many benefits of SEO optimization are directly related to traffic

Leetcode 48. 旋转图像(可以,已解决)

Join hands with cigent: group alliance introduces advanced network security protection features for SSD master firmware
随机推荐
fatal: unsafe repository (‘/home/anji/gopath/src/gateway‘ is owned by someone else)
Day23 JS notes 2021.09.14
多维度监控:智能监控的数据基础
Cohere, a large model company, completed the round B financing of US $125million
【C语言】二叉树的实现及三种遍历
零基础C语言(一)
.NET混合开发解决方案24 WebView2对比CefSharp的超强优势
Day29 JS notes 2021.09.23
1. print hourglass
For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?
Setinterval, setTimeout and requestanimationframe
Prefix and (2D)
Chendanqi, Fang Fei, guquanquan and Li Bo won the prize, and the list of Sloan research award in 2022 was released
Redis hash hash type string (5)
Unity屏幕截图功能
5. Sum of N numbers
Redis principle - List
Which programming language will attract excellent talents?
js中的class类模式及语法 2021.11.10
Swin, three degrees! Eth open source VRT: a transformer that refreshes multi domain indicators of video restoration