diff options
author | Etan Cohen <etancohen@google.com> | 2014-09-30 10:35:24 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2014-09-30 22:23:49 +0000 |
commit | a33cf075fa13c29d702d6b0a2aa2ae1323c60d73 (patch) | |
tree | d1590f1c50c7dd5c8e29ca8a104ccd1eb4cb8ff6 /services/core/java/com/android/server/TelephonyRegistry.java | |
parent | ec89863adec09dbf980b2d2c90c0fa5e78ffa7a9 (diff) | |
download | frameworks_base-a33cf075fa13c29d702d6b0a2aa2ae1323c60d73.zip frameworks_base-a33cf075fa13c29d702d6b0a2aa2ae1323c60d73.tar.gz frameworks_base-a33cf075fa13c29d702d6b0a2aa2ae1323c60d73.tar.bz2 |
Fix concurrent access violation.
Change-Id: I8586629cafe585135f0f72ba011b65f81242fc22
Diffstat (limited to 'services/core/java/com/android/server/TelephonyRegistry.java')
-rw-r--r-- | services/core/java/com/android/server/TelephonyRegistry.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index b3337bb..e3e0228 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -212,11 +212,12 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { //defaultSubId comes before new defaultSubId update) we need to recall all //possible missed notify callback synchronized (mRecords) { - for (Record r : mRecords) { - if(r.subId == SubscriptionManager.DEFAULT_SUB_ID) { - checkPossibleMissNotify(r, newDefaultPhoneId); - } - } + for (Record r : mRecords) { + if(r.subId == SubscriptionManager.DEFAULT_SUB_ID) { + checkPossibleMissNotify(r, newDefaultPhoneId); + } + } + handleRemoveListLocked(); } mDefaultSubId = newDefaultSubId; mDefaultPhoneId = newDefaultPhoneId; @@ -1445,7 +1446,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { r.callback.onServiceStateChanged( new ServiceState(mServiceState[phoneId])); } catch (RemoteException ex) { - remove(r.binder); + mRemoveList.add(r.binder); } } @@ -1472,7 +1473,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { r.callback.onSignalStrengthChanged((gsmSignalStrength == 99 ? -1 : gsmSignalStrength)); } catch (RemoteException ex) { - remove(r.binder); + mRemoveList.add(r.binder); } } @@ -1484,7 +1485,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { } r.callback.onCellInfoChanged(mCellInfo.get(phoneId)); } catch (RemoteException ex) { - remove(r.binder); + mRemoveList.add(r.binder); } } @@ -1497,7 +1498,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { r.callback.onMessageWaitingIndicatorChanged( mMessageWaiting[phoneId]); } catch (RemoteException ex) { - remove(r.binder); + mRemoveList.add(r.binder); } } @@ -1510,7 +1511,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { r.callback.onCallForwardingIndicatorChanged( mCallForwarding[phoneId]); } catch (RemoteException ex) { - remove(r.binder); + mRemoveList.add(r.binder); } } @@ -1535,7 +1536,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { r.callback.onDataConnectionStateChanged(mDataConnectionState[phoneId], mDataConnectionNetworkType[phoneId]); } catch (RemoteException ex) { - remove(r.binder); + mRemoveList.add(r.binder); } } } |