diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index a9f6dc9052b3a..4c8c0362cbf26 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -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); } @@ -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; diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 199a12ae70df3..bc5e4d51e0f8f 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -1897,7 +1897,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 diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index dd6f9cb157b67..201f3ad5dce70 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -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; } @@ -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) { @@ -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 @@ -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"); } } @@ -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 @@ -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; } @@ -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 @@ -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 */ @@ -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); } @@ -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} @@ -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) { } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index d0eb2f77d1453..a4182383175c1 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -863,15 +863,15 @@ public class TelephonyManager { *
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) { @@ -906,15 +906,15 @@ public class TelephonyManager { *
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) { @@ -941,17 +941,17 @@ public class TelephonyManager { *
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) { @@ -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) @@ -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); } } @@ -1901,17 +1901,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; @@ -1936,31 +1936,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 @@ -1973,8 +1973,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; } @@ -3066,12 +3066,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; @@ -3889,7 +3889,7 @@ public class TelephonyManager { /** {@hide} */ public int getDefaultSim() { - return SubscriptionManager.getSlotId(SubscriptionManager.getDefaultSubscriptionId()); + return SubscriptionManager.getSlotIndex(SubscriptionManager.getDefaultSubscriptionId()); } /** @@ -4254,7 +4254,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. @@ -4262,12 +4262,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()); @@ -5405,7 +5405,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 * *
Requires Permission: @@ -5413,11 +5413,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); @@ -5953,7 +5953,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. * *
Requires Permission:
@@ -5967,11 +5967,11 @@ public class TelephonyManager {
* @hide
*/
@SystemApi
- public int setAllowedCarriers(int slotId, List Requires Permission:
@@ -5996,11 +5996,11 @@ public class TelephonyManager {
* @hide
*/
@SystemApi
- public List Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
- String getImeiForSlot(int slotId, String callingPackage);
+ String getImeiForSlot(int slotIndex, String callingPackage);
/**
* Returns the device software version.
*
- * @param slotId - device slot.
+ * @param slotIndex - device slot.
* @param callingPackage The package making the call.
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
- String getDeviceSoftwareVersionForSlot(int slotId, String callingPackage);
+ String getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage);
/**
* Returns the subscription ID associated with the specified PhoneAccount.
@@ -1167,22 +1167,22 @@ interface ITelephony {
List