当前位置:网站首页>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
边栏推荐
- 4. maximum continuity factor
- JS foundation 8
- Research on personalized product search
- Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush
- QML control type: tabbar
- Deployment and optimization of vsftpd service
- Come on, yuanuniverse. Sure enough, the heat won't pass for a while
- day37 js笔记 运动函数 2021.10.11
- Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
- 2022 open source software security status report: over 41% of enterprises do not have enough confidence in open source security
猜你喜欢

day29 js笔记 2021.09.23

Day39 prototype chain and page fireworks effect 2021.10.13

Source code analysis of ArrayList

Remote login sshd service

【C语言】结构体嵌套二级指针的使用

【C语言】二叉树的实现及三种遍历

ArrayList源码解析

For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?

Why do many people want to change careers as programmers, while some programmers want to change careers as others?

day34 js笔记 正则表达式 2021.09.29
随机推荐
【C语言】NextDay问题
Class pattern and syntax in JS 2021.11.10
Day39 prototype chain and page fireworks effect 2021.10.13
SoapUI rookie tutorial
How to deploy the software testing environment?
Day24 JS notes 2021.09.15
day34 js笔记 正则表达式 2021.09.29
The default point of this in JS and how to modify it to 2021.11.09
Come on, yuanuniverse. Sure enough, the heat won't pass for a while
.NET混合开发解决方案24 WebView2对比CefSharp的超强优势
携手Cigent:群联为SSD主控固件引入高级网络安全防护特性
1. print hourglass
AcWing 609. Salary (implemented in C language)
ProCAST finite element casting process simulation software
What is the main chain system?
New listing of operation light 3.0 - a sincere work of self subversion across the times!
Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
Leetcode 705. 设计哈希集合
day33 js笔记 事件(下)2021.09.28
Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush