Don't display gateway number on bluetooth
Display actual contact phone number instead of the Google voice
gateway number when there is a bluetooth connection with eg a car display.
Bug:11881222
Change-Id: I1a5b9d3dee4a490905e6e4b52745972fd63d81a1
diff --git a/src/com/android/phone/CallGatewayManager.java b/src/com/android/phone/CallGatewayManager.java
index 6fe2444..81bee07 100644
--- a/src/com/android/phone/CallGatewayManager.java
+++ b/src/com/android/phone/CallGatewayManager.java
@@ -25,7 +25,7 @@
import com.android.internal.telephony.Connection;
import com.google.android.collect.Maps;
-import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
/**
* This class manages gateway information for outgoing calls. When calls are made, they may contain
@@ -68,9 +68,19 @@
public static final RawGatewayInfo EMPTY_INFO = new RawGatewayInfo(null, null, null);
- private final HashMap<Connection, RawGatewayInfo> mMap = Maps.newHashMap();
+ private final ConcurrentHashMap<Connection, RawGatewayInfo> mMap =
+ new ConcurrentHashMap<Connection, RawGatewayInfo>(4, 0.9f, 1);
- public CallGatewayManager() {
+ private static CallGatewayManager sSingleton;
+
+ public static synchronized CallGatewayManager getInstance() {
+ if (sSingleton == null) {
+ sSingleton = new CallGatewayManager();
+ }
+ return sSingleton;
+ }
+
+ private CallGatewayManager() {
}
/**