应用程序在启用/禁用来自Settings-> apps-> my app->权限的权限后重新启动. Adb可以看到与权限相关的应用操作已更改…,
08-31 14:30:29.480 I/ActivityManager( 8206): Displayed com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.ManagePermissionsActivity: +392ms 08-31 14:30:29.496 D/OpenGLRenderer(15990): endAllStagingAnimators on 0x9a60bd80 (ListView) with handle 0x97d4c1f0 08-31 14:30:30.477 D/audio_hw_primary( 7972): out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2 08-31 14:30:30.522 D/AudioFlinger( 7972): mixer(0xb3ec0000) throttle end: throttle time(5) 08-31 14:30:31.298 I/ActivityManager( 8206): Killing 28808:com.sample.ui/u0a109 (adj 2): Permission related app op changed
解决方法
如果您在后台运行后台进程或服务,那么如果用户从设置中撤消权限,则该进程将重新启动.除非您的活动背景与您的服务相关,否则这不应该影响您的活动.Google IO 2015-
https://www.youtube.com/watch?v=f17qe9vZ8RM中的发言人确实会告诉您流程重启等等….