Loading packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +2 −2 Original line number Diff line number Diff line Loading @@ -1625,7 +1625,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { */ public void reportSimUnlocked(int subId) { if (DEBUG_SIM_STATES) Log.v(TAG, "reportSimUnlocked(subId=" + subId + ")"); int slotId = SubscriptionManager.getSlotId(subId); int slotId = SubscriptionManager.getSlotIndex(subId); handleSimStateChange(subId, slotId, State.READY); } Loading Loading @@ -1794,7 +1794,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { for (int i = 0; i < list.size(); i++) { final SubscriptionInfo info = list.get(i); final int id = info.getSubscriptionId(); int slotId = SubscriptionManager.getSlotId(id); int slotId = SubscriptionManager.getSlotIndex(id); if (state == getSimState(id) && bestSlotId > slotId ) { resultId = id; bestSlotId = slotId; Loading telephony/java/android/telephony/PhoneNumberUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -1896,7 +1896,7 @@ public class PhoneNumberUtils number = extractNetworkPortionAlt(number); String emergencyNumbers = ""; int slotId = SubscriptionManager.getSlotId(subId); int slotId = SubscriptionManager.getSlotIndex(subId); // retrieve the list of emergency numbers // check read-write ecclist property first Loading telephony/java/android/telephony/SubscriptionManager.java +28 −28 Original line number Diff line number Diff line Loading @@ -521,14 +521,14 @@ public class SubscriptionManager { } /** * Get the active SubscriptionInfo associated with the slotIdx * @param slotIdx the slot which the subscription is inserted * Get the active SubscriptionInfo associated with the slotIndex * @param slotIndex the slot which the subscription is inserted * @return SubscriptionInfo, maybe null if its not active */ public SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx) { if (VDBG) logd("[getActiveSubscriptionInfoForSimSlotIndex]+ slotIdx=" + slotIdx); if (!isValidSlotId(slotIdx)) { logd("[getActiveSubscriptionInfoForSimSlotIndex]- invalid slotIdx"); public SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIndex) { if (VDBG) logd("[getActiveSubscriptionInfoForSimSlotIndex]+ slotIndex=" + slotIndex); if (!isValidSlotIndex(slotIndex)) { logd("[getActiveSubscriptionInfoForSimSlotIndex]- invalid slotIndex"); return null; } Loading @@ -537,7 +537,7 @@ public class SubscriptionManager { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { result = iSub.getActiveSubscriptionInfoForSimSlotIndex(slotIdx, result = iSub.getActiveSubscriptionInfoForSimSlotIndex(slotIndex, mContext.getOpPackageName()); } } catch (RemoteException ex) { Loading Loading @@ -671,24 +671,24 @@ public class SubscriptionManager { /** * Add a new SubscriptionInfo to SubscriptionInfo database if needed * @param iccId the IccId of the SIM card * @param slotId the slot which the SIM is inserted * @param slotIndex the slot which the SIM is inserted * @return the URL of the newly created row or the updated row * @hide */ public Uri addSubscriptionInfoRecord(String iccId, int slotId) { if (VDBG) logd("[addSubscriptionInfoRecord]+ iccId:" + iccId + " slotId:" + slotId); public Uri addSubscriptionInfoRecord(String iccId, int slotIndex) { if (VDBG) logd("[addSubscriptionInfoRecord]+ iccId:" + iccId + " slotIndex:" + slotIndex); if (iccId == null) { logd("[addSubscriptionInfoRecord]- null iccId"); } if (!isValidSlotId(slotId)) { logd("[addSubscriptionInfoRecord]- invalid slotId"); if (!isValidSlotIndex(slotIndex)) { logd("[addSubscriptionInfoRecord]- invalid slotIndex"); } try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { // FIXME: This returns 1 on success, 0 on error should should we return it? iSub.addSubInfoRecord(iccId, slotId); iSub.addSubInfoRecord(iccId, slotIndex); } } catch (RemoteException ex) { // ignore it Loading Loading @@ -830,15 +830,15 @@ public class SubscriptionManager { } /** * Get slotId associated with the subscription. * @return slotId as a positive integer or a negative value if an error either * Get slotIndex associated with the subscription. * @return slotIndex as a positive integer or a negative value if an error either * SIM_NOT_INSERTED or < 0 if an invalid slot index * @hide */ public static int getSlotId(int subId) { public static int getSlotIndex(int subId) { if (!isValidSubscriptionId(subId)) { if (DBG) { logd("[getSlotId]- fail"); logd("[getSlotIndex]- fail"); } } Loading @@ -847,7 +847,7 @@ public class SubscriptionManager { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { result = iSub.getSlotId(subId); result = iSub.getSlotIndex(subId); } } catch (RemoteException ex) { // ignore it Loading @@ -858,8 +858,8 @@ public class SubscriptionManager { } /** @hide */ public static int[] getSubId(int slotId) { if (!isValidSlotId(slotId)) { public static int[] getSubId(int slotIndex) { if (!isValidSlotIndex(slotIndex)) { logd("[getSubId]- fail"); return null; } Loading @@ -869,7 +869,7 @@ public class SubscriptionManager { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { subId = iSub.getSubId(slotId); subId = iSub.getSubId(slotIndex); } } catch (RemoteException ex) { // ignore it Loading Loading @@ -1155,8 +1155,8 @@ public class SubscriptionManager { } /** @hide */ public static boolean isValidSlotId(int slotId) { return slotId >= 0 && slotId < TelephonyManager.getDefault().getSimCount(); public static boolean isValidSlotIndex(int slotIndex) { return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getSimCount(); } /** @hide */ Loading @@ -1179,7 +1179,7 @@ public class SubscriptionManager { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.PHONE_KEY, phoneId); //FIXME this is using phoneId and slotId interchangeably //FIXME this is using phoneId and slotIndex interchangeably //Eventually, this should be removed as it is not the slot id intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); } Loading Loading @@ -1228,9 +1228,9 @@ public class SubscriptionManager { } /** * Returns a constant indicating the state of sim for the slot idx. * Returns a constant indicating the state of sim for the slot index. * * @param slotIdx * @param slotIndex * * {@See TelephonyManager#SIM_STATE_UNKNOWN} * {@See TelephonyManager#SIM_STATE_ABSENT} Loading @@ -1244,13 +1244,13 @@ public class SubscriptionManager { * * {@hide} */ public static int getSimStateForSlotIdx(int slotIdx) { public static int getSimStateForSlotIndex(int slotIndex) { int simState = TelephonyManager.SIM_STATE_UNKNOWN; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { simState = iSub.getSimStateForSlotIdx(slotIdx); simState = iSub.getSimStateForSlotIndex(slotIndex); } } catch (RemoteException ex) { } Loading telephony/java/android/telephony/TelephonyManager.java +47 −47 Original line number Diff line number Diff line Loading @@ -863,15 +863,15 @@ public class TelephonyManager { * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * * @param slotId of which deviceID is returned * @param slotIndex of which deviceID is returned */ /** {@hide} */ public String getDeviceSoftwareVersion(int slotId) { public String getDeviceSoftwareVersion(int slotIndex) { ITelephony telephony = getITelephony(); if (telephony == null) return null; try { return telephony.getDeviceSoftwareVersionForSlot(slotId, getOpPackageName()); return telephony.getDeviceSoftwareVersionForSlot(slotIndex, getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading Loading @@ -906,15 +906,15 @@ public class TelephonyManager { * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * * @param slotId of which deviceID is returned * @param slotIndex of which deviceID is returned */ public String getDeviceId(int slotId) { // FIXME this assumes phoneId == slotId public String getDeviceId(int slotIndex) { // FIXME this assumes phoneId == slotIndex try { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) return null; return info.getDeviceIdForPhone(slotId, mContext.getOpPackageName()); return info.getDeviceIdForPhone(slotIndex, mContext.getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading @@ -941,17 +941,17 @@ public class TelephonyManager { * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * * @param slotId of which deviceID is returned * @param slotIndex of which deviceID is returned * * @hide */ @SystemApi public String getImei(int slotId) { public String getImei(int slotIndex) { ITelephony telephony = getITelephony(); if (telephony == null) return null; try { return telephony.getImeiForSlot(slotId, getOpPackageName()); return telephony.getImeiForSlot(slotIndex, getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading @@ -971,11 +971,11 @@ public class TelephonyManager { /** * Returns the NAI. Return null if NAI is not available. * * @param slotId of which Nai is returned * @param slotIndex of which Nai is returned */ /** {@hide}*/ public String getNai(int slotId) { int[] subId = SubscriptionManager.getSubId(slotId); public String getNai(int slotIndex) { int[] subId = SubscriptionManager.getSubId(slotIndex); try { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) Loading Loading @@ -1171,23 +1171,23 @@ public class TelephonyManager { * * @hide */ public int getCurrentPhoneTypeForSlot(int slotId) { public int getCurrentPhoneTypeForSlot(int slotIndex) { try{ ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getActivePhoneTypeForSlot(slotId); return telephony.getActivePhoneTypeForSlot(slotIndex); } else { // This can happen when the ITelephony interface is not up yet. return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex); } } catch (RemoteException ex) { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex); } catch (NullPointerException ex) { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex); } } Loading Loading @@ -1900,17 +1900,17 @@ public class TelephonyManager { /** * @return true if a ICC card is present for a subscription * * @param slotId for which icc card presence is checked * @param slotIndex for which icc card presence is checked */ /** {@hide} */ // FIXME Input argument slotId should be of type int public boolean hasIccCard(int slotId) { // FIXME Input argument slotIndex should be of type int public boolean hasIccCard(int slotIndex) { try { ITelephony telephony = getITelephony(); if (telephony == null) return false; return telephony.hasIccCardUsingSlotId(slotId); return telephony.hasIccCardUsingSlotIndex(slotIndex); } catch (RemoteException ex) { // Assume no ICC card if remote exception which shouldn't happen return false; Loading @@ -1935,31 +1935,31 @@ public class TelephonyManager { * @see #SIM_STATE_CARD_RESTRICTED */ public int getSimState() { int slotIdx = getDefaultSim(); // slotIdx may be invalid due to sim being absent. In that case query all slots to get int slotIndex = getDefaultSim(); // slotIndex may be invalid due to sim being absent. In that case query all slots to get // sim state if (slotIdx < 0) { if (slotIndex < 0) { // query for all slots and return absent if all sim states are absent, otherwise // return unknown for (int i = 0; i < getPhoneCount(); i++) { int simState = getSimState(i); if (simState != SIM_STATE_ABSENT) { Rlog.d(TAG, "getSimState: default sim:" + slotIdx + ", sim state for " + "slotIdx=" + i + " is " + simState + ", return state as unknown"); Rlog.d(TAG, "getSimState: default sim:" + slotIndex + ", sim state for " + "slotIndex=" + i + " is " + simState + ", return state as unknown"); return SIM_STATE_UNKNOWN; } } Rlog.d(TAG, "getSimState: default sim:" + slotIdx + ", all SIMs absent, return " + Rlog.d(TAG, "getSimState: default sim:" + slotIndex + ", all SIMs absent, return " + "state as absent"); return SIM_STATE_ABSENT; } return getSimState(slotIdx); return getSimState(slotIndex); } /** * Returns a constant indicating the state of the device SIM card in a slot. * * @param slotIdx * @param slotIndex * * @see #SIM_STATE_UNKNOWN * @see #SIM_STATE_ABSENT Loading @@ -1972,8 +1972,8 @@ public class TelephonyManager { * @see #SIM_STATE_CARD_IO_ERROR * @see #SIM_STATE_CARD_RESTRICTED */ public int getSimState(int slotIdx) { int simState = SubscriptionManager.getSimStateForSlotIdx(slotIdx); public int getSimState(int slotIndex) { int simState = SubscriptionManager.getSimStateForSlotIndex(slotIndex); return simState; } Loading Loading @@ -3065,12 +3065,12 @@ public class TelephonyManager { * * @hide */ public int getCallStateForSlot(int slotId) { public int getCallStateForSlot(int slotIndex) { try { ITelephony telephony = getITelephony(); if (telephony == null) return CALL_STATE_IDLE; return telephony.getCallStateForSlot(slotId); return telephony.getCallStateForSlot(slotIndex); } catch (RemoteException ex) { // the phone process is restarting. return CALL_STATE_IDLE; Loading Loading @@ -3888,7 +3888,7 @@ public class TelephonyManager { /** {@hide} */ public int getDefaultSim() { return SubscriptionManager.getSlotId(SubscriptionManager.getDefaultSubscriptionId()); return SubscriptionManager.getSlotIndex(SubscriptionManager.getDefaultSubscriptionId()); } /** Loading Loading @@ -4253,7 +4253,7 @@ public class TelephonyManager { * feature or {@link null} if the service is not available. If an ImsServiceController is * available, the {@link IImsServiceFeatureListener} callback is registered as a listener for * feature updates. * @param slotId The SIM slot that we are requesting the {@link IImsServiceController} for. * @param slotIndex The SIM slot that we are requesting the {@link IImsServiceController} for. * @param feature The IMS Feature we are requesting, corresponding to {@link ImsFeature}. * @param callback Listener that will send updates to ImsManager when there are updates to * ImsServiceController. Loading @@ -4261,12 +4261,12 @@ public class TelephonyManager { * it is unavailable. * @hide */ public IImsServiceController getImsServiceControllerAndListen(int slotId, @Feature int feature, public IImsServiceController getImsServiceControllerAndListen(int slotIndex, @Feature int feature, IImsServiceFeatureListener callback) { try { ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getImsServiceControllerAndListen(slotId, feature, callback); return telephony.getImsServiceControllerAndListen(slotIndex, feature, callback); } } catch (RemoteException e) { Rlog.e(TAG, "getImsServiceControllerAndListen, RemoteException: " + e.getMessage()); Loading Loading @@ -5404,7 +5404,7 @@ public class TelephonyManager { /** * Set SIM card power state. Request is equivalent to inserting or removing the card. * * @param slotId SIM slot id * @param slotIndex SIM slot id * @param powerUp True if powering up the SIM, otherwise powering down * * <p>Requires Permission: Loading @@ -5412,11 +5412,11 @@ public class TelephonyManager { * * @hide **/ public void setSimPowerStateForSlot(int slotId, boolean powerUp) { public void setSimPowerStateForSlot(int slotIndex, boolean powerUp) { try { ITelephony telephony = getITelephony(); if (telephony != null) { telephony.setSimPowerStateForSlot(slotId, powerUp); telephony.setSimPowerStateForSlot(slotIndex, powerUp); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setSimPowerStateForSlot", e); Loading Loading @@ -5952,7 +5952,7 @@ public class TelephonyManager { } /** * Set the allowed carrier list for slotId * Set the allowed carrier list for slotIndex * Require system privileges. In the future we may add this to carrier APIs. * * <p>Requires Permission: Loading @@ -5966,11 +5966,11 @@ public class TelephonyManager { * @hide */ @SystemApi public int setAllowedCarriers(int slotId, List<CarrierIdentifier> carriers) { public int setAllowedCarriers(int slotIndex, List<CarrierIdentifier> carriers) { try { ITelephony service = getITelephony(); if (service != null) { return service.setAllowedCarriers(slotId, carriers); return service.setAllowedCarriers(slotIndex, carriers); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setAllowedCarriers", e); Loading @@ -5981,7 +5981,7 @@ public class TelephonyManager { } /** * Get the allowed carrier list for slotId. * Get the allowed carrier list for slotIndex. * Require system privileges. In the future we may add this to carrier APIs. * * <p>Requires Permission: Loading @@ -5995,11 +5995,11 @@ public class TelephonyManager { * @hide */ @SystemApi public List<CarrierIdentifier> getAllowedCarriers(int slotId) { public List<CarrierIdentifier> getAllowedCarriers(int slotIndex) { try { ITelephony service = getITelephony(); if (service != null) { return service.getAllowedCarriers(slotId); return service.getAllowedCarriers(slotIndex); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#getAllowedCarriers", e); Loading telephony/java/com/android/internal/telephony/ISub.aidl +9 −9 Original line number Diff line number Diff line Loading @@ -52,12 +52,12 @@ interface ISub { SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId, String callingPackage); /** * Get the active SubscriptionInfo associated with the slotIdx * @param slotIdx the slot which the subscription is inserted * Get the active SubscriptionInfo associated with the slotIndex * @param slotIndex the slot which the subscription is inserted * @param callingPackage The package maing the call. * @return SubscriptionInfo, maybe null if its not active */ SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx, String callingPackage); SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIndex, String callingPackage); /** * Get the SubscriptionInfo(s) of the active subscriptions. The records will be sorted Loading Loading @@ -96,10 +96,10 @@ interface ISub { /** * Add a new SubscriptionInfo to subinfo database if needed * @param iccId the IccId of the SIM card * @param slotId the slot which the SIM is inserted * @param slotIndex the slot which the SIM is inserted * @return the URL of the newly created row or the updated row */ int addSubInfoRecord(String iccId, int slotId); int addSubInfoRecord(String iccId, int slotIndex); /** * Set SIM icon tint color by simInfo index Loading Loading @@ -142,9 +142,9 @@ interface ISub { */ int setDataRoaming(int roaming, int subId); int getSlotId(int subId); int getSlotIndex(int subId); int[] getSubId(int slotId); int[] getSubId(int slotIndex); int getDefaultSubId(); Loading Loading @@ -177,10 +177,10 @@ interface ISub { String getSubscriptionProperty(int subId, String propKey, String callingPackage); /** * Get the SIM state for the slot idx * Get the SIM state for the slot index * @return SIM state as the ordinal of IccCardConstants.State */ int getSimStateForSlotIdx(int slotIdx); int getSimStateForSlotIndex(int slotIndex); boolean isActiveSubId(int subId); } Loading
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +2 −2 Original line number Diff line number Diff line Loading @@ -1625,7 +1625,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { */ public void reportSimUnlocked(int subId) { if (DEBUG_SIM_STATES) Log.v(TAG, "reportSimUnlocked(subId=" + subId + ")"); int slotId = SubscriptionManager.getSlotId(subId); int slotId = SubscriptionManager.getSlotIndex(subId); handleSimStateChange(subId, slotId, State.READY); } Loading Loading @@ -1794,7 +1794,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { for (int i = 0; i < list.size(); i++) { final SubscriptionInfo info = list.get(i); final int id = info.getSubscriptionId(); int slotId = SubscriptionManager.getSlotId(id); int slotId = SubscriptionManager.getSlotIndex(id); if (state == getSimState(id) && bestSlotId > slotId ) { resultId = id; bestSlotId = slotId; Loading
telephony/java/android/telephony/PhoneNumberUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -1896,7 +1896,7 @@ public class PhoneNumberUtils number = extractNetworkPortionAlt(number); String emergencyNumbers = ""; int slotId = SubscriptionManager.getSlotId(subId); int slotId = SubscriptionManager.getSlotIndex(subId); // retrieve the list of emergency numbers // check read-write ecclist property first Loading
telephony/java/android/telephony/SubscriptionManager.java +28 −28 Original line number Diff line number Diff line Loading @@ -521,14 +521,14 @@ public class SubscriptionManager { } /** * Get the active SubscriptionInfo associated with the slotIdx * @param slotIdx the slot which the subscription is inserted * Get the active SubscriptionInfo associated with the slotIndex * @param slotIndex the slot which the subscription is inserted * @return SubscriptionInfo, maybe null if its not active */ public SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx) { if (VDBG) logd("[getActiveSubscriptionInfoForSimSlotIndex]+ slotIdx=" + slotIdx); if (!isValidSlotId(slotIdx)) { logd("[getActiveSubscriptionInfoForSimSlotIndex]- invalid slotIdx"); public SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIndex) { if (VDBG) logd("[getActiveSubscriptionInfoForSimSlotIndex]+ slotIndex=" + slotIndex); if (!isValidSlotIndex(slotIndex)) { logd("[getActiveSubscriptionInfoForSimSlotIndex]- invalid slotIndex"); return null; } Loading @@ -537,7 +537,7 @@ public class SubscriptionManager { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { result = iSub.getActiveSubscriptionInfoForSimSlotIndex(slotIdx, result = iSub.getActiveSubscriptionInfoForSimSlotIndex(slotIndex, mContext.getOpPackageName()); } } catch (RemoteException ex) { Loading Loading @@ -671,24 +671,24 @@ public class SubscriptionManager { /** * Add a new SubscriptionInfo to SubscriptionInfo database if needed * @param iccId the IccId of the SIM card * @param slotId the slot which the SIM is inserted * @param slotIndex the slot which the SIM is inserted * @return the URL of the newly created row or the updated row * @hide */ public Uri addSubscriptionInfoRecord(String iccId, int slotId) { if (VDBG) logd("[addSubscriptionInfoRecord]+ iccId:" + iccId + " slotId:" + slotId); public Uri addSubscriptionInfoRecord(String iccId, int slotIndex) { if (VDBG) logd("[addSubscriptionInfoRecord]+ iccId:" + iccId + " slotIndex:" + slotIndex); if (iccId == null) { logd("[addSubscriptionInfoRecord]- null iccId"); } if (!isValidSlotId(slotId)) { logd("[addSubscriptionInfoRecord]- invalid slotId"); if (!isValidSlotIndex(slotIndex)) { logd("[addSubscriptionInfoRecord]- invalid slotIndex"); } try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { // FIXME: This returns 1 on success, 0 on error should should we return it? iSub.addSubInfoRecord(iccId, slotId); iSub.addSubInfoRecord(iccId, slotIndex); } } catch (RemoteException ex) { // ignore it Loading Loading @@ -830,15 +830,15 @@ public class SubscriptionManager { } /** * Get slotId associated with the subscription. * @return slotId as a positive integer or a negative value if an error either * Get slotIndex associated with the subscription. * @return slotIndex as a positive integer or a negative value if an error either * SIM_NOT_INSERTED or < 0 if an invalid slot index * @hide */ public static int getSlotId(int subId) { public static int getSlotIndex(int subId) { if (!isValidSubscriptionId(subId)) { if (DBG) { logd("[getSlotId]- fail"); logd("[getSlotIndex]- fail"); } } Loading @@ -847,7 +847,7 @@ public class SubscriptionManager { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { result = iSub.getSlotId(subId); result = iSub.getSlotIndex(subId); } } catch (RemoteException ex) { // ignore it Loading @@ -858,8 +858,8 @@ public class SubscriptionManager { } /** @hide */ public static int[] getSubId(int slotId) { if (!isValidSlotId(slotId)) { public static int[] getSubId(int slotIndex) { if (!isValidSlotIndex(slotIndex)) { logd("[getSubId]- fail"); return null; } Loading @@ -869,7 +869,7 @@ public class SubscriptionManager { try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { subId = iSub.getSubId(slotId); subId = iSub.getSubId(slotIndex); } } catch (RemoteException ex) { // ignore it Loading Loading @@ -1155,8 +1155,8 @@ public class SubscriptionManager { } /** @hide */ public static boolean isValidSlotId(int slotId) { return slotId >= 0 && slotId < TelephonyManager.getDefault().getSimCount(); public static boolean isValidSlotIndex(int slotIndex) { return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getSimCount(); } /** @hide */ Loading @@ -1179,7 +1179,7 @@ public class SubscriptionManager { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.PHONE_KEY, phoneId); //FIXME this is using phoneId and slotId interchangeably //FIXME this is using phoneId and slotIndex interchangeably //Eventually, this should be removed as it is not the slot id intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); } Loading Loading @@ -1228,9 +1228,9 @@ public class SubscriptionManager { } /** * Returns a constant indicating the state of sim for the slot idx. * Returns a constant indicating the state of sim for the slot index. * * @param slotIdx * @param slotIndex * * {@See TelephonyManager#SIM_STATE_UNKNOWN} * {@See TelephonyManager#SIM_STATE_ABSENT} Loading @@ -1244,13 +1244,13 @@ public class SubscriptionManager { * * {@hide} */ public static int getSimStateForSlotIdx(int slotIdx) { public static int getSimStateForSlotIndex(int slotIndex) { int simState = TelephonyManager.SIM_STATE_UNKNOWN; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { simState = iSub.getSimStateForSlotIdx(slotIdx); simState = iSub.getSimStateForSlotIndex(slotIndex); } } catch (RemoteException ex) { } Loading
telephony/java/android/telephony/TelephonyManager.java +47 −47 Original line number Diff line number Diff line Loading @@ -863,15 +863,15 @@ public class TelephonyManager { * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * * @param slotId of which deviceID is returned * @param slotIndex of which deviceID is returned */ /** {@hide} */ public String getDeviceSoftwareVersion(int slotId) { public String getDeviceSoftwareVersion(int slotIndex) { ITelephony telephony = getITelephony(); if (telephony == null) return null; try { return telephony.getDeviceSoftwareVersionForSlot(slotId, getOpPackageName()); return telephony.getDeviceSoftwareVersionForSlot(slotIndex, getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading Loading @@ -906,15 +906,15 @@ public class TelephonyManager { * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * * @param slotId of which deviceID is returned * @param slotIndex of which deviceID is returned */ public String getDeviceId(int slotId) { // FIXME this assumes phoneId == slotId public String getDeviceId(int slotIndex) { // FIXME this assumes phoneId == slotIndex try { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) return null; return info.getDeviceIdForPhone(slotId, mContext.getOpPackageName()); return info.getDeviceIdForPhone(slotIndex, mContext.getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading @@ -941,17 +941,17 @@ public class TelephonyManager { * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * * @param slotId of which deviceID is returned * @param slotIndex of which deviceID is returned * * @hide */ @SystemApi public String getImei(int slotId) { public String getImei(int slotIndex) { ITelephony telephony = getITelephony(); if (telephony == null) return null; try { return telephony.getImeiForSlot(slotId, getOpPackageName()); return telephony.getImeiForSlot(slotIndex, getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { Loading @@ -971,11 +971,11 @@ public class TelephonyManager { /** * Returns the NAI. Return null if NAI is not available. * * @param slotId of which Nai is returned * @param slotIndex of which Nai is returned */ /** {@hide}*/ public String getNai(int slotId) { int[] subId = SubscriptionManager.getSubId(slotId); public String getNai(int slotIndex) { int[] subId = SubscriptionManager.getSubId(slotIndex); try { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) Loading Loading @@ -1171,23 +1171,23 @@ public class TelephonyManager { * * @hide */ public int getCurrentPhoneTypeForSlot(int slotId) { public int getCurrentPhoneTypeForSlot(int slotIndex) { try{ ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getActivePhoneTypeForSlot(slotId); return telephony.getActivePhoneTypeForSlot(slotIndex); } else { // This can happen when the ITelephony interface is not up yet. return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex); } } catch (RemoteException ex) { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex); } catch (NullPointerException ex) { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex); } } Loading Loading @@ -1900,17 +1900,17 @@ public class TelephonyManager { /** * @return true if a ICC card is present for a subscription * * @param slotId for which icc card presence is checked * @param slotIndex for which icc card presence is checked */ /** {@hide} */ // FIXME Input argument slotId should be of type int public boolean hasIccCard(int slotId) { // FIXME Input argument slotIndex should be of type int public boolean hasIccCard(int slotIndex) { try { ITelephony telephony = getITelephony(); if (telephony == null) return false; return telephony.hasIccCardUsingSlotId(slotId); return telephony.hasIccCardUsingSlotIndex(slotIndex); } catch (RemoteException ex) { // Assume no ICC card if remote exception which shouldn't happen return false; Loading @@ -1935,31 +1935,31 @@ public class TelephonyManager { * @see #SIM_STATE_CARD_RESTRICTED */ public int getSimState() { int slotIdx = getDefaultSim(); // slotIdx may be invalid due to sim being absent. In that case query all slots to get int slotIndex = getDefaultSim(); // slotIndex may be invalid due to sim being absent. In that case query all slots to get // sim state if (slotIdx < 0) { if (slotIndex < 0) { // query for all slots and return absent if all sim states are absent, otherwise // return unknown for (int i = 0; i < getPhoneCount(); i++) { int simState = getSimState(i); if (simState != SIM_STATE_ABSENT) { Rlog.d(TAG, "getSimState: default sim:" + slotIdx + ", sim state for " + "slotIdx=" + i + " is " + simState + ", return state as unknown"); Rlog.d(TAG, "getSimState: default sim:" + slotIndex + ", sim state for " + "slotIndex=" + i + " is " + simState + ", return state as unknown"); return SIM_STATE_UNKNOWN; } } Rlog.d(TAG, "getSimState: default sim:" + slotIdx + ", all SIMs absent, return " + Rlog.d(TAG, "getSimState: default sim:" + slotIndex + ", all SIMs absent, return " + "state as absent"); return SIM_STATE_ABSENT; } return getSimState(slotIdx); return getSimState(slotIndex); } /** * Returns a constant indicating the state of the device SIM card in a slot. * * @param slotIdx * @param slotIndex * * @see #SIM_STATE_UNKNOWN * @see #SIM_STATE_ABSENT Loading @@ -1972,8 +1972,8 @@ public class TelephonyManager { * @see #SIM_STATE_CARD_IO_ERROR * @see #SIM_STATE_CARD_RESTRICTED */ public int getSimState(int slotIdx) { int simState = SubscriptionManager.getSimStateForSlotIdx(slotIdx); public int getSimState(int slotIndex) { int simState = SubscriptionManager.getSimStateForSlotIndex(slotIndex); return simState; } Loading Loading @@ -3065,12 +3065,12 @@ public class TelephonyManager { * * @hide */ public int getCallStateForSlot(int slotId) { public int getCallStateForSlot(int slotIndex) { try { ITelephony telephony = getITelephony(); if (telephony == null) return CALL_STATE_IDLE; return telephony.getCallStateForSlot(slotId); return telephony.getCallStateForSlot(slotIndex); } catch (RemoteException ex) { // the phone process is restarting. return CALL_STATE_IDLE; Loading Loading @@ -3888,7 +3888,7 @@ public class TelephonyManager { /** {@hide} */ public int getDefaultSim() { return SubscriptionManager.getSlotId(SubscriptionManager.getDefaultSubscriptionId()); return SubscriptionManager.getSlotIndex(SubscriptionManager.getDefaultSubscriptionId()); } /** Loading Loading @@ -4253,7 +4253,7 @@ public class TelephonyManager { * feature or {@link null} if the service is not available. If an ImsServiceController is * available, the {@link IImsServiceFeatureListener} callback is registered as a listener for * feature updates. * @param slotId The SIM slot that we are requesting the {@link IImsServiceController} for. * @param slotIndex The SIM slot that we are requesting the {@link IImsServiceController} for. * @param feature The IMS Feature we are requesting, corresponding to {@link ImsFeature}. * @param callback Listener that will send updates to ImsManager when there are updates to * ImsServiceController. Loading @@ -4261,12 +4261,12 @@ public class TelephonyManager { * it is unavailable. * @hide */ public IImsServiceController getImsServiceControllerAndListen(int slotId, @Feature int feature, public IImsServiceController getImsServiceControllerAndListen(int slotIndex, @Feature int feature, IImsServiceFeatureListener callback) { try { ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getImsServiceControllerAndListen(slotId, feature, callback); return telephony.getImsServiceControllerAndListen(slotIndex, feature, callback); } } catch (RemoteException e) { Rlog.e(TAG, "getImsServiceControllerAndListen, RemoteException: " + e.getMessage()); Loading Loading @@ -5404,7 +5404,7 @@ public class TelephonyManager { /** * Set SIM card power state. Request is equivalent to inserting or removing the card. * * @param slotId SIM slot id * @param slotIndex SIM slot id * @param powerUp True if powering up the SIM, otherwise powering down * * <p>Requires Permission: Loading @@ -5412,11 +5412,11 @@ public class TelephonyManager { * * @hide **/ public void setSimPowerStateForSlot(int slotId, boolean powerUp) { public void setSimPowerStateForSlot(int slotIndex, boolean powerUp) { try { ITelephony telephony = getITelephony(); if (telephony != null) { telephony.setSimPowerStateForSlot(slotId, powerUp); telephony.setSimPowerStateForSlot(slotIndex, powerUp); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setSimPowerStateForSlot", e); Loading Loading @@ -5952,7 +5952,7 @@ public class TelephonyManager { } /** * Set the allowed carrier list for slotId * Set the allowed carrier list for slotIndex * Require system privileges. In the future we may add this to carrier APIs. * * <p>Requires Permission: Loading @@ -5966,11 +5966,11 @@ public class TelephonyManager { * @hide */ @SystemApi public int setAllowedCarriers(int slotId, List<CarrierIdentifier> carriers) { public int setAllowedCarriers(int slotIndex, List<CarrierIdentifier> carriers) { try { ITelephony service = getITelephony(); if (service != null) { return service.setAllowedCarriers(slotId, carriers); return service.setAllowedCarriers(slotIndex, carriers); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setAllowedCarriers", e); Loading @@ -5981,7 +5981,7 @@ public class TelephonyManager { } /** * Get the allowed carrier list for slotId. * Get the allowed carrier list for slotIndex. * Require system privileges. In the future we may add this to carrier APIs. * * <p>Requires Permission: Loading @@ -5995,11 +5995,11 @@ public class TelephonyManager { * @hide */ @SystemApi public List<CarrierIdentifier> getAllowedCarriers(int slotId) { public List<CarrierIdentifier> getAllowedCarriers(int slotIndex) { try { ITelephony service = getITelephony(); if (service != null) { return service.getAllowedCarriers(slotId); return service.getAllowedCarriers(slotIndex); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#getAllowedCarriers", e); Loading
telephony/java/com/android/internal/telephony/ISub.aidl +9 −9 Original line number Diff line number Diff line Loading @@ -52,12 +52,12 @@ interface ISub { SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId, String callingPackage); /** * Get the active SubscriptionInfo associated with the slotIdx * @param slotIdx the slot which the subscription is inserted * Get the active SubscriptionInfo associated with the slotIndex * @param slotIndex the slot which the subscription is inserted * @param callingPackage The package maing the call. * @return SubscriptionInfo, maybe null if its not active */ SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx, String callingPackage); SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIndex, String callingPackage); /** * Get the SubscriptionInfo(s) of the active subscriptions. The records will be sorted Loading Loading @@ -96,10 +96,10 @@ interface ISub { /** * Add a new SubscriptionInfo to subinfo database if needed * @param iccId the IccId of the SIM card * @param slotId the slot which the SIM is inserted * @param slotIndex the slot which the SIM is inserted * @return the URL of the newly created row or the updated row */ int addSubInfoRecord(String iccId, int slotId); int addSubInfoRecord(String iccId, int slotIndex); /** * Set SIM icon tint color by simInfo index Loading Loading @@ -142,9 +142,9 @@ interface ISub { */ int setDataRoaming(int roaming, int subId); int getSlotId(int subId); int getSlotIndex(int subId); int[] getSubId(int slotId); int[] getSubId(int slotIndex); int getDefaultSubId(); Loading Loading @@ -177,10 +177,10 @@ interface ISub { String getSubscriptionProperty(int subId, String propKey, String callingPackage); /** * Get the SIM state for the slot idx * Get the SIM state for the slot index * @return SIM state as the ordinal of IccCardConstants.State */ int getSimStateForSlotIdx(int slotIdx); int getSimStateForSlotIndex(int slotIndex); boolean isActiveSubId(int subId); }