Merge "Change 'idx' to 'index' in SubscriptionManager & TelephonyManager apis."

This commit is contained in:
Sanket Padawe
2017-03-22 21:27:21 +00:00
committed by Gerrit Code Review
6 changed files with 103 additions and 103 deletions

View File

@ -1625,7 +1625,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
*/ */
public void reportSimUnlocked(int subId) { public void reportSimUnlocked(int subId) {
if (DEBUG_SIM_STATES) Log.v(TAG, "reportSimUnlocked(subId=" + 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); handleSimStateChange(subId, slotId, State.READY);
} }
@ -1794,7 +1794,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
final SubscriptionInfo info = list.get(i); final SubscriptionInfo info = list.get(i);
final int id = info.getSubscriptionId(); final int id = info.getSubscriptionId();
int slotId = SubscriptionManager.getSlotId(id); int slotId = SubscriptionManager.getSlotIndex(id);
if (state == getSimState(id) && bestSlotId > slotId ) { if (state == getSimState(id) && bestSlotId > slotId ) {
resultId = id; resultId = id;
bestSlotId = slotId; bestSlotId = slotId;

View File

@ -1896,7 +1896,7 @@ public class PhoneNumberUtils
number = extractNetworkPortionAlt(number); number = extractNetworkPortionAlt(number);
String emergencyNumbers = ""; String emergencyNumbers = "";
int slotId = SubscriptionManager.getSlotId(subId); int slotId = SubscriptionManager.getSlotIndex(subId);
// retrieve the list of emergency numbers // retrieve the list of emergency numbers
// check read-write ecclist property first // check read-write ecclist property first

View File

@ -521,14 +521,14 @@ public class SubscriptionManager {
} }
/** /**
* Get the active SubscriptionInfo associated with the slotIdx * Get the active SubscriptionInfo associated with the slotIndex
* @param slotIdx the slot which the subscription is inserted * @param slotIndex the slot which the subscription is inserted
* @return SubscriptionInfo, maybe null if its not active * @return SubscriptionInfo, maybe null if its not active
*/ */
public SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx) { public SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIndex) {
if (VDBG) logd("[getActiveSubscriptionInfoForSimSlotIndex]+ slotIdx=" + slotIdx); if (VDBG) logd("[getActiveSubscriptionInfoForSimSlotIndex]+ slotIndex=" + slotIndex);
if (!isValidSlotId(slotIdx)) { if (!isValidSlotIndex(slotIndex)) {
logd("[getActiveSubscriptionInfoForSimSlotIndex]- invalid slotIdx"); logd("[getActiveSubscriptionInfoForSimSlotIndex]- invalid slotIndex");
return null; return null;
} }
@ -537,7 +537,7 @@ public class SubscriptionManager {
try { try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
if (iSub != null) { if (iSub != null) {
result = iSub.getActiveSubscriptionInfoForSimSlotIndex(slotIdx, result = iSub.getActiveSubscriptionInfoForSimSlotIndex(slotIndex,
mContext.getOpPackageName()); mContext.getOpPackageName());
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
@ -671,24 +671,24 @@ public class SubscriptionManager {
/** /**
* Add a new SubscriptionInfo to SubscriptionInfo database if needed * Add a new SubscriptionInfo to SubscriptionInfo database if needed
* @param iccId the IccId of the SIM card * @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 * @return the URL of the newly created row or the updated row
* @hide * @hide
*/ */
public Uri addSubscriptionInfoRecord(String iccId, int slotId) { public Uri addSubscriptionInfoRecord(String iccId, int slotIndex) {
if (VDBG) logd("[addSubscriptionInfoRecord]+ iccId:" + iccId + " slotId:" + slotId); if (VDBG) logd("[addSubscriptionInfoRecord]+ iccId:" + iccId + " slotIndex:" + slotIndex);
if (iccId == null) { if (iccId == null) {
logd("[addSubscriptionInfoRecord]- null iccId"); logd("[addSubscriptionInfoRecord]- null iccId");
} }
if (!isValidSlotId(slotId)) { if (!isValidSlotIndex(slotIndex)) {
logd("[addSubscriptionInfoRecord]- invalid slotId"); logd("[addSubscriptionInfoRecord]- invalid slotIndex");
} }
try { try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
if (iSub != null) { if (iSub != null) {
// FIXME: This returns 1 on success, 0 on error should should we return it? // 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) { } catch (RemoteException ex) {
// ignore it // ignore it
@ -830,15 +830,15 @@ public class SubscriptionManager {
} }
/** /**
* Get slotId associated with the subscription. * Get slotIndex associated with the subscription.
* @return slotId as a positive integer or a negative value if an error either * @return slotIndex as a positive integer or a negative value if an error either
* SIM_NOT_INSERTED or < 0 if an invalid slot index * SIM_NOT_INSERTED or < 0 if an invalid slot index
* @hide * @hide
*/ */
public static int getSlotId(int subId) { public static int getSlotIndex(int subId) {
if (!isValidSubscriptionId(subId)) { if (!isValidSubscriptionId(subId)) {
if (DBG) { if (DBG) {
logd("[getSlotId]- fail"); logd("[getSlotIndex]- fail");
} }
} }
@ -847,7 +847,7 @@ public class SubscriptionManager {
try { try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
if (iSub != null) { if (iSub != null) {
result = iSub.getSlotId(subId); result = iSub.getSlotIndex(subId);
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
// ignore it // ignore it
@ -858,8 +858,8 @@ public class SubscriptionManager {
} }
/** @hide */ /** @hide */
public static int[] getSubId(int slotId) { public static int[] getSubId(int slotIndex) {
if (!isValidSlotId(slotId)) { if (!isValidSlotIndex(slotIndex)) {
logd("[getSubId]- fail"); logd("[getSubId]- fail");
return null; return null;
} }
@ -869,7 +869,7 @@ public class SubscriptionManager {
try { try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
if (iSub != null) { if (iSub != null) {
subId = iSub.getSubId(slotId); subId = iSub.getSubId(slotIndex);
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
// ignore it // ignore it
@ -1155,8 +1155,8 @@ public class SubscriptionManager {
} }
/** @hide */ /** @hide */
public static boolean isValidSlotId(int slotId) { public static boolean isValidSlotIndex(int slotIndex) {
return slotId >= 0 && slotId < TelephonyManager.getDefault().getSimCount(); return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getSimCount();
} }
/** @hide */ /** @hide */
@ -1179,7 +1179,7 @@ public class SubscriptionManager {
if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId);
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
intent.putExtra(PhoneConstants.PHONE_KEY, phoneId); 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 //Eventually, this should be removed as it is not the slot id
intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); 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_UNKNOWN}
* {@See TelephonyManager#SIM_STATE_ABSENT} * {@See TelephonyManager#SIM_STATE_ABSENT}
@ -1244,13 +1244,13 @@ public class SubscriptionManager {
* *
* {@hide} * {@hide}
*/ */
public static int getSimStateForSlotIdx(int slotIdx) { public static int getSimStateForSlotIndex(int slotIndex) {
int simState = TelephonyManager.SIM_STATE_UNKNOWN; int simState = TelephonyManager.SIM_STATE_UNKNOWN;
try { try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
if (iSub != null) { if (iSub != null) {
simState = iSub.getSimStateForSlotIdx(slotIdx); simState = iSub.getSimStateForSlotIndex(slotIndex);
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
} }

View File

@ -863,15 +863,15 @@ public class TelephonyManager {
* <p>Requires Permission: * <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@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} */ /** {@hide} */
public String getDeviceSoftwareVersion(int slotId) { public String getDeviceSoftwareVersion(int slotIndex) {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony == null) return null; if (telephony == null) return null;
try { try {
return telephony.getDeviceSoftwareVersionForSlot(slotId, getOpPackageName()); return telephony.getDeviceSoftwareVersionForSlot(slotIndex, getOpPackageName());
} catch (RemoteException ex) { } catch (RemoteException ex) {
return null; return null;
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
@ -906,15 +906,15 @@ public class TelephonyManager {
* <p>Requires Permission: * <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@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) { public String getDeviceId(int slotIndex) {
// FIXME this assumes phoneId == slotId // FIXME this assumes phoneId == slotIndex
try { try {
IPhoneSubInfo info = getSubscriberInfo(); IPhoneSubInfo info = getSubscriberInfo();
if (info == null) if (info == null)
return null; return null;
return info.getDeviceIdForPhone(slotId, mContext.getOpPackageName()); return info.getDeviceIdForPhone(slotIndex, mContext.getOpPackageName());
} catch (RemoteException ex) { } catch (RemoteException ex) {
return null; return null;
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
@ -941,17 +941,17 @@ public class TelephonyManager {
* <p>Requires Permission: * <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@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 * @hide
*/ */
@SystemApi @SystemApi
public String getImei(int slotId) { public String getImei(int slotIndex) {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony == null) return null; if (telephony == null) return null;
try { try {
return telephony.getImeiForSlot(slotId, getOpPackageName()); return telephony.getImeiForSlot(slotIndex, getOpPackageName());
} catch (RemoteException ex) { } catch (RemoteException ex) {
return null; return null;
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
@ -971,11 +971,11 @@ public class TelephonyManager {
/** /**
* Returns the NAI. Return null if NAI is not available. * 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}*/ /** {@hide}*/
public String getNai(int slotId) { public String getNai(int slotIndex) {
int[] subId = SubscriptionManager.getSubId(slotId); int[] subId = SubscriptionManager.getSubId(slotIndex);
try { try {
IPhoneSubInfo info = getSubscriberInfo(); IPhoneSubInfo info = getSubscriberInfo();
if (info == null) if (info == null)
@ -1171,23 +1171,23 @@ public class TelephonyManager {
* *
* @hide * @hide
*/ */
public int getCurrentPhoneTypeForSlot(int slotId) { public int getCurrentPhoneTypeForSlot(int slotIndex) {
try{ try{
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
return telephony.getActivePhoneTypeForSlot(slotId); return telephony.getActivePhoneTypeForSlot(slotIndex);
} else { } else {
// This can happen when the ITelephony interface is not up yet. // This can happen when the ITelephony interface is not up yet.
return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex);
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
// This shouldn't happen in the normal case, as a backup we // This shouldn't happen in the normal case, as a backup we
// read from the system property. // read from the system property.
return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex);
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
// This shouldn't happen in the normal case, as a backup we // This shouldn't happen in the normal case, as a backup we
// read from the system property. // read from the system property.
return getPhoneTypeFromProperty(slotId); return getPhoneTypeFromProperty(slotIndex);
} }
} }
@ -1900,17 +1900,17 @@ public class TelephonyManager {
/** /**
* @return true if a ICC card is present for a subscription * @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} */ /** {@hide} */
// FIXME Input argument slotId should be of type int // FIXME Input argument slotIndex should be of type int
public boolean hasIccCard(int slotId) { public boolean hasIccCard(int slotIndex) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony == null) if (telephony == null)
return false; return false;
return telephony.hasIccCardUsingSlotId(slotId); return telephony.hasIccCardUsingSlotIndex(slotIndex);
} catch (RemoteException ex) { } catch (RemoteException ex) {
// Assume no ICC card if remote exception which shouldn't happen // Assume no ICC card if remote exception which shouldn't happen
return false; return false;
@ -1935,31 +1935,31 @@ public class TelephonyManager {
* @see #SIM_STATE_CARD_RESTRICTED * @see #SIM_STATE_CARD_RESTRICTED
*/ */
public int getSimState() { public int getSimState() {
int slotIdx = getDefaultSim(); int slotIndex = getDefaultSim();
// slotIdx may be invalid due to sim being absent. In that case query all slots to get // slotIndex may be invalid due to sim being absent. In that case query all slots to get
// sim state // sim state
if (slotIdx < 0) { if (slotIndex < 0) {
// query for all slots and return absent if all sim states are absent, otherwise // query for all slots and return absent if all sim states are absent, otherwise
// return unknown // return unknown
for (int i = 0; i < getPhoneCount(); i++) { for (int i = 0; i < getPhoneCount(); i++) {
int simState = getSimState(i); int simState = getSimState(i);
if (simState != SIM_STATE_ABSENT) { if (simState != SIM_STATE_ABSENT) {
Rlog.d(TAG, "getSimState: default sim:" + slotIdx + ", sim state for " + Rlog.d(TAG, "getSimState: default sim:" + slotIndex + ", sim state for " +
"slotIdx=" + i + " is " + simState + ", return state as unknown"); "slotIndex=" + i + " is " + simState + ", return state as unknown");
return SIM_STATE_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"); "state as absent");
return SIM_STATE_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. * 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_UNKNOWN
* @see #SIM_STATE_ABSENT * @see #SIM_STATE_ABSENT
@ -1972,8 +1972,8 @@ public class TelephonyManager {
* @see #SIM_STATE_CARD_IO_ERROR * @see #SIM_STATE_CARD_IO_ERROR
* @see #SIM_STATE_CARD_RESTRICTED * @see #SIM_STATE_CARD_RESTRICTED
*/ */
public int getSimState(int slotIdx) { public int getSimState(int slotIndex) {
int simState = SubscriptionManager.getSimStateForSlotIdx(slotIdx); int simState = SubscriptionManager.getSimStateForSlotIndex(slotIndex);
return simState; return simState;
} }
@ -3065,12 +3065,12 @@ public class TelephonyManager {
* *
* @hide * @hide
*/ */
public int getCallStateForSlot(int slotId) { public int getCallStateForSlot(int slotIndex) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony == null) if (telephony == null)
return CALL_STATE_IDLE; return CALL_STATE_IDLE;
return telephony.getCallStateForSlot(slotId); return telephony.getCallStateForSlot(slotIndex);
} catch (RemoteException ex) { } catch (RemoteException ex) {
// the phone process is restarting. // the phone process is restarting.
return CALL_STATE_IDLE; return CALL_STATE_IDLE;
@ -3888,7 +3888,7 @@ public class TelephonyManager {
/** {@hide} */ /** {@hide} */
public int getDefaultSim() { public int getDefaultSim() {
return SubscriptionManager.getSlotId(SubscriptionManager.getDefaultSubscriptionId()); return SubscriptionManager.getSlotIndex(SubscriptionManager.getDefaultSubscriptionId());
} }
/** /**
@ -4253,7 +4253,7 @@ public class TelephonyManager {
* feature or {@link null} if the service is not available. If an ImsServiceController is * 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 * available, the {@link IImsServiceFeatureListener} callback is registered as a listener for
* feature updates. * 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 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 * @param callback Listener that will send updates to ImsManager when there are updates to
* ImsServiceController. * ImsServiceController.
@ -4261,12 +4261,12 @@ public class TelephonyManager {
* it is unavailable. * it is unavailable.
* @hide * @hide
*/ */
public IImsServiceController getImsServiceControllerAndListen(int slotId, @Feature int feature, public IImsServiceController getImsServiceControllerAndListen(int slotIndex, @Feature int feature,
IImsServiceFeatureListener callback) { IImsServiceFeatureListener callback) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
return telephony.getImsServiceControllerAndListen(slotId, feature, callback); return telephony.getImsServiceControllerAndListen(slotIndex, feature, callback);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Rlog.e(TAG, "getImsServiceControllerAndListen, RemoteException: " + e.getMessage()); Rlog.e(TAG, "getImsServiceControllerAndListen, RemoteException: " + e.getMessage());
@ -5404,7 +5404,7 @@ public class TelephonyManager {
/** /**
* Set SIM card power state. Request is equivalent to inserting or removing the card. * 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 * @param powerUp True if powering up the SIM, otherwise powering down
* *
* <p>Requires Permission: * <p>Requires Permission:
@ -5412,11 +5412,11 @@ public class TelephonyManager {
* *
* @hide * @hide
**/ **/
public void setSimPowerStateForSlot(int slotId, boolean powerUp) { public void setSimPowerStateForSlot(int slotIndex, boolean powerUp) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
telephony.setSimPowerStateForSlot(slotId, powerUp); telephony.setSimPowerStateForSlot(slotIndex, powerUp);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#setSimPowerStateForSlot", e); Log.e(TAG, "Error calling ITelephony#setSimPowerStateForSlot", e);
@ -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. * Require system privileges. In the future we may add this to carrier APIs.
* *
* <p>Requires Permission: * <p>Requires Permission:
@ -5966,11 +5966,11 @@ public class TelephonyManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
public int setAllowedCarriers(int slotId, List<CarrierIdentifier> carriers) { public int setAllowedCarriers(int slotIndex, List<CarrierIdentifier> carriers) {
try { try {
ITelephony service = getITelephony(); ITelephony service = getITelephony();
if (service != null) { if (service != null) {
return service.setAllowedCarriers(slotId, carriers); return service.setAllowedCarriers(slotIndex, carriers);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#setAllowedCarriers", e); Log.e(TAG, "Error calling ITelephony#setAllowedCarriers", e);
@ -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. * Require system privileges. In the future we may add this to carrier APIs.
* *
* <p>Requires Permission: * <p>Requires Permission:
@ -5995,11 +5995,11 @@ public class TelephonyManager {
* @hide * @hide
*/ */
@SystemApi @SystemApi
public List<CarrierIdentifier> getAllowedCarriers(int slotId) { public List<CarrierIdentifier> getAllowedCarriers(int slotIndex) {
try { try {
ITelephony service = getITelephony(); ITelephony service = getITelephony();
if (service != null) { if (service != null) {
return service.getAllowedCarriers(slotId); return service.getAllowedCarriers(slotIndex);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#getAllowedCarriers", e); Log.e(TAG, "Error calling ITelephony#getAllowedCarriers", e);

View File

@ -52,12 +52,12 @@ interface ISub {
SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId, String callingPackage); SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId, String callingPackage);
/** /**
* Get the active SubscriptionInfo associated with the slotIdx * Get the active SubscriptionInfo associated with the slotIndex
* @param slotIdx the slot which the subscription is inserted * @param slotIndex the slot which the subscription is inserted
* @param callingPackage The package maing the call. * @param callingPackage The package maing the call.
* @return SubscriptionInfo, maybe null if its not active * @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 * Get the SubscriptionInfo(s) of the active subscriptions. The records will be sorted
@ -96,10 +96,10 @@ interface ISub {
/** /**
* Add a new SubscriptionInfo to subinfo database if needed * Add a new SubscriptionInfo to subinfo database if needed
* @param iccId the IccId of the SIM card * @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 * @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 * Set SIM icon tint color by simInfo index
@ -142,9 +142,9 @@ interface ISub {
*/ */
int setDataRoaming(int roaming, int subId); int setDataRoaming(int roaming, int subId);
int getSlotId(int subId); int getSlotIndex(int subId);
int[] getSubId(int slotId); int[] getSubId(int slotIndex);
int getDefaultSubId(); int getDefaultSubId();
@ -177,10 +177,10 @@ interface ISub {
String getSubscriptionProperty(int subId, String propKey, String callingPackage); 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 * @return SIM state as the ordinal of IccCardConstants.State
*/ */
int getSimStateForSlotIdx(int slotIdx); int getSimStateForSlotIndex(int slotIndex);
boolean isActiveSubId(int subId); boolean isActiveSubId(int subId);
} }

View File

@ -370,7 +370,7 @@ interface ITelephony {
/** /**
* Returns the call state for a slot. * Returns the call state for a slot.
*/ */
int getCallStateForSlot(int slotId); int getCallStateForSlot(int slotIndex);
int getDataActivity(); int getDataActivity();
int getDataState(); int getDataState();
@ -386,9 +386,9 @@ interface ITelephony {
* Returns the current active phone type as integer for particular slot. * Returns the current active phone type as integer for particular slot.
* Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
* and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
* @param slotId - slot to query. * @param slotIndex - slot to query.
*/ */
int getActivePhoneTypeForSlot(int slotId); int getActivePhoneTypeForSlot(int slotIndex);
/** /**
* Returns the CDMA ERI icon index to display * Returns the CDMA ERI icon index to display
@ -542,10 +542,10 @@ interface ITelephony {
/** /**
* Return true if an ICC card is present for a subId. * Return true if an ICC card is present for a subId.
* @param slotId user preferred slotId. * @param slotIndex user preferred slotIndex.
* Return true if an ICC card is present * Return true if an ICC card is present
*/ */
boolean hasIccCardUsingSlotId(int slotId); boolean hasIccCardUsingSlotIndex(int slotIndex);
/** /**
* Return if the current radio is LTE on CDMA. This * Return if the current radio is LTE on CDMA. This
@ -746,7 +746,7 @@ interface ITelephony {
* requested as well as registering the ImsServiceController for callbacks using the * requested as well as registering the ImsServiceController for callbacks using the
* IImsServiceFeatureListener interface. * IImsServiceFeatureListener interface.
*/ */
IImsServiceController getImsServiceControllerAndListen(int slotId, int feature, IImsServiceController getImsServiceControllerAndListen(int slotIndex, int feature,
IImsServiceFeatureListener callback); IImsServiceFeatureListener callback);
/** /**
@ -1054,22 +1054,22 @@ interface ITelephony {
/** /**
* Returns the IMEI for the given slot. * Returns the IMEI for the given slot.
* *
* @param slotId - device slot. * @param slotIndex - device slot.
* @param callingPackage The package making the call. * @param callingPackage The package making the call.
* <p>Requires Permission: * <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@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. * Returns the device software version.
* *
* @param slotId - device slot. * @param slotIndex - device slot.
* @param callingPackage The package making the call. * @param callingPackage The package making the call.
* <p>Requires Permission: * <p>Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@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. * Returns the subscription ID associated with the specified PhoneAccount.
@ -1167,22 +1167,22 @@ interface ITelephony {
List<TelephonyHistogram> getTelephonyHistograms(); List<TelephonyHistogram> getTelephonyHistograms();
/** /**
* 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. * Require system privileges. In the future we may add this to carrier APIs.
* *
* @return The number of carriers set successfully. Should match length of * @return The number of carriers set successfully. Should match length of
* carriers on success. * carriers on success.
*/ */
int setAllowedCarriers(int slotId, in List<CarrierIdentifier> carriers); int setAllowedCarriers(int slotIndex, in List<CarrierIdentifier> carriers);
/** /**
* 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. * Require system privileges. In the future we may add this to carrier APIs.
* *
* @return List of {@link android.service.carrier.CarrierIdentifier}; empty list * @return List of {@link android.service.carrier.CarrierIdentifier}; empty list
* means all carriers are allowed. * means all carriers are allowed.
*/ */
List<CarrierIdentifier> getAllowedCarriers(int slotId); List<CarrierIdentifier> getAllowedCarriers(int slotIndex);
/** /**
* Action set from carrier signalling broadcast receivers to enable/disable metered apns * Action set from carrier signalling broadcast receivers to enable/disable metered apns
@ -1229,11 +1229,11 @@ interface ITelephony {
/** /**
* Set SIM card power state. Request is equivalent to inserting or removing the card. * 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 * @param powerUp True if powering up the SIM, otherwise powering down
* @hide * @hide
* */ * */
void setSimPowerStateForSlot(int slotId, boolean powerUp); void setSimPowerStateForSlot(int slotIndex, boolean powerUp);
/** /**
* Returns a list of Forbidden PLMNs from the specified SIM App * Returns a list of Forbidden PLMNs from the specified SIM App