Merge "[API feedback] api fixed for getSlotMapping" am: 9931252c3f
am: 58fed7fac6
Change-Id: I858a9014859f6c44862165cc7a970bdc20176fe4
diff --git a/api/system-current.txt b/api/system-current.txt
index b716be5..5d852e8 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -6382,7 +6382,7 @@
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
- method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.util.Pair<java.lang.Integer,java.lang.Integer>> getLogicalToPhysicalSlotMapping();
+ method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
method public static long getMaxNumberVerificationTimeoutMillis();
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmap();
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 6e8250d..103bab2 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -96,6 +96,7 @@
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -3299,26 +3300,25 @@
}
/**
- * Get the mapping from logical slots to physical slots. The mapping represent by a pair list.
- * The key of the piar is the logical slot id and the value of the pair is the physical
- * slots id mapped to this logical slot id.
+ * Get the mapping from logical slots to physical slots. The key of the map is the logical slot
+ * id and the value is the physical slots id mapped to this logical slot id.
*
- * @return an pair list indicates the mapping from logical slots to physical slots. The size of
- * the list should be {@link #getPhoneCount()} if success, otherwise return an empty list.
+ * @return a map indicates the mapping from logical slots to physical slots. The size of the map
+ * should be {@link #getPhoneCount()} if success, otherwise return an empty map.
*
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@NonNull
- public List<Pair<Integer, Integer>> getLogicalToPhysicalSlotMapping() {
- List<Pair<Integer, Integer>> slotMapping = new ArrayList<>();
+ public Map<Integer, Integer> getLogicalToPhysicalSlotMapping() {
+ Map<Integer, Integer> slotMapping = new HashMap<>();
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
int[] slotMappingArray = telephony.getSlotsMapping();
for (int i = 0; i < slotMappingArray.length; i++) {
- slotMapping.add(new Pair(i, slotMappingArray[i]));
+ slotMapping.put(i, slotMappingArray[i]);
}
}
} catch (RemoteException e) {