简体   繁体   English

Android R new Api isAutoRevokeWhitelisted() 即使手动打开/关闭权限重置也总是给出 false

[英]Android R new Api isAutoRevokeWhitelisted() always give false even if manually permisssion reset is turned on /off

So on Android R, user can now choose to allow the OSs to revoke given permission if the app isn't using them.因此,在 Android R 上,用户现在可以选择允许操作系统在应用程序不使用它们时撤销给定的权限。 This new settings will be available in the permission section of the app setting(check screenshot for reference), by default its turned off as per current beta behaviour此新设置将在应用设置的权限部分提供(请查看屏幕截图以供参考),默认情况下,根据当前的 beta 行为将其关闭

https://developer.android.com/preview/privacy/permissions#auto-reset https://developer.android.com/preview/privacy/permissions#auto-reset

在此处输入图像描述

There is an api added to track if currently your app is in the given whitelist or not添加了一个 api 来跟踪您的应用当前是否在给定的白名单中

https://developer.android.com/reference/android/content/pm/PackageManager#isAutoRevokeWhitelisted() . https://developer.android.com/reference/android/content/pm/PackageManager#isAutoRevokeWhitelisted() I tried testing this but even when i turn the on or off the settings the api always returns false.我尝试对此进行测试,但即使我打开或关闭设置,api 总是返回 false。 Wondering if anyone else has faced this issue yet.想知道是否还有其他人遇到过这个问题。

I checked the logs and i can see a few logs which makes me feels that even after turning the option on its doesnt actually get added to the whitelist我检查了日志,我可以看到一些日志,这让我觉得即使打开该选项后它实际上并没有被添加到白名单中

2020-08-14 03:04:26.002 7005-7047/? I/AppPermissionGroupsViewModel: sessionId 5928824040472035289 setting auto revoke enabled to true forcom.abc.xyz UserHandle{0}
2020-08-14 03:04:26.007 864-3020/? D/audio_hw_primary: enable_snd_device: snd_device(2: speaker)
2020-08-14 03:04:26.007 7005-7283/? W/AutoRevokePermissions: Error carrier privileged status for com.abc.xyz: -1
2020-08-14 03:04:26.007 864-3020/? D/audio_route: Apply path: speaker
2020-08-14 03:04:26.007 7005-7283/? I/AutoRevokePermissions: Parsed teamfood setting value: null
2020-08-14 03:04:26.007 7005-7283/? I/chatty: uid=10187(com.google.android.permissioncontroller) pool-2-thread-7 identical 1 line
2020-08-14 03:04:26.007 7005-7283/? I/AutoRevokePermissions: Parsed teamfood setting value: null

You probably have targetSDK set to 29, I also experienced incorrect API work on it.您可能将 targetSDK 设置为 29,我也遇到过不正确的 API 工作。 But if I set targetSDK to 30 it gets back to normal.但如果我将 targetSDK 设置为 30,它就会恢复正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:即使使用 WifiLock 也会关闭 Wifi - Android: Wifi is turned off even with WifiLock 可以在Android API的MediaRecorder中关闭声音吗? - Can sound be turned off in MediaRecorder of the Android API? 即使在属性中将其关闭,R8仍处于堆栈跟踪中 - R8 is still in stacktrace even though it is turned off in properties 即使关闭autoRotation,也可以获取Android设备方向 - Get android device orientation even when autoRotation is turned off 即使在Android中关闭了屏幕,如何保持应用状态? - How to keep app status even if screen is turned off in Android? 即使关闭屏幕也可以开始活动 - Start activity even when screen is turned off 即使LocationServices已关闭,也要获取位置 - Getting the Location even if LocationServices is turned off 即使在用户强行关闭gps的情况下,如何使用fusionloaction api在后台获取位置信息? - How to get location information in background using fusedloaction api even when gps is turned off forcefully by the user? 即使GPS关闭,也会调用onLocationChanged - onLocationChanged called even with GPS turned off 即使使用融合位置 API 关闭 GPS,如何获取位置更新? - How to get Location updates even when gps is turned off using fused location API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM