Skip to content
Commit 267c50e7 authored by xiaobing.sun's avatar xiaobing.sun
Browse files

Synchronize mPermissions to void NullPointerException.

When we run mokey test on App permissions activity of a APK for example Contacts(Settings -> Apps & notifications ->See all ** apps -> Contacts ->Permissions),if we grant and revoke some permission frequently,NullPointerException may happen.

As granting runtime perimssion leads to writting new state of runtime permissions on disk via BackgroundThread. To write new state of runtime permissions, system will get the permissionData stored in mPermissions(assume that this permissionData is stored at the last location ).If we revoke this permison,permissionData will be removed from mPermissions on another thread. So in function getPermissionStatesInternal,mPermissions.valueAt(i) may return null by chance so that crash will happen. So we should synchronize mPermissions to void NullPointerException.

Bug:115697209

Test: Make services.jar,push it into phone and reboot.Run monkey test on App permissions activity and no NullPointerException happens.

Change-Id: I61151fa7df7a2c3830cff2eac9cc8284bd28c448
parent 0af8c5c7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment