summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorxiaobing.sun <sunxiaobing468@gmail.com>2018-10-12 17:04:29 +0800
committerxiaobing.sun <sunxiaobing468@gmail.com>2018-10-24 14:39:07 +0800
commit267c50e72f782abdb2ae0b3c6d8239a6055b9baa (patch)
tree4b9d1437886f77a28803d0d4717c8ef692fa7de3 /tools/aapt2/java/JavaClassGenerator.cpp
parent0af8c5c73c423ed76c132a46d624cd64af999ab8 (diff)
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
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions