[英]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.