Reputation: 325
Step 1: Open my app
Step 2: Open system settings(My app is still alive, not killed)
Step 3: Choose a permission of my app(e.g. camera or location), which state is allow and turn it to deny
Step 4: Open my app
My app dead in Step3, and in Step4 it start a new thread. It also happened on other apps. I try these on android 10 and android 12 emulator.
Other apps I' ve tried on emulator: WeChat, Google Photos, Chrome. For most kinds of permission they dead, and for some permissions they still alive. (My WeChat dead when denied camera permission, but for "Draw over other apps" permission, it did not)
Why did the thread die? There is no useful log in the dead thread. The new thread says: Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.
Upvotes: 1
Views: 1229
Reputation: 165
When your app is alive. if you revoke permission from the settings page. The app process will be recreated. it will go to the exact screen where you are before the app gets killed. but viewmodel and all objects would be null at this point. Refer: Crash when disable permission and go back to the app
Upvotes: 1