Update connection service iteration for PhoneAccounts
Change-Id: I8f558439016388540af0deaf7c621cff89c9cb36
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index 2a10558..0eeb21e 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -80,6 +80,7 @@
void onCallerDisplayNameChanged(Call call);
void onVideoStateChanged(Call call);
void onStartActivityFromInCall(Call call, PendingIntent intent);
+ void onPhoneAccountChanged(Call call);
}
abstract static class ListenerBase implements Listener {
@@ -125,6 +126,8 @@
public void onVideoStateChanged(Call call) {}
@Override
public void onStartActivityFromInCall(Call call, PendingIntent intent) {}
+ @Override
+ public void onPhoneAccountChanged(Call call) {}
}
private static final OnQueryCompleteListener sCallerInfoQueryListener =
@@ -440,7 +443,12 @@
}
void setPhoneAccount(PhoneAccount account) {
- mPhoneAccount = account;
+ if (!Objects.equals(mPhoneAccount, account)) {
+ mPhoneAccount = account;
+ for (Listener l : mListeners) {
+ l.onPhoneAccountChanged(this);
+ }
+ }
}
boolean isIncoming() {