support mno carrier id
Bug: 110559381
Test: CarrierResolverTest.testMnoCarrierId
Change-Id: I70c09bb729626735e3bfa7fd1cf23255784e5784
Merged-in: I70c09bb729626735e3bfa7fd1cf23255784e5784
diff --git a/src/com/android/providers/telephony/CarrierIdProvider.java b/src/com/android/providers/telephony/CarrierIdProvider.java
index b4b9982..2ce780b 100644
--- a/src/com/android/providers/telephony/CarrierIdProvider.java
+++ b/src/com/android/providers/telephony/CarrierIdProvider.java
@@ -151,9 +151,10 @@
/**
* Stores carrier id information for the current active subscriptions.
- * Key is the active subId and entryValue is a pair of carrier id(int) and Carrier Name(String).
+ * Key is the active subId and entryValue is carrier id(int), mno carrier id (int) and
+ * carrier name(String).
*/
- private final Map<Integer, Pair<Integer, String>> mCurrentSubscriptionMap =
+ private final Map<Integer, ContentValues> mCurrentSubscriptionMap =
new ConcurrentHashMap<>();
@VisibleForTesting
@@ -599,9 +600,7 @@
}
return count;
} else {
- mCurrentSubscriptionMap.put(subId,
- new Pair(cv.getAsInteger(CarrierId.CARRIER_ID),
- cv.getAsString(CarrierId.CARRIER_NAME)));
+ mCurrentSubscriptionMap.put(subId, new ContentValues(cv));
getContext().getContentResolver().notifyChange(CarrierId.CONTENT_URI, null);
return 1;
}
@@ -633,9 +632,11 @@
for (int i = 0; i < c.getColumnCount(); i++) {
final String columnName = c.getColumnName(i);
if (CarrierId.CARRIER_ID.equals(columnName)) {
- row.add(mCurrentSubscriptionMap.get(subId).first);
+ row.add(mCurrentSubscriptionMap.get(subId).get(CarrierId.CARRIER_ID));
} else if (CarrierId.CARRIER_NAME.equals(columnName)) {
- row.add(mCurrentSubscriptionMap.get(subId).second);
+ row.add(mCurrentSubscriptionMap.get(subId).get(CarrierId.CARRIER_NAME));
+ } else if (CarrierId.MNO_CARRIER_ID.equals(columnName)) {
+ row.add(mCurrentSubscriptionMap.get(subId).get(CarrierId.MNO_CARRIER_ID));
} else {
throw new IllegalArgumentException("Invalid column " + projectionIn[i]);
}