0

So on Android R , user can now choose to allow the OSs to revoke given permission if the app isn't using them. 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

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

enter image description here

There is an api added to track if currently your app is in the given whitelist or not

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. 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
amIT
  • 664
  • 13
  • 27
  • filed a bug with google too https://issuetracker.google.com/issues/164188698 – amIT Aug 13 '20 at 22:03
  • I am not seeing this problem, testing on a Pixel 2 running Beta 3. `isAutoRevokeWhitelisted()` is returning the expected value if `android:autoRevokePermissions` is skipped or set to `discouraged`. If it is set to `disallowed`, `isAutoRevokeWhitelisted()` returns `true` regardless of the switch's setting. My sample app for this should be published on Monday. Note that if you want Google to pay attention to your issue, most likely you are going to need to provide a sample app and instructions for reproducing the problem. – CommonsWare Aug 13 '20 at 22:09

1 Answers1

1

You probably have targetSDK set to 29, I also experienced incorrect API work on it. But if I set targetSDK to 30 it gets back to normal.

Dmitry.N
  • 11
  • 2
  • yes that's correct it is only happening only. target sdk 29, still strange perhaps i will file this with google again. – amIT Mar 03 '21 at 06:09