SIGN IN SIGN UP

Remove the mRemoteTaskStackListeners lock.

RemoteCallbackList sychronizes on RemoteCallbackList.mInterfaces for the following methods:

RemoteCallbackList.register
RemoteCallbackList.unregister
RemoteCallbackList.beginBroadcast (creates a copy-on-write of the list, also under mLock)
RemoteCallbackList.finishBroadcast (clears copy-on-write of the list, also under mLock)

The last two are done under mLock. The following method doesn't need to hold RemoteCallbackList.mInterfaces because it only accesses an immutable copy of the list, not the modifiable list.

RemoteCallbackList.getBroadcastItem (reads copy-on-write array, without mLock)

The only requirement to be thread-safe with RemoteCallbackList seems to be to beginBroadcast+getBroadcastItem+finishBroadcast all in the same handler thread, so we do not need another lock to protect.

Bug: none
Flag: EXEMPT minor optimization
Change-Id: Ia40a1570daa48945c0b82d7bc5d8d7960c16f6f7
L
lijilou committed
1b6cc77f2e3aad049086e56c4f941f5c150d7806
Parent: 23ba066