diff options
Diffstat (limited to 'java/com/android/incallui/call/ExternalCallList.java')
-rw-r--r-- | java/com/android/incallui/call/ExternalCallList.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/java/com/android/incallui/call/ExternalCallList.java b/java/com/android/incallui/call/ExternalCallList.java index f104dfe9f..603ebf7b8 100644 --- a/java/com/android/incallui/call/ExternalCallList.java +++ b/java/com/android/incallui/call/ExternalCallList.java @@ -35,11 +35,11 @@ import java.util.concurrent.ConcurrentHashMap; */ public class ExternalCallList { - private final Set<Call> mExternalCalls = new ArraySet<>(); - private final Set<ExternalCallListener> mExternalCallListeners = + private final Set<Call> externalCalls = new ArraySet<>(); + private final Set<ExternalCallListener> externalCallListeners = Collections.newSetFromMap(new ConcurrentHashMap<ExternalCallListener, Boolean>(8, 0.9f, 1)); /** Handles {@link android.telecom.Call.Callback} callbacks. */ - private final Call.Callback mTelecomCallCallback = + private final Call.Callback telecomCallCallback = new Call.Callback() { @Override public void onDetailsChanged(Call call, Call.Details details) { @@ -51,52 +51,52 @@ public class ExternalCallList { public void onCallAdded(Call telecomCall) { Assert.checkArgument( telecomCall.getDetails().hasProperty(CallCompat.Details.PROPERTY_IS_EXTERNAL_CALL)); - mExternalCalls.add(telecomCall); - telecomCall.registerCallback(mTelecomCallCallback, new Handler(Looper.getMainLooper())); + externalCalls.add(telecomCall); + telecomCall.registerCallback(telecomCallCallback, new Handler(Looper.getMainLooper())); notifyExternalCallAdded(telecomCall); } /** Stops tracking an external call and notifies listeners of the removal of the call. */ public void onCallRemoved(Call telecomCall) { - if (!mExternalCalls.contains(telecomCall)) { + if (!externalCalls.contains(telecomCall)) { // This can happen on M for external calls from blocked numbers LogUtil.i("ExternalCallList.onCallRemoved", "attempted to remove unregistered call"); return; } - mExternalCalls.remove(telecomCall); - telecomCall.unregisterCallback(mTelecomCallCallback); + externalCalls.remove(telecomCall); + telecomCall.unregisterCallback(telecomCallCallback); notifyExternalCallRemoved(telecomCall); } /** Adds a new listener to external call events. */ public void addExternalCallListener(@NonNull ExternalCallListener listener) { - mExternalCallListeners.add(listener); + externalCallListeners.add(listener); } /** Removes a listener to external call events. */ public void removeExternalCallListener(@NonNull ExternalCallListener listener) { - if (!mExternalCallListeners.contains(listener)) { + if (!externalCallListeners.contains(listener)) { LogUtil.i( "ExternalCallList.removeExternalCallListener", "attempt to remove unregistered listener."); } - mExternalCallListeners.remove(listener); + externalCallListeners.remove(listener); } public boolean isCallTracked(@NonNull android.telecom.Call telecomCall) { - return mExternalCalls.contains(telecomCall); + return externalCalls.contains(telecomCall); } /** Notifies listeners of the addition of a new external call. */ private void notifyExternalCallAdded(Call call) { - for (ExternalCallListener listener : mExternalCallListeners) { + for (ExternalCallListener listener : externalCallListeners) { listener.onExternalCallAdded(call); } } /** Notifies listeners of the removal of an external call. */ private void notifyExternalCallRemoved(Call call) { - for (ExternalCallListener listener : mExternalCallListeners) { + for (ExternalCallListener listener : externalCallListeners) { listener.onExternalCallRemoved(call); } } @@ -109,11 +109,11 @@ public class ExternalCallList { // change. onCallRemoved(call); - for (ExternalCallListener listener : mExternalCallListeners) { + for (ExternalCallListener listener : externalCallListeners) { listener.onExternalCallPulled(call); } } else { - for (ExternalCallListener listener : mExternalCallListeners) { + for (ExternalCallListener listener : externalCallListeners) { listener.onExternalCallUpdated(call); } } |