Merge changes Ied3b3b3e,I835f3ef9
* changes:
Telecomm: Fix PhoneAccountRegistrarTest
Telecomm: Fix ConnectionServiceRepository
diff --git a/src/com/android/server/telecom/ConnectionServiceRepository.java b/src/com/android/server/telecom/ConnectionServiceRepository.java
index 4685704..d34ea3c 100644
--- a/src/com/android/server/telecom/ConnectionServiceRepository.java
+++ b/src/com/android/server/telecom/ConnectionServiceRepository.java
@@ -43,7 +43,8 @@
@Override
public void onUnbind(ConnectionServiceWrapper service) {
synchronized (mLock) {
- mServiceCache.remove(service.getComponentName());
+ mServiceCache.remove(Pair.create(service.getComponentName(),
+ service.getUserHandle()));
}
}
};
diff --git a/src/com/android/server/telecom/ServiceBinder.java b/src/com/android/server/telecom/ServiceBinder.java
index 47ba295..44ddc24 100644
--- a/src/com/android/server/telecom/ServiceBinder.java
+++ b/src/com/android/server/telecom/ServiceBinder.java
@@ -261,6 +261,10 @@
mUserHandle = userHandle;
}
+ final UserHandle getUserHandle() {
+ return mUserHandle;
+ }
+
final void incrementAssociatedCallCount() {
mAssociatedCallCount++;
Log.v(this, "Call count increment %d, %s", mAssociatedCallCount,
diff --git a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
index 7d9cf88..e688416 100644
--- a/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
+++ b/tests/src/com/android/server/telecom/tests/PhoneAccountRegistrarTest.java
@@ -59,6 +59,7 @@
import java.io.File;
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import static org.junit.Assert.assertEquals;
@@ -1036,9 +1037,10 @@
PhoneAccountRegistrar.State a, PhoneAccountRegistrar.State b) {
assertEquals(a.defaultOutgoingAccountHandles.size(),
b.defaultOutgoingAccountHandles.size());
- for (int i = 0; i < a.defaultOutgoingAccountHandles.size(); i++) {
- assertDefaultPhoneAccountHandleEquals(a.defaultOutgoingAccountHandles.get(i),
- b.defaultOutgoingAccountHandles.get(i));
+ for (Map.Entry<UserHandle, DefaultPhoneAccountHandle> e :
+ a.defaultOutgoingAccountHandles.entrySet()) {
+ assertDefaultPhoneAccountHandleEquals(e.getValue(),
+ b.defaultOutgoingAccountHandles.get(e.getKey()));
}
assertEquals(a.accounts.size(), b.accounts.size());
for (int i = 0; i < a.accounts.size(); i++) {