12

In Android-11, If I choose Only This Time permission and access Camera then:

Observed Behaviour: One-Time permission stays granted for a few seconds (approx 3-5 sec) after we kill the application. If I re-open the application instantly or before this short period of time then the permission stays granted and If I re-open it after this short period of time then it will ask permission again and works fine.

Expected Behaviour: The permission will be revoked instantly after we kill the application instead of waiting for any specific period of time.

Is there any solution to it or is it a bug in Android-11? Also, nothing is mentioned in the documentation related to it. https://developer.android.com/guide/topics/permissions/overview#one-time

(P.S: All permission related checks are already implemented in the code.)

Deeksha
  • 536
  • 5
  • 14
  • 1
    "after we kill the application" -- what precisely do you mean by this? "Is there any solution to it or is it a bug in Android-11?" -- probably neither, as the documentation is very unclear as to exactly when these permissions get revoked. – CommonsWare Oct 21 '20 at 13:45
  • "After we kill the application" means the app is in a killed state nor in the background neither in the foreground. @CommonsWare And Yes documentation is very unclear about this. – Deeksha Oct 23 '20 at 13:25
  • I have observed the same behaviour on android 11 Pixel 4 :/ – zeroDivider Jan 19 '21 at 13:26
  • 1
    Just came across this too on my Pixel 3A XL with Android 11 - it seems like it does revoke the temporary permission after one minute when the app has been closed (back button, not killed/moved from recents) after 50 seconds it does not ask again, whereas after 1:05min it does ask and the app start takes a bit longer then - I could imagine this is on purpose so if you instantly go back to the app it will not annoy you again - and one minute is quite short. It's still irritating, since it says only "this" time.. – Ben Oct 04 '21 at 16:51
  • @Ben yes there is a time period after which permissions are revoked. But that time period is not fixed as earlier it was approx 5 seconds but now its approx 1 min. Also there is no mention of this time period in any documentation. It will cause issue if it will vary. – Deeksha Oct 06 '21 at 14:00

0 Answers0