OSDN Git Service

Fix TrustedCredentialsSettings NPE
authordaqi <daqi@xiaomi.com>
Tue, 5 Sep 2017 01:53:05 +0000 (09:53 +0800)
committerdaqi <daqi@xiaomi.com>
Thu, 7 Sep 2017 09:21:25 +0000 (17:21 +0800)
commitbe47df7395d1ccf1b35f33f963ca0c69a1036de0
tree40f8b71c2045f765e5a37d6114a14251fb101118
parent0bed3cacd7bb5fab60242fa8690a9a6b1eee8698
Fix TrustedCredentialsSettings NPE

[Cause of Defect]
TrustedCredentialsSettings#mKeyChainConnectionByProfileId is get/set by
more than one thread. Main thread would set it in onDestroy method, and
AsyncTask would get and set in the doInBackground method. So
mKeyChainConnectionByProfileId.get(profileId) would get null after
onDestroy method get called.

Bug: N/A
Test: Debugger to simulate concurrency
Change-Id: I0664d1e9b88b079855354ce0e6fe014a98a22327
Signed-off-by: daqi <daqi@xiaomi.com>
src/com/android/settings/TrustedCredentialsSettings.java