diff options
| -rw-r--r-- | api/system-current.txt | 2 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 24df5f1ecb16..6605740aa0d0 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6374,7 +6374,7 @@ package android.telephony { 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 ff9ae2237be4..3ca3cd812007 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -94,6 +94,7 @@ import java.lang.annotation.Retention; 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; @@ -3291,26 +3292,25 @@ public class TelephonyManager { } /** - * 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) { |