diff options
Diffstat (limited to 'telephony')
22 files changed, 395 insertions, 256 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 27e9baf..897702d 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -1570,7 +1570,7 @@ public class PhoneNumberUtils * listed in the RIL / SIM, otherwise return false. * @hide */ - public static boolean isEmergencyNumber(long subId, String number) { + public static boolean isEmergencyNumber(int subId, String number) { // Return true only if the specified number *exactly* matches // one of the emergency numbers listed by the RIL / SIM. return isEmergencyNumberInternal(subId, number, true /* useExactMatch */); @@ -1620,7 +1620,7 @@ public class PhoneNumberUtils * same digits as any of those emergency numbers. * @hide */ - public static boolean isPotentialEmergencyNumber(long subId, String number) { + public static boolean isPotentialEmergencyNumber(int subId, String number) { // Check against the emergency numbers listed by the RIL / SIM, // and *don't* require an exact match. return isEmergencyNumberInternal(subId, number, false /* useExactMatch */); @@ -1669,7 +1669,7 @@ public class PhoneNumberUtils * @return true if the number is in the list of emergency numbers * listed in the RIL / sim, otherwise return false. */ - private static boolean isEmergencyNumberInternal(long subId, String number, + private static boolean isEmergencyNumberInternal(int subId, String number, boolean useExactMatch) { return isEmergencyNumberInternal(subId, number, null, useExactMatch); } @@ -1698,7 +1698,7 @@ public class PhoneNumberUtils * otherwise false * @hide */ - public static boolean isEmergencyNumber(long subId, String number, String defaultCountryIso) { + public static boolean isEmergencyNumber(int subId, String number, String defaultCountryIso) { return isEmergencyNumberInternal(subId, number, defaultCountryIso, true /* useExactMatch */); @@ -1750,7 +1750,7 @@ public class PhoneNumberUtils * any of those emergency numbers. * @hide */ - public static boolean isPotentialEmergencyNumber(long subId, String number, + public static boolean isPotentialEmergencyNumber(int subId, String number, String defaultCountryIso) { return isEmergencyNumberInternal(subId, number, defaultCountryIso, @@ -1794,7 +1794,7 @@ public class PhoneNumberUtils * @return true if the number is an emergency number for the specified country. * @hide */ - private static boolean isEmergencyNumberInternal(long subId, String number, + private static boolean isEmergencyNumberInternal(int subId, String number, String defaultCountryIso, boolean useExactMatch) { // If the number passed in is null, just return false: @@ -1911,7 +1911,7 @@ public class PhoneNumberUtils * is currently in. * @hide */ - public static boolean isLocalEmergencyNumber(Context context, long subId, String number) { + public static boolean isLocalEmergencyNumber(Context context, int subId, String number) { return isLocalEmergencyNumberInternal(subId, number, context, true /* useExactMatch */); @@ -1965,7 +1965,7 @@ public class PhoneNumberUtils * * @hide */ - public static boolean isPotentialLocalEmergencyNumber(Context context, long subId, + public static boolean isPotentialLocalEmergencyNumber(Context context, int subId, String number) { return isLocalEmergencyNumberInternal(subId, number, context, @@ -2014,7 +2014,7 @@ public class PhoneNumberUtils * local country, based on the CountryDetector. * @hide */ - private static boolean isLocalEmergencyNumberInternal(long subId, String number, + private static boolean isLocalEmergencyNumberInternal(int subId, String number, Context context, boolean useExactMatch) { String countryIso; @@ -2057,7 +2057,7 @@ public class PhoneNumberUtils * to read the VM number. * @hide */ - public static boolean isVoiceMailNumber(long subId, String number) { + public static boolean isVoiceMailNumber(int subId, String number) { String vmNumber; try { @@ -2796,7 +2796,7 @@ public class PhoneNumberUtils /** * Returns Default voice subscription Id. */ - private static long getDefaultVoiceSubId() { + private static int getDefaultVoiceSubId() { return SubscriptionManager.getDefaultVoiceSubId(); } //==== End of utility methods used only in compareStrictly() ===== diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index ec34ce8..2f1a8da 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -227,7 +227,7 @@ public class PhoneStateListener { * @hide */ /** @hide */ - protected long mSubId = SubscriptionManager.INVALID_SUB_ID; + protected int mSubId = SubscriptionManager.INVALID_SUB_ID; private final Handler mHandler; @@ -252,10 +252,10 @@ public class PhoneStateListener { /** * Create a PhoneStateListener for the Phone using the specified subscription. * This class requires Looper.myLooper() not return null. To supply your - * own non-null Looper use PhoneStateListener(long subId, Looper looper) below. + * own non-null Looper use PhoneStateListener(int subId, Looper looper) below. * @hide */ - public PhoneStateListener(long subId) { + public PhoneStateListener(int subId) { this(subId, Looper.myLooper()); } @@ -264,7 +264,7 @@ public class PhoneStateListener { * and non-null Looper. * @hide */ - public PhoneStateListener(long subId, Looper looper) { + public PhoneStateListener(int subId, Looper looper) { if (DBG) log("ctor: subId=" + subId + " looper=" + looper); mSubId = subId; mHandler = new Handler(looper) { diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 52d0516..8c2a4eb 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -864,4 +864,23 @@ public class ServiceState implements Parcelable { || radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_B || radioTechnology == RIL_RADIO_TECHNOLOGY_EHRPD; } + + /** + * Returns a merged ServiceState consisting of the base SS with voice settings from the + * voice SS. The voice SS is only used if it is IN_SERVICE (otherwise the base SS is returned). + * @hide + * */ + public static ServiceState mergeServiceStates(ServiceState baseSs, ServiceState voiceSs) { + if (voiceSs.mVoiceRegState != STATE_IN_SERVICE) { + return baseSs; + } + + ServiceState newSs = new ServiceState(baseSs); + + // voice overrides + newSs.mVoiceRegState = voiceSs.mVoiceRegState; + newSs.mIsEmergencyOnly = false; // only get here if voice is IN_SERVICE + + return newSs; + } } diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index 3363ca6..17db3fb 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -20,6 +20,7 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.telephony.Rlog; +import android.content.res.Resources; /** * Contains phone signal strength related information. @@ -50,6 +51,11 @@ public class SignalStrength implements Parcelable { //Use int max, as -1 is a valid value in signal strength public static final int INVALID = 0x7FFFFFFF; + private static final int RSRP_THRESH_TYPE_STRICT = 0; + private static final int[] RSRP_THRESH_STRICT = new int[] {-140, -115, -105, -95, -85, -44}; + private static final int[] RSRP_THRESH_LENIENT = new int[] {-140, -128, -118, -108, -98, -44}; + + private int mGsmSignalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5 private int mGsmBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5 private int mCdmaDbm; // This value is the RSSI value @@ -745,12 +751,21 @@ public class SignalStrength implements Parcelable { */ int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1; - if (mLteRsrp > -44) rsrpIconLevel = -1; - else if (mLteRsrp >= -85) rsrpIconLevel = SIGNAL_STRENGTH_GREAT; - else if (mLteRsrp >= -95) rsrpIconLevel = SIGNAL_STRENGTH_GOOD; - else if (mLteRsrp >= -105) rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; - else if (mLteRsrp >= -115) rsrpIconLevel = SIGNAL_STRENGTH_POOR; - else if (mLteRsrp >= -140) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; + int rsrpThreshType = Resources.getSystem().getInteger(com.android.internal.R.integer. + config_LTE_RSRP_threshold_type); + int[] threshRsrp; + if (rsrpThreshType == RSRP_THRESH_TYPE_STRICT) { + threshRsrp = RSRP_THRESH_STRICT; + } else { + threshRsrp = RSRP_THRESH_LENIENT; + } + + if (mLteRsrp > threshRsrp[5]) rsrpIconLevel = -1; + else if (mLteRsrp >= threshRsrp[4]) rsrpIconLevel = SIGNAL_STRENGTH_GREAT; + else if (mLteRsrp >= threshRsrp[3]) rsrpIconLevel = SIGNAL_STRENGTH_GOOD; + else if (mLteRsrp >= threshRsrp[2]) rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; + else if (mLteRsrp >= threshRsrp[1]) rsrpIconLevel = SIGNAL_STRENGTH_POOR; + else if (mLteRsrp >= threshRsrp[0]) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; /* * Values are -200 dB to +300 (SNR*10dB) RS_SNR >= 13.0 dB =>4 bars 4.5 @@ -789,6 +804,7 @@ public class SignalStrength implements Parcelable { else if (mLteSignalStrength >= 8) rssiIconLevel = SIGNAL_STRENGTH_GOOD; else if (mLteSignalStrength >= 5) rssiIconLevel = SIGNAL_STRENGTH_MODERATE; else if (mLteSignalStrength >= 0) rssiIconLevel = SIGNAL_STRENGTH_POOR; + if (DBG) log("getLTELevel - rssi:" + mLteSignalStrength + " rssiIconLevel:" + rssiIconLevel); return rssiIconLevel; diff --git a/telephony/java/android/telephony/SubInfoRecord.java b/telephony/java/android/telephony/SubInfoRecord.java index 10058e2..4a3d67e 100644 --- a/telephony/java/android/telephony/SubInfoRecord.java +++ b/telephony/java/android/telephony/SubInfoRecord.java @@ -22,7 +22,6 @@ import android.os.Parcelable; /** * A Parcelable class for Subscription Information. - * @hide */ public class SubInfoRecord implements Parcelable { @@ -30,7 +29,7 @@ public class SubInfoRecord implements Parcelable { * Subscription Identifier, this is a device unique number * and not an index into an array */ - public long subId; + public int subId; /** The GID for a SIM that maybe associated with this subscription, empty if unknown */ public String iccId; /** @@ -92,7 +91,7 @@ public class SubInfoRecord implements Parcelable { this.mnc = 0; } - public SubInfoRecord(long subId, String iccId, int slotId, String displayName, int nameSource, + public SubInfoRecord(int subId, String iccId, int slotId, String displayName, int nameSource, int color, String number, int displayFormat, int roaming, int[] iconRes, int mcc, int mnc) { this.subId = subId; @@ -137,7 +136,7 @@ public class SubInfoRecord implements Parcelable { public static final Parcelable.Creator<SubInfoRecord> CREATOR = new Parcelable.Creator<SubInfoRecord>() { @Override public SubInfoRecord createFromParcel(Parcel source) { - long subId = source.readLong(); + int subId = source.readInt(); String iccId = source.readString(); int slotId = source.readInt(); String displayName = source.readString(); @@ -163,7 +162,7 @@ public class SubInfoRecord implements Parcelable { @Override public void writeToParcel(Parcel dest, int flags) { - dest.writeLong(subId); + dest.writeInt(subId); dest.writeString(iccId); dest.writeInt(slotId); dest.writeString(displayName); diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index b37a752..edfddc7 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -18,7 +18,6 @@ package android.telephony; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; -import android.annotation.SystemApi; import android.content.Intent; import android.net.Uri; import android.provider.BaseColumns; @@ -38,8 +37,6 @@ import java.util.List; * * The android.Manifest.permission.READ_PHONE_STATE to retrieve the information, except * getActiveSubIdList and getActiveSubIdCount for which no permission is needed. - * - * @hide */ public class SubscriptionManager implements BaseColumns { private static final String LOG_TAG = "SUB"; @@ -47,40 +44,34 @@ public class SubscriptionManager implements BaseColumns { private static final boolean VDBG = false; /** An invalid phone identifier */ - @SystemApi public static final int INVALID_PHONE_ID = -1000; /** Indicates the caller wants the default phone id. */ - @SystemApi public static final int DEFAULT_PHONE_ID = Integer.MAX_VALUE; /** An invalid slot identifier */ - @SystemApi public static final int INVALID_SLOT_ID = -1000; /** Indicates the caller wants the default slot id. */ - @SystemApi + /** @hide */ public static final int DEFAULT_SLOT_ID = Integer.MAX_VALUE; /** Indicates the user should be asked which subscription to use. */ - @SystemApi - public static final long ASK_USER_SUB_ID = -1001; + public static final int ASK_USER_SUB_ID = -1001; /** An invalid subscription identifier */ - @SystemApi - public static final long INVALID_SUB_ID = -1000; + public static final int INVALID_SUB_ID = -1000; /** Indicates the caller wants the default sub id. */ - @SystemApi - public static final long DEFAULT_SUB_ID = Long.MAX_VALUE; + public static final int DEFAULT_SUB_ID = Integer.MAX_VALUE; /** Minimum possible subid that represents a subscription */ /** @hide */ - public static final long MIN_SUB_ID_VALUE = 0; + public static final int MIN_SUB_ID_VALUE = 0; /** Maximum possible subid that represents a subscription */ /** @hide */ - public static final long MAX_SUB_ID_VALUE = DEFAULT_SUB_ID - 1; + public static final int MAX_SUB_ID_VALUE = DEFAULT_SUB_ID - 1; /** @hide */ @@ -125,7 +116,6 @@ public class SubscriptionManager implements BaseColumns { public static final String SIM_ID = "sim_id"; /** SIM is not inserted */ - @SystemApi public static final int SIM_NOT_INSERTED = -1; /** @@ -275,7 +265,7 @@ public class SubscriptionManager implements BaseColumns { * @param subId The unique SubInfoRecord index in database * @return SubInfoRecord, maybe null */ - public static SubInfoRecord getSubInfoForSubscriber(long subId) { + public static SubInfoRecord getSubInfoForSubscriber(int subId) { if (!isValidSubId(subId)) { logd("[getSubInfoForSubscriberx]- invalid subId"); return null; @@ -332,7 +322,6 @@ public class SubscriptionManager implements BaseColumns { * @param slotId the slot which the SIM is inserted * @return SubInfoRecord list, maybe empty but not null */ - @SystemApi public static List<SubInfoRecord> getSubInfoUsingSlotId(int slotId) { // FIXME: Consider never returning null if (!isValidSlotId(slotId)) { @@ -388,7 +377,6 @@ public class SubscriptionManager implements BaseColumns { * Get the SubInfoRecord(s) of the currently inserted SIM(s) * @return Array list of currently inserted SubInfoRecord(s) maybe empty but not null */ - @SystemApi public static List<SubInfoRecord> getActiveSubInfoList() { List<SubInfoRecord> result = null; @@ -482,15 +470,15 @@ public class SubscriptionManager implements BaseColumns { /** * Set SIM color by simInfo index - * @param color the color of the SIM + * @param color the rgb value of color of the SIM * @param subId the unique SubInfoRecord index in database * @return the number of records updated * @hide */ - public static int setColor(int color, long subId) { + public static int setColor(int color, int subId) { if (VDBG) logd("[setColor]+ color:" + color + " subId:" + subId); int size = sSimBackgroundDarkRes.length; - if (!isValidSubId(subId) || color < 0 || color >= size) { + if (!isValidSubId(subId)) { logd("[setColor]- fail"); return -1; } @@ -517,7 +505,7 @@ public class SubscriptionManager implements BaseColumns { * @return the number of records updated * @hide */ - public static int setDisplayName(String displayName, long subId) { + public static int setDisplayName(String displayName, int subId) { return setDisplayName(displayName, subId, NAME_SOURCE_UNDEFINDED); } @@ -530,7 +518,7 @@ public class SubscriptionManager implements BaseColumns { * @return the number of records updated or -1 if invalid subId * @hide */ - public static int setDisplayName(String displayName, long subId, long nameSource) { + public static int setDisplayName(String displayName, int subId, long nameSource) { if (VDBG) { logd("[setDisplayName]+ displayName:" + displayName + " subId:" + subId + " nameSource:" + nameSource); @@ -562,7 +550,7 @@ public class SubscriptionManager implements BaseColumns { * @return the number of records updated * @hide */ - public static int setDisplayNumber(String number, long subId) { + public static int setDisplayNumber(String number, int subId) { if (number == null || !isValidSubId(subId)) { logd("[setDisplayNumber]- fail"); return -1; @@ -590,7 +578,7 @@ public class SubscriptionManager implements BaseColumns { * @return the number of records updated * @hide */ - public static int setDisplayNumberFormat(int format, long subId) { + public static int setDisplayNumberFormat(int format, int subId) { if (VDBG) logd("[setDisplayNumberFormat]+ format:" + format + " subId:" + subId); if (format < 0 || !isValidSubId(subId)) { logd("[setDisplayNumberFormat]- fail, return -1"); @@ -619,7 +607,7 @@ public class SubscriptionManager implements BaseColumns { * @return the number of records updated * @hide */ - public static int setDataRoaming(int roaming, long subId) { + public static int setDataRoaming(int roaming, int subId) { if (VDBG) logd("[setDataRoaming]+ roaming:" + roaming + " subId:" + subId); if (roaming < 0 || !isValidSubId(subId)) { logd("[setDataRoaming]- fail"); @@ -645,8 +633,7 @@ public class SubscriptionManager implements BaseColumns { * @return slotId as a positive integer or a negative value if an error either * SIM_NOT_INSERTED or INVALID_SLOT_ID. */ - @SystemApi - public static int getSlotId(long subId) { + public static int getSlotId(int subId) { if (!isValidSubId(subId)) { logd("[getSlotId]- fail"); } @@ -667,13 +654,13 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static long[] getSubId(int slotId) { + public static int[] getSubId(int slotId) { if (!isValidSlotId(slotId)) { logd("[getSubId]- fail"); return null; } - long[] subId = null; + int[] subId = null; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -688,7 +675,7 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static int getPhoneId(long subId) { + public static int getPhoneId(int subId) { if (!isValidSubId(subId)) { logd("[getPhoneId]- fail"); return INVALID_PHONE_ID; @@ -745,8 +732,8 @@ public class SubscriptionManager implements BaseColumns { * getDefaultDataSubId(). * @hide */ - public static long getDefaultSubId() { - long subId = INVALID_SUB_ID; + public static int getDefaultSubId() { + int subId = INVALID_SUB_ID; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -762,8 +749,8 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static long getDefaultVoiceSubId() { - long subId = INVALID_SUB_ID; + public static int getDefaultVoiceSubId() { + int subId = INVALID_SUB_ID; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -779,7 +766,7 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static void setDefaultVoiceSubId(long subId) { + public static void setDefaultVoiceSubId(int subId) { if (VDBG) logd("setDefaultVoiceSubId sub id = " + subId); try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -804,9 +791,8 @@ public class SubscriptionManager implements BaseColumns { /** * @return subId of the DefaultSms subscription or the value INVALID_SUB_ID if an error. */ - @SystemApi - public static long getDefaultSmsSubId() { - long subId = INVALID_SUB_ID; + public static int getDefaultSmsSubId() { + int subId = INVALID_SUB_ID; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -822,7 +808,7 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static void setDefaultSmsSubId(long subId) { + public static void setDefaultSmsSubId(int subId) { if (VDBG) logd("setDefaultSmsSubId sub id = " + subId); try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -845,8 +831,8 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static long getDefaultDataSubId() { - long subId = INVALID_SUB_ID; + public static int getDefaultDataSubId() { + int subId = INVALID_SUB_ID; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -862,7 +848,7 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static void setDefaultDataSubId(long subId) { + public static void setDefaultDataSubId(int subId) { if (VDBG) logd("setDataSubscription sub id = " + subId); try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -933,8 +919,7 @@ public class SubscriptionManager implements BaseColumns { /** * @return true if a valid subId else false */ - @SystemApi - public static boolean isValidSubId(long subId) { + public static boolean isValidSubId(int subId) { return subId > INVALID_SUB_ID ; } @@ -943,7 +928,7 @@ public class SubscriptionManager implements BaseColumns { * usable subId means its neither a INVALID_SUB_ID nor a DEFAUL_SUB_ID. * @hide */ - public static boolean isUsableSubIdValue(long subId) { + public static boolean isUsableSubIdValue(int subId) { return subId >= MIN_SUB_ID_VALUE && subId <= MAX_SUB_ID_VALUE; } @@ -967,7 +952,7 @@ public class SubscriptionManager implements BaseColumns { /** @hide */ public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId) { - long[] subIds = SubscriptionManager.getSubId(phoneId); + int[] subIds = SubscriptionManager.getSubId(phoneId); if (subIds != null && subIds.length > 0) { putPhoneIdAndSubIdExtra(intent, phoneId, subIds[0]); } else { @@ -976,7 +961,7 @@ public class SubscriptionManager implements BaseColumns { } /** @hide */ - public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId, long subId) { + public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId, int subId) { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.PHONE_KEY, phoneId); @@ -990,8 +975,8 @@ public class SubscriptionManager implements BaseColumns { * is never null but the length maybe 0. * @hide */ - public static long[] getActiveSubIdList() { - long[] subId = null; + public static int[] getActiveSubIdList() { + int[] subId = null; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); @@ -1003,7 +988,7 @@ public class SubscriptionManager implements BaseColumns { } if (subId == null) { - subId = new long[0]; + subId = new int[0]; } return subId; diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index b72a920..0246a2d 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -588,7 +588,7 @@ public class TelephonyManager { /** {@hide} */ public String getDeviceSoftwareVersion(int slotId) { // FIXME methods taking slot id should not use subscription, instead us Uicc directly - long[] subId = SubscriptionManager.getSubId(slotId); + int[] subId = SubscriptionManager.getSubId(slotId); if (subId == null || subId.length == 0) { return null; } @@ -624,7 +624,7 @@ public class TelephonyManager { /** {@hide} */ public String getDeviceId(int slotId) { // FIXME methods taking slot id should not use subscription, instead us Uicc directly - long[] subId = SubscriptionManager.getSubId(slotId); + int[] subId = SubscriptionManager.getSubId(slotId); if (subId == null || subId.length == 0) { return null; } @@ -658,7 +658,7 @@ public class TelephonyManager { */ /** {@hide} */ public String getImei(int slotId) { - long[] subId = SubscriptionManager.getSubId(slotId); + int[] subId = SubscriptionManager.getSubId(slotId); try { return getSubscriberInfo().getImeiForSubscriber(subId[0]); } catch (RemoteException ex) { @@ -669,6 +669,32 @@ public class TelephonyManager { } /** + * Returns the NAI. Return null if NAI is not available. + * + */ + /** {@hide}*/ + public String getNai() { + return getNai(getDefaultSim()); + } + + /** + * Returns the NAI. Return null if NAI is not available. + * + * @param slotId of which Nai is returned + */ + /** {@hide}*/ + public String getNai(int slotId) { + int[] subId = SubscriptionManager.getSubId(slotId); + try { + return getSubscriberInfo().getNaiForSubscriber(subId[0]); + } catch (RemoteException ex) { + return null; + } catch (NullPointerException ex) { + return null; + } + } + + /** * Returns the current location of the device. *<p> * If there is only one radio in the device and that radio has an LTE connection, @@ -722,7 +748,7 @@ public class TelephonyManager { * @param subId for which the location updates are enabled */ /** @hide */ - public void enableLocationUpdates(long subId) { + public void enableLocationUpdates(int subId) { try { getITelephony().enableLocationUpdatesForSubscriber(subId); } catch (RemoteException ex) { @@ -744,7 +770,7 @@ public class TelephonyManager { } /** @hide */ - public void disableLocationUpdates(long subId) { + public void disableLocationUpdates(int subId) { try { getITelephony().disableLocationUpdatesForSubscriber(subId); } catch (RemoteException ex) { @@ -809,7 +835,7 @@ public class TelephonyManager { */ /** {@hide} */ @SystemApi - public int getCurrentPhoneType(long subId) { + public int getCurrentPhoneType(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); try{ ITelephony telephony = getITelephony(); @@ -1021,7 +1047,7 @@ public class TelephonyManager { * @param subId */ /** {@hide} */ - public String getNetworkOperatorName(long subId) { + public String getNetworkOperatorName(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ALPHA, ""); } @@ -1048,7 +1074,7 @@ public class TelephonyManager { * @param subId */ /** {@hide} */ - public String getNetworkOperator(long subId) { + public String getNetworkOperator(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_NUMERIC, ""); } @@ -1072,7 +1098,7 @@ public class TelephonyManager { * @param subId */ /** {@hide} */ - public boolean isNetworkRoaming(long subId) { + public boolean isNetworkRoaming(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); return Boolean.parseBoolean(getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISROAMING, null)); @@ -1101,7 +1127,7 @@ public class TelephonyManager { * @param subId for which Network CountryIso is returned */ /** {@hide} */ - public String getNetworkCountryIso(long subId) { + public String getNetworkCountryIso(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, ""); } @@ -1173,7 +1199,7 @@ public class TelephonyManager { * @see #NETWORK_TYPE_HSPAP */ /** {@hide} */ - public int getNetworkType(long subId) { + public int getNetworkType(int subId) { try { ITelephony telephony = getITelephony(); if (telephony != null) { @@ -1227,7 +1253,7 @@ public class TelephonyManager { * @param subId for which network type is returned */ /** {@hide} */ - public int getDataNetworkType(long subId) { + public int getDataNetworkType(int subId) { try{ ITelephony telephony = getITelephony(); if (telephony != null) { @@ -1259,7 +1285,7 @@ public class TelephonyManager { * */ /** {@hide} */ - public int getVoiceNetworkType(long subId) { + public int getVoiceNetworkType(int subId) { try{ ITelephony telephony = getITelephony(); if (telephony != null) { @@ -1416,7 +1442,7 @@ public class TelephonyManager { */ /** {@hide} */ // FIXME Input argument slotId should be of type int - public boolean hasIccCard(long slotId) { + public boolean hasIccCard(int slotId) { try { return getITelephony().hasIccCardUsingSlotId(slotId); @@ -1461,7 +1487,7 @@ public class TelephonyManager { /** {@hide} */ // FIXME the argument to pass is subId ?? public int getSimState(int slotId) { - long[] subId = SubscriptionManager.getSubId(slotId); + int[] subId = SubscriptionManager.getSubId(slotId); if (subId == null || subId.length == 0) { return SIM_STATE_ABSENT; } @@ -1501,7 +1527,7 @@ public class TelephonyManager { * @see #getSimState */ public String getSimOperator() { - long subId = SubscriptionManager.getDefaultDataSubId(); + int subId = SubscriptionManager.getDefaultDataSubId(); if (!SubscriptionManager.isUsableSubIdValue(subId)) { subId = SubscriptionManager.getDefaultSmsSubId(); if (!SubscriptionManager.isUsableSubIdValue(subId)) { @@ -1526,7 +1552,7 @@ public class TelephonyManager { * @param subId for which SimOperator is returned */ /** {@hide} */ - public String getSimOperator(long subId) { + public String getSimOperator(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); String operator = getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, ""); @@ -1555,7 +1581,7 @@ public class TelephonyManager { * @param subId for which SimOperatorName is returned */ /** {@hide} */ - public String getSimOperatorName(long subId) { + public String getSimOperatorName(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, ""); } @@ -1573,7 +1599,7 @@ public class TelephonyManager { * @param subId for which SimCountryIso is returned */ /** {@hide} */ - public String getSimCountryIso(long subId) { + public String getSimCountryIso(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY, ""); @@ -1599,7 +1625,7 @@ public class TelephonyManager { * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ /** {@hide} */ - public String getSimSerialNumber(long subId) { + public String getSimSerialNumber(int subId) { try { return getSubscriberInfo().getIccSerialNumberForSubscriber(subId); } catch (RemoteException ex) { @@ -1635,7 +1661,7 @@ public class TelephonyManager { * */ /** {@hide} */ - public int getLteOnCdmaMode(long subId) { + public int getLteOnCdmaMode(int subId) { try { return getITelephony().getLteOnCdmaModeForSubscriber(subId); } catch (RemoteException ex) { @@ -1675,7 +1701,7 @@ public class TelephonyManager { * @param subId whose subscriber id is returned */ /** {@hide} */ - public String getSubscriberId(long subId) { + public String getSubscriberId(int subId) { try { return getSubscriberInfo().getSubscriberIdForSubscriber(subId); } catch (RemoteException ex) { @@ -1714,7 +1740,7 @@ public class TelephonyManager { * @param subscription whose subscriber id is returned */ /** {@hide} */ - public String getGroupIdLevel1(long subId) { + public String getGroupIdLevel1(int subId) { try { return getSubscriberInfo().getGroupIdLevel1ForSubscriber(subId); } catch (RemoteException ex) { @@ -1746,7 +1772,7 @@ public class TelephonyManager { * @param subId whose phone number for line 1 is returned */ /** {@hide} */ - public String getLine1NumberForSubscriber(long subId) { + public String getLine1NumberForSubscriber(int subId) { String number = null; try { number = getITelephony().getLine1NumberForDisplay(subId); @@ -1778,7 +1804,6 @@ public class TelephonyManager { * * @param alphaTag alpha-tagging of the dailing nubmer * @param number The dialing number - * @hide */ public void setLine1NumberForDisplay(String alphaTag, String number) { setLine1NumberForDisplayForSubscriber(getDefaultSubscription(), alphaTag, number); @@ -1799,7 +1824,7 @@ public class TelephonyManager { * @param number The dialing number * @hide */ - public void setLine1NumberForDisplayForSubscriber(long subId, String alphaTag, String number) { + public void setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number) { try { getITelephony().setLine1NumberForDisplayForSubscriber(subId, alphaTag, number); } catch (RemoteException ex) { @@ -1831,7 +1856,7 @@ public class TelephonyManager { * nobody seems to call this. */ /** {@hide} */ - public String getLine1AlphaTagForSubscriber(long subId) { + public String getLine1AlphaTagForSubscriber(int subId) { String alphaTag = null; try { alphaTag = getITelephony().getLine1AlphaTagForDisplay(subId); @@ -1874,7 +1899,7 @@ public class TelephonyManager { * @param subId for which msisdn is returned */ /** {@hide} */ - public String getMsisdn(long subId) { + public String getMsisdn(int subId) { try { return getSubscriberInfo().getMsisdnForSubscriber(subId); } catch (RemoteException ex) { @@ -1904,7 +1929,7 @@ public class TelephonyManager { * @param subId whose voice mail number is returned */ /** {@hide} */ - public String getVoiceMailNumber(long subId) { + public String getVoiceMailNumber(int subId) { try { return getSubscriberInfo().getVoiceMailNumberForSubscriber(subId); } catch (RemoteException ex) { @@ -1936,7 +1961,7 @@ public class TelephonyManager { * @param subId */ /** {@hide} */ - public String getCompleteVoiceMailNumber(long subId) { + public String getCompleteVoiceMailNumber(int subId) { try { return getSubscriberInfo().getCompleteVoiceMailNumberForSubscriber(subId); } catch (RemoteException ex) { @@ -1966,7 +1991,7 @@ public class TelephonyManager { * @param subId whose voice message count is returned */ /** {@hide} */ - public int getVoiceMessageCount(long subId) { + public int getVoiceMessageCount(int subId) { try { return getITelephony().getVoiceMessageCountForSubscriber(subId); } catch (RemoteException ex) { @@ -1998,7 +2023,7 @@ public class TelephonyManager { * voice mail number is returned */ /** {@hide} */ - public String getVoiceMailAlphaTag(long subId) { + public String getVoiceMailAlphaTag(int subId) { try { return getSubscriberInfo().getVoiceMailAlphaTagForSubscriber(subId); } catch (RemoteException ex) { @@ -2095,7 +2120,7 @@ public class TelephonyManager { * @param subId whose call state is returned */ /** {@hide} */ - public int getCallState(long subId) { + public int getCallState(int subId) { try { return getITelephony().getCallStateForSubscriber(subId); } catch (RemoteException ex) { @@ -2246,7 +2271,7 @@ public class TelephonyManager { * Returns the CDMA ERI icon index to display for a subscription */ /** {@hide} */ - public int getCdmaEriIconIndex(long subId) { + public int getCdmaEriIconIndex(int subId) { try { return getITelephony().getCdmaEriIconIndexForSubscriber(subId); } catch (RemoteException ex) { @@ -2274,7 +2299,7 @@ public class TelephonyManager { * 1 - FLASHING */ /** {@hide} */ - public int getCdmaEriIconMode(long subId) { + public int getCdmaEriIconMode(int subId) { try { return getITelephony().getCdmaEriIconModeForSubscriber(subId); } catch (RemoteException ex) { @@ -2299,7 +2324,7 @@ public class TelephonyManager { * */ /** {@hide} */ - public String getCdmaEriText(long subId) { + public String getCdmaEriText(int subId) { try { return getITelephony().getCdmaEriTextForSubscriber(subId); } catch (RemoteException ex) { @@ -2423,6 +2448,7 @@ public class TelephonyManager { * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @param AID Application id. See ETSI 102.221 and 101.220. * @return an IccOpenLogicalChannelResponse object. @@ -2443,6 +2469,7 @@ public class TelephonyManager { * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @param channel is the channel id to be closed as retruned by a successful * iccOpenLogicalChannel. @@ -2464,6 +2491,7 @@ public class TelephonyManager { * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @param channel is the channel id to be closed as returned by a successful * iccOpenLogicalChannel. @@ -2495,6 +2523,7 @@ public class TelephonyManager { * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @param cla Class of the APDU command. * @param instruction Instruction of the APDU command. @@ -2522,6 +2551,7 @@ public class TelephonyManager { * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @param fileID * @param command @@ -2547,6 +2577,7 @@ public class TelephonyManager { * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @param content String containing SAT/USAT response in hexadecimal * format starting with command tag. See TS 102 223 for @@ -2665,7 +2696,7 @@ public class TelephonyManager { /** * Returns Default subscription. */ - private static long getDefaultSubscription() { + private static int getDefaultSubscription() { return SubscriptionManager.getDefaultSubId(); } @@ -2907,7 +2938,7 @@ public class TelephonyManager { * @return the response of SIM Authentication, or null if not available * @hide */ - public String getIccSimChallengeResponse(long subId, int appType, String data) { + public String getIccSimChallengeResponse(int subId, int appType, String data) { try { return getSubscriberInfo().getIccSimChallengeResponse(subId, appType, data); } catch (RemoteException ex) { @@ -3011,7 +3042,6 @@ public class TelephonyManager { * Or the calling app has carrier privileges. @see #hasCarrierPrivileges * * @return true on success; false on any failure. - * @hide */ public boolean setGlobalPreferredNetworkType() { return setPreferredNetworkType(RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA); @@ -3019,23 +3049,10 @@ public class TelephonyManager { /** * Values used to return status for hasCarrierPrivileges call. - * @hide */ public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; - /** - * Values used to return status for hasCarrierPrivileges call. - * @hide - */ public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; - /** - * Values used to return status for hasCarrierPrivileges call. - * @hide - */ public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; - /** - * Values used to return status for hasCarrierPrivileges call. - * @hide - */ public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; /** @@ -3052,7 +3069,6 @@ public class TelephonyManager { * CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED if the carrier rules are not loaded. * CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES if there was an error loading carrier * rules (or if there are no rules). - * @hide */ public int hasCarrierPrivileges() { try { @@ -3079,7 +3095,6 @@ public class TelephonyManager { * * @param brand The brand name to display/set. * @return true if the operation was executed correctly. - * @hide */ public boolean setOperatorBrandOverride(String brand) { try { @@ -3104,7 +3119,7 @@ public class TelephonyManager { /** @hide */ @SystemApi - public String getCdmaMdn(long subId) { + public String getCdmaMdn(int subId) { try { return getITelephony().getCdmaMdn(subId); } catch (RemoteException ex) { @@ -3122,7 +3137,7 @@ public class TelephonyManager { /** @hide */ @SystemApi - public String getCdmaMin(long subId) { + public String getCdmaMin(int subId) { try { return getITelephony().getCdmaMin(subId); } catch (RemoteException ex) { @@ -3321,6 +3336,17 @@ public class TelephonyManager { /** @hide */ @SystemApi + public boolean handlePinMmiForSubscriber(int subId, String dialString) { + try { + return getITelephony().handlePinMmiForSubscriber(subId, dialString); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#handlePinMmi", e); + } + return false; + } + + /** @hide */ + @SystemApi public void toggleRadioOnOff() { try { getITelephony().toggleRadioOnOff(); @@ -3453,7 +3479,7 @@ public class TelephonyManager { * @param enable true means enabling the simplified UI. * @hide */ - public void enableSimplifiedNetworkSettingsForSubscriber(long subId, boolean enable) { + public void enableSimplifiedNetworkSettingsForSubscriber(int subId, boolean enable) { try { getITelephony().enableSimplifiedNetworkSettingsForSubscriber(subId, enable); } catch (RemoteException ex) { @@ -3486,7 +3512,7 @@ public class TelephonyManager { * @return true if the simplified UI is enabled. * @hide */ - public boolean getSimplifiedNetworkSettingsEnabledForSubscriber(long subId) { + public boolean getSimplifiedNetworkSettingsEnabledForSubscriber(int subId) { try { return getITelephony().getSimplifiedNetworkSettingsEnabledForSubscriber(subId); } catch (RemoteException ex) { @@ -3513,4 +3539,25 @@ public class TelephonyManager { } return -1; } + + /** @hide */ + @SystemApi + public void enableVideoCalling(boolean enable) { + try { + getITelephony().enableVideoCalling(enable); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#enableVideoCalling", e); + } + } + + /** @hide */ + @SystemApi + public boolean isVideoCallingEnabled() { + try { + return getITelephony().isVideoCallingEnabled(); + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#isVideoCallingEnabled", e); + } + return false; + } } diff --git a/telephony/java/com/android/ims/ImsConferenceState.java b/telephony/java/com/android/ims/ImsConferenceState.java index f708d5b..c57ef98 100644 --- a/telephony/java/com/android/ims/ImsConferenceState.java +++ b/telephony/java/com/android/ims/ImsConferenceState.java @@ -24,6 +24,8 @@ import java.util.Set; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; +import android.telecom.Call; +import android.telecom.Connection; /** * Provides the conference information (defined in RFC 4575) for IMS conference call. @@ -139,4 +141,30 @@ public class ImsConferenceState implements Parcelable { return new ImsConferenceState[size]; } }; + + /** + * Translates an {@code ImsConferenceState} status type to a telecom connection state. + * + * @param status The status type. + * @return The corresponding {@link android.telecom.Connection} state. + */ + public static int getConnectionStateForStatus(String status) { + if (status.equals(STATUS_PENDING)) { + return Connection.STATE_INITIALIZING; + } else if (status.equals(STATUS_DIALING_IN)) { + return Connection.STATE_RINGING; + } else if (status.equals(STATUS_ALERTING) || + status.equals(STATUS_DIALING_OUT)) { + return Connection.STATE_DIALING; + } else if (status.equals(STATUS_ON_HOLD)) { + return Connection.STATE_HOLDING; + } else if (status.equals(STATUS_CONNECTED) || + status.equals(STATUS_MUTED_VIA_FOCUS) || + status.equals(STATUS_DISCONNECTING)) { + return Connection.STATE_ACTIVE; + } else if (status.equals(STATUS_DISCONNECTED)) { + return Connection.STATE_DISCONNECTED; + } + return Call.STATE_ACTIVE; + } } diff --git a/telephony/java/com/android/ims/internal/IImsCallSession.aidl b/telephony/java/com/android/ims/internal/IImsCallSession.aidl index 98b2d8a..16b0cd5 100644 --- a/telephony/java/com/android/ims/internal/IImsCallSession.aidl +++ b/telephony/java/com/android/ims/internal/IImsCallSession.aidl @@ -160,10 +160,13 @@ interface IImsCallSession { void resume(in ImsStreamMediaProfile profile); /** - * Merges the active & hold call. When it succeeds, {@link Listener#callSessionMerged} - * is called. + * Merges the active & hold call. When the merge starts, + * {@link Listener#callSessionMergeStarted} is called. + * {@link Listener#callSessionMergeComplete} is called if the merge is successful, and + * {@link Listener#callSessionMergeFailed} is called if the merge fails. * - * @see Listener#callSessionMerged, Listener#callSessionMergeFailed + * @see Listener#callSessionMergeStarted, Listener#callSessionMergeComplete, + * Listener#callSessionMergeFailed */ void merge(); @@ -225,4 +228,10 @@ interface IImsCallSession { * intermediates between the propriety implementation and Telecomm/InCall. */ IImsVideoCallProvider getVideoCallProvider(); + + /** + * Determines if the current session is multiparty. + * @return {@code True} if the session is multiparty. + */ + boolean isMultiparty(); } diff --git a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl index acd1eb9..84d1c545 100644 --- a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl @@ -48,10 +48,11 @@ interface IImsCallSessionListener { void callSessionResumeReceived(in IImsCallSession session, in ImsCallProfile profile); /** - * Notifiies the result of call merge operation. + * Notifies the result of call merge operation. */ - void callSessionMerged(in IImsCallSession session, + void callSessionMergeStarted(in IImsCallSession session, in IImsCallSession newSession, in ImsCallProfile profile); + void callSessionMergeComplete(in IImsCallSession session); void callSessionMergeFailed(in IImsCallSession session, in ImsReasonInfo reasonInfo); @@ -104,4 +105,14 @@ interface IImsCallSessionListener { in int srcAccessTech, in int targetAccessTech, in ImsReasonInfo reasonInfo); void callSessionHandoverFailed(in IImsCallSession session, in int srcAccessTech, in int targetAccessTech, in ImsReasonInfo reasonInfo); + + /** + * Notifies the TTY mode change by remote party. + * @param mode one of the following: + * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} + * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} + * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} + * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} + */ + void callSessionTtyModeReceived(in IImsCallSession session, in int mode); } diff --git a/telephony/java/com/android/ims/internal/IImsConfig.aidl b/telephony/java/com/android/ims/internal/IImsConfig.aidl index e8d921e..c5ccf5f 100644 --- a/telephony/java/com/android/ims/internal/IImsConfig.aidl +++ b/telephony/java/com/android/ims/internal/IImsConfig.aidl @@ -73,9 +73,9 @@ interface IImsConfig { * * @param item, as defined in com.android.ims.ImsConfig#ConfigConstants. * @param value in Integer format. - * @return void. + * @return as defined in com.android.ims.ImsConfig#OperationStatusConstants. */ - void setProvisionedValue(int item, int value); + int setProvisionedValue(int item, int value); /** * Sets the value for IMS service/capabilities parameters by the operator device @@ -84,9 +84,9 @@ interface IImsConfig { * * @param item, as defined in com.android.ims.ImsConfig#ConfigConstants. * @param value in String format. - * @return void. + * @return as defined in com.android.ims.ImsConfig#OperationStatusConstants. */ - void setProvisionedStringValue(int item, String value); + int setProvisionedStringValue(int item, String value); /** * Gets the value of the specified IMS feature item for specified network type. diff --git a/telephony/java/com/android/ims/internal/IImsService.aidl b/telephony/java/com/android/ims/internal/IImsService.aidl index 5138305..b9cee42 100644 --- a/telephony/java/com/android/ims/internal/IImsService.aidl +++ b/telephony/java/com/android/ims/internal/IImsService.aidl @@ -26,6 +26,8 @@ import com.android.ims.internal.IImsEcbm; import com.android.ims.internal.IImsUt; import com.android.ims.internal.IImsConfig; +import android.os.Message; + /** * {@hide} */ @@ -64,10 +66,13 @@ interface IImsService { */ void turnOffIms(); - /** * ECBM interface for Emergency Callback mode mechanism. */ IImsEcbm getEcbmInterface(int serviceId); + /** + * Used to set current TTY Mode. + */ + void setUiTTYMode(int serviceId, int uiTtyMode, in Message onComplete); } diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java index 88e5bd6..5cd5d4e 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfo.java +++ b/telephony/java/com/android/internal/telephony/CallerInfo.java @@ -301,7 +301,7 @@ public class CallerInfo { public static CallerInfo getCallerInfo(Context context, String number) { if (VDBG) Rlog.v(TAG, "getCallerInfo() based on number..."); - long subId = SubscriptionManager.getDefaultSubId(); + int subId = SubscriptionManager.getDefaultSubId(); return getCallerInfo(context, number, subId); } @@ -316,7 +316,7 @@ public class CallerInfo { * a matching number is not found, then a generic caller info is returned, * with all relevant fields empty or null. */ - public static CallerInfo getCallerInfo(Context context, String number, long subId) { + public static CallerInfo getCallerInfo(Context context, String number, int subId) { if (TextUtils.isEmpty(number)) { return null; @@ -418,12 +418,12 @@ public class CallerInfo { // string in the phone number field. /* package */ CallerInfo markAsVoiceMail() { - long subId = SubscriptionManager.getDefaultSubId(); + int subId = SubscriptionManager.getDefaultSubId(); return markAsVoiceMail(subId); } - /* package */ CallerInfo markAsVoiceMail(long subId) { + /* package */ CallerInfo markAsVoiceMail(int subId) { mIsVoiceMail = true; try { diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java index 0d18389..aae7617 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java +++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java @@ -81,7 +81,7 @@ public class CallerInfoAsyncQuery { public int event; public String number; - public long subId; + public int subId; } @@ -388,7 +388,7 @@ public class CallerInfoAsyncQuery { public static CallerInfoAsyncQuery startQuery(int token, Context context, String number, OnQueryCompleteListener listener, Object cookie) { - long subId = SubscriptionManager.getDefaultSubId(); + int subId = SubscriptionManager.getDefaultSubId(); return startQuery(token, context, number, listener, cookie, subId); } @@ -404,7 +404,7 @@ public class CallerInfoAsyncQuery { * the phone type of the incoming connection. */ public static CallerInfoAsyncQuery startQuery(int token, Context context, String number, - OnQueryCompleteListener listener, Object cookie, long subId) { + OnQueryCompleteListener listener, Object cookie, int subId) { if (DBG) { Rlog.d(LOG_TAG, "##### CallerInfoAsyncQuery startQuery()... #####"); diff --git a/telephony/java/com/android/internal/telephony/DcParamObject.java b/telephony/java/com/android/internal/telephony/DcParamObject.java index c92988f..139939c 100644 --- a/telephony/java/com/android/internal/telephony/DcParamObject.java +++ b/telephony/java/com/android/internal/telephony/DcParamObject.java @@ -21,9 +21,9 @@ import android.os.Parcel; public class DcParamObject implements Parcelable { - private long mSubId; + private int mSubId; - public DcParamObject(long subId) { + public DcParamObject(int subId) { mSubId = subId; } @@ -40,7 +40,7 @@ public class DcParamObject implements Parcelable { } private void readFromParcel(Parcel in) { - mSubId = in.readLong(); + mSubId = in.readInt(); } public static final Parcelable.Creator<DcParamObject> CREATOR = new Parcelable.Creator<DcParamObject>() { @@ -52,7 +52,7 @@ public class DcParamObject implements Parcelable { } }; - public long getSubId() { + public int getSubId() { return mSubId; } } diff --git a/telephony/java/com/android/internal/telephony/IMms.aidl b/telephony/java/com/android/internal/telephony/IMms.aidl index ebfefd1..0322499 100644 --- a/telephony/java/com/android/internal/telephony/IMms.aidl +++ b/telephony/java/com/android/internal/telephony/IMms.aidl @@ -39,7 +39,7 @@ interface IMms { * @param sentIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is successfully sent, or failed */ - void sendMessage(long subId, String callingPkg, in Uri contentUri, + void sendMessage(int subId, String callingPkg, in Uri contentUri, String locationUrl, in Bundle configOverrides, in PendingIntent sentIntent); /** @@ -56,7 +56,7 @@ interface IMms { * @param downloadedIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is downloaded, or the download is failed */ - void downloadMessage(long subId, String callingPkg, String locationUrl, + void downloadMessage(int subId, String callingPkg, String locationUrl, in Uri contentUri, in Bundle configOverrides, in PendingIntent downloadedIntent); @@ -99,7 +99,7 @@ interface IMms { * * @param subId the SIM id */ - Bundle getCarrierConfigValues(long subId); + Bundle getCarrierConfigValues(int subId); /** * Import a text message into system's SMS store @@ -204,7 +204,7 @@ interface IMms { * @param sentIntent if not NULL this <code>PendingIntent</code> is * broadcast when the message is successfully sent, or failed */ - void sendStoredMessage(long subId, String callingPkg, in Uri messageUri, + void sendStoredMessage(int subId, String callingPkg, in Uri messageUri, in Bundle configOverrides, in PendingIntent sentIntent); /** diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl index d706203..eec5333 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl @@ -27,16 +27,21 @@ interface IPhoneSubInfo { */ String getDeviceId(); + /** + * Retrieves the unique Network Access ID + */ + String getNaiForSubscriber(int subId); + /** * Retrieves the unique device ID of a subId for the device, e.g., IMEI * for GSM phones. */ - String getDeviceIdForSubscriber(long subId); + String getDeviceIdForSubscriber(int subId); /** * Retrieves the IMEI. */ - String getImeiForSubscriber(long subId); + String getImeiForSubscriber(int subId); /** * Retrieves the software version number for the device, e.g., IMEI/SV @@ -48,7 +53,7 @@ interface IPhoneSubInfo { * Retrieves the software version number of a subId for the device, e.g., IMEI/SV * for GSM phones. */ - String getDeviceSvnUsingSubId(long subId); + String getDeviceSvnUsingSubId(int subId); /** * Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones. @@ -58,7 +63,7 @@ interface IPhoneSubInfo { /** * Retrieves the unique subscriber ID of a given subId, e.g., IMSI for GSM phones. */ - String getSubscriberIdForSubscriber(long subId); + String getSubscriberIdForSubscriber(int subId); /** * Retrieves the Group Identifier Level1 for GSM phones. @@ -68,7 +73,7 @@ interface IPhoneSubInfo { /** * Retrieves the Group Identifier Level1 for GSM phones of a subId. */ - String getGroupIdLevel1ForSubscriber(long subId); + String getGroupIdLevel1ForSubscriber(int subId); /** * Retrieves the serial number of the ICC, if applicable. @@ -78,7 +83,7 @@ interface IPhoneSubInfo { /** * Retrieves the serial number of a given subId. */ - String getIccSerialNumberForSubscriber(long subId); + String getIccSerialNumberForSubscriber(int subId); /** * Retrieves the phone number string for line 1. @@ -88,7 +93,7 @@ interface IPhoneSubInfo { /** * Retrieves the phone number string for line 1 of a subcription. */ - String getLine1NumberForSubscriber(long subId); + String getLine1NumberForSubscriber(int subId); /** @@ -99,7 +104,7 @@ interface IPhoneSubInfo { /** * Retrieves the alpha identifier for line 1 of a subId. */ - String getLine1AlphaTagForSubscriber(long subId); + String getLine1AlphaTagForSubscriber(int subId); /** @@ -110,7 +115,7 @@ interface IPhoneSubInfo { /** * Retrieves the Msisdn of a subId. */ - String getMsisdnForSubscriber(long subId); + String getMsisdnForSubscriber(int subId); /** * Retrieves the voice mail number. @@ -120,7 +125,7 @@ interface IPhoneSubInfo { /** * Retrieves the voice mail number of a given subId. */ - String getVoiceMailNumberForSubscriber(long subId); + String getVoiceMailNumberForSubscriber(int subId); /** * Retrieves the complete voice mail number. @@ -130,7 +135,7 @@ interface IPhoneSubInfo { /** * Retrieves the complete voice mail number for particular subId */ - String getCompleteVoiceMailNumberForSubscriber(long subId); + String getCompleteVoiceMailNumberForSubscriber(int subId); /** * Retrieves the alpha identifier associated with the voice mail number. @@ -141,7 +146,7 @@ interface IPhoneSubInfo { * Retrieves the alpha identifier associated with the voice mail number * of a subId. */ - String getVoiceMailAlphaTagForSubscriber(long subId); + String getVoiceMailAlphaTagForSubscriber(int subId); /** * Returns the IMS private user identity (IMPI) that was loaded from the ISIM. @@ -194,5 +199,5 @@ interface IPhoneSubInfo { * @param data authentication challenge data * @return challenge response */ - String getIccSimChallengeResponse(long subId, int appType, String data); + String getIccSimChallengeResponse(int subId, int appType, String data); } diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index 32bb8b4..560af45 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -47,7 +47,7 @@ interface ISms { * @param subId the subId id. * @return list of SmsRawData of all sms on ICC */ - List<SmsRawData> getAllMessagesFromIccEfForSubscriber(in long subId, String callingPkg); + List<SmsRawData> getAllMessagesFromIccEfForSubscriber(in int subId, String callingPkg); /** * Update the specified message on the ICC. @@ -75,7 +75,7 @@ interface ISms { * @return success or not * */ - boolean updateMessageOnIccEfForSubscriber(in long subId, String callingPkg, + boolean updateMessageOnIccEfForSubscriber(in int subId, String callingPkg, int messageIndex, int newStatus, in byte[] pdu); /** @@ -99,7 +99,7 @@ interface ISms { * @return success or not * */ - boolean copyMessageToIccEfForSubscriber(in long subId, String callingPkg, int status, + boolean copyMessageToIccEfForSubscriber(in int subId, String callingPkg, int status, in byte[] pdu, in byte[] smsc); /** @@ -152,7 +152,7 @@ interface ISms { * raw pdu of the status report is in the extended data ("pdu"). * @param subId the subId id. */ - void sendDataForSubscriber(long subId, String callingPkg, in String destAddr, + void sendDataForSubscriber(int subId, String callingPkg, in String destAddr, in String scAddr, in int destPort, in byte[] data, in PendingIntent sentIntent, in PendingIntent deliveryIntent); @@ -206,7 +206,7 @@ interface ISms { * raw pdu of the status report is in the extended data ("pdu"). * @param subId the subId on which the SMS has to be sent. */ - void sendTextForSubscriber(in long subId, String callingPkg, in String destAddr, + void sendTextForSubscriber(in int subId, String callingPkg, in String destAddr, in String scAddr, in String text, in PendingIntent sentIntent, in PendingIntent deliveryIntent); @@ -283,7 +283,7 @@ interface ISms { * extended data ("pdu"). * @param subId the subId on which the SMS has to be sent. */ - void sendMultipartTextForSubscriber(in long subId, String callingPkg, + void sendMultipartTextForSubscriber(in int subId, String callingPkg, in String destinationAddress, in String scAddress, in List<String> parts, in List<PendingIntent> sentIntents, in List<PendingIntent> deliveryIntents); @@ -315,7 +315,7 @@ interface ISms { * * @see #disableCellBroadcast(int) */ - boolean enableCellBroadcastForSubscriber(in long subId, int messageIdentifier); + boolean enableCellBroadcastForSubscriber(in int subId, int messageIdentifier); /** * Disable reception of cell broadcast (SMS-CB) messages with the given @@ -344,7 +344,7 @@ interface ISms { * * @see #enableCellBroadcast(int) */ - boolean disableCellBroadcastForSubscriber(in long subId, int messageIdentifier); + boolean disableCellBroadcastForSubscriber(in int subId, int messageIdentifier); /* * Enable reception of cell broadcast (SMS-CB) messages with the given @@ -377,7 +377,7 @@ interface ISms { * * @see #disableCellBroadcastRange(int, int) */ - boolean enableCellBroadcastRangeForSubscriber(long subId, int startMessageId, int endMessageId); + boolean enableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId); /** * Disable reception of cell broadcast (SMS-CB) messages with the given @@ -410,7 +410,7 @@ interface ISms { * * @see #enableCellBroadcastRange(int, int, int) */ - boolean disableCellBroadcastRangeForSubscriber(long subId, int startMessageId, + boolean disableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId); /** @@ -423,7 +423,7 @@ interface ISms { * Returns the premium SMS send permission for the specified package. * Requires system permission. */ - int getPremiumSmsPermissionForSubscriber(long subId, String packageName); + int getPremiumSmsPermissionForSubscriber(int subId, String packageName); /** * Set the SMS send permission for the specified package. @@ -439,7 +439,7 @@ interface ISms { * Set the SMS send permission for the specified package. * Requires system permission. */ - void setPremiumSmsPermissionForSubscriber(long subId, String packageName, int permission); + void setPremiumSmsPermissionForSubscriber(int subId, String packageName, int permission); /** * SMS over IMS is supported if IMS is registered and SMS is supported @@ -459,13 +459,13 @@ interface ISms { * * @see #getImsSmsFormat() */ - boolean isImsSmsSupportedForSubscriber(long subId); + boolean isImsSmsSupportedForSubscriber(int subId); /* * get user prefered SMS subId * @return subId id */ - long getPreferredSmsSubscription(); + int getPreferredSmsSubscription(); /** * Gets SMS format supported on IMS. SMS over IMS format is @@ -489,7 +489,7 @@ interface ISms { * * @see #isImsSmsSupported() */ - String getImsSmsFormatForSubscriber(long subId); + String getImsSmsFormatForSubscriber(int subId); /* * Get SMS prompt property, enabled or not @@ -524,7 +524,7 @@ interface ISms { * broadcast when the message is delivered to the recipient. The * raw pdu of the status report is in the extended data ("pdu"). */ - void sendStoredText(long subId, String callingPkg, in Uri messageUri, String scAddress, + void sendStoredText(int subId, String callingPkg, in Uri messageUri, String scAddress, in PendingIntent sentIntent, in PendingIntent deliveryIntent); /** @@ -560,7 +560,7 @@ interface ISms { * to the recipient. The raw pdu of the status report is in the * extended data ("pdu"). */ - void sendStoredMultipartText(long subId, String callingPkg, in Uri messageUri, + void sendStoredMultipartText(int subId, String callingPkg, in Uri messageUri, String scAddress, in List<PendingIntent> sentIntents, in List<PendingIntent> deliveryIntents); } diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index b87365e..daf850e 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -25,7 +25,7 @@ interface ISub { * @param subId The unique SubInfoRecord index in database * @return SubInfoRecord, maybe null */ - SubInfoRecord getSubInfoForSubscriber(long subId); + SubInfoRecord getSubInfoForSubscriber(int subId); /** * Get the SubInfoRecord according to an IccId @@ -79,7 +79,7 @@ interface ISub { * @param subId the unique SubInfoRecord index in database * @return the number of records updated */ - int setColor(int color, long subId); + int setColor(int color, int subId); /** * Set display name by simInfo index @@ -87,7 +87,7 @@ interface ISub { * @param subId the unique SubInfoRecord index in database * @return the number of records updated */ - int setDisplayName(String displayName, long subId); + int setDisplayName(String displayName, int subId); /** * Set display name by simInfo index with name source @@ -96,7 +96,7 @@ interface ISub { * @param nameSource, 0: DEFAULT_SOURCE, 1: SIM_SOURCE, 2: USER_INPUT * @return the number of records updated */ - int setDisplayNameUsingSrc(String displayName, long subId, long nameSource); + int setDisplayNameUsingSrc(String displayName, int subId, long nameSource); /** * Set phone number by subId @@ -104,7 +104,7 @@ interface ISub { * @param subId the unique SubInfoRecord index in database * @return the number of records updated */ - int setDisplayNumber(String number, long subId); + int setDisplayNumber(String number, int subId); /** * Set number display format. 0: none, 1: the first four digits, 2: the last four digits @@ -112,7 +112,7 @@ interface ISub { * @param subId the unique SubInfoRecord index in database * @return the number of records updated */ - int setDisplayNumberFormat(int format, long subId); + int setDisplayNumberFormat(int format, int subId); /** * Set data roaming by simInfo index @@ -120,35 +120,35 @@ interface ISub { * @param subId the unique SubInfoRecord index in database * @return the number of records updated */ - int setDataRoaming(int roaming, long subId); + int setDataRoaming(int roaming, int subId); - int getSlotId(long subId); + int getSlotId(int subId); - long[] getSubId(int slotId); + int[] getSubId(int slotId); - long getDefaultSubId(); + int getDefaultSubId(); int clearSubInfo(); - int getPhoneId(long subId); + int getPhoneId(int subId); /** * Get the default data subscription * @return Id of the data subscription */ - long getDefaultDataSubId(); + int getDefaultDataSubId(); - void setDefaultDataSubId(long subId); + void setDefaultDataSubId(int subId); - long getDefaultVoiceSubId(); + int getDefaultVoiceSubId(); - void setDefaultVoiceSubId(long subId); + void setDefaultVoiceSubId(int subId); - long getDefaultSmsSubId(); + int getDefaultSmsSubId(); - void setDefaultSmsSubId(long subId); + void setDefaultSmsSubId(int subId); void clearDefaultsForInactiveSubIds(); - long[] getActiveSubIdList(); + int[] getActiveSubIdList(); } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 58807b2..13f0e3f 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -28,7 +28,7 @@ import java.util.List; /** * Interface used to interact with the phone. Mostly this is used by the * TelephonyManager class. A few places are still using this directly. - * Please clean them up if possible and use TelephonyManager insteadl. + * Please clean them up if possible and use TelephonyManager instead. * * {@hide} */ @@ -60,7 +60,7 @@ interface ITelephony { * @param subId user preferred subId. * @return whether it hung up */ - boolean endCallForSubscriber(long subId); + boolean endCallForSubscriber(int subId); /** * Answer the currently-ringing call. @@ -94,7 +94,7 @@ interface ITelephony { * TODO: this should be a oneway call (especially since it's called * directly from the key queue thread). */ - void answerRingingCallForSubscriber(long subId); + void answerRingingCallForSubscriber(int subId); /** * Silence the ringer if an incoming call is currently ringing. @@ -121,7 +121,7 @@ interface ITelephony { * @param subId user preferred subId. * @return true if the phone state is OFFHOOK. */ - boolean isOffhookForSubscriber(long subId); + boolean isOffhookForSubscriber(int subId); /** * Check if an incoming phone call is ringing or call waiting @@ -130,7 +130,7 @@ interface ITelephony { * @param subId user preferred subId. * @return true if the phone state is RINGING. */ - boolean isRingingForSubscriber(long subId); + boolean isRingingForSubscriber(int subId); /** * Check if an incoming phone call is ringing or call waiting. @@ -150,7 +150,7 @@ interface ITelephony { * @param subId user preferred subId. * @return true if the phone state is IDLE. */ - boolean isIdleForSubscriber(long subId); + boolean isIdleForSubscriber(int subId); /** * Check to see if the radio is on or not. @@ -163,7 +163,7 @@ interface ITelephony { * @param subId user preferred subId. * @return returns true if the radio is on. */ - boolean isRadioOnForSubscriber(long subId); + boolean isRadioOnForSubscriber(int subId); /** * Check if the SIM pin lock is enabled. @@ -185,7 +185,7 @@ interface ITelephony { * @param subId user preferred subId. * @return whether the operation was a success. */ - boolean supplyPinForSubscriber(long subId, String pin); + boolean supplyPinForSubscriber(int subId, String pin); /** * Supply puk to unlock the SIM and set SIM pin to new pin. @@ -204,7 +204,7 @@ interface ITelephony { * @param subId user preferred subId. * @return whether the operation was a success. */ - boolean supplyPukForSubscriber(long subId, String puk, String pin); + boolean supplyPukForSubscriber(int subId, String puk, String pin); /** * Supply a pin to unlock the SIM. Blocks until a result is determined. @@ -222,7 +222,7 @@ interface ITelephony { * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code * retValue[1] = number of attempts remaining if known otherwise -1 */ - int[] supplyPinReportResultForSubscriber(long subId, String pin); + int[] supplyPinReportResultForSubscriber(int subId, String pin); /** * Supply puk to unlock the SIM and set SIM pin to new pin. @@ -244,7 +244,7 @@ interface ITelephony { * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code * retValue[1] = number of attempts remaining if known otherwise -1 */ - int[] supplyPukReportResultForSubscriber(long subId, String puk, String pin); + int[] supplyPukReportResultForSubscriber(int subId, String puk, String pin); /** * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated @@ -263,7 +263,7 @@ interface ITelephony { * @param subId user preferred subId. * @return true if MMI command is executed. */ - boolean handlePinMmiForSubscriber(long subId, String dialString); + boolean handlePinMmiForSubscriber(int subId, String dialString); /** * Toggles the radio on or off. @@ -274,7 +274,7 @@ interface ITelephony { * Toggles the radio on or off on particular subId. * @param subId user preferred subId. */ - void toggleRadioOnOffForSubscriber(long subId); + void toggleRadioOnOffForSubscriber(int subId); /** * Set the radio to on or off @@ -285,7 +285,7 @@ interface ITelephony { * Set the radio to on or off on particular subId. * @param subId user preferred subId. */ - boolean setRadioForSubscriber(long subId, boolean turnOn); + boolean setRadioForSubscriber(int subId, boolean turnOn); /** * Set the radio to on or off unconditionally @@ -301,7 +301,7 @@ interface ITelephony { * Request to update location information for a subscrition in service state * @param subId user preferred subId. */ - void updateServiceLocationForSubscriber(long subId); + void updateServiceLocationForSubscriber(int subId); /** * Enable location update notifications. @@ -312,7 +312,7 @@ interface ITelephony { * Enable location update notifications. * @param subId user preferred subId. */ - void enableLocationUpdatesForSubscriber(long subId); + void enableLocationUpdatesForSubscriber(int subId); /** * Disable location update notifications. @@ -323,7 +323,7 @@ interface ITelephony { * Disable location update notifications. * @param subId user preferred subId. */ - void disableLocationUpdatesForSubscriber(long subId); + void disableLocationUpdatesForSubscriber(int subId); /** * Allow mobile data connections. @@ -352,7 +352,7 @@ interface ITelephony { /** * Returns the call state for a subId. */ - int getCallStateForSubscriber(long subId); + int getCallStateForSubscriber(int subId); int getDataActivity(); int getDataState(); @@ -370,7 +370,7 @@ interface ITelephony { * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE * @param subId user preferred subId. */ - int getActivePhoneTypeForSubscriber(long subId); + int getActivePhoneTypeForSubscriber(int subId); /** * Returns the CDMA ERI icon index to display @@ -381,7 +381,7 @@ interface ITelephony { * Returns the CDMA ERI icon index to display on particular subId. * @param subId user preferred subId. */ - int getCdmaEriIconIndexForSubscriber(long subId); + int getCdmaEriIconIndexForSubscriber(int subId); /** * Returns the CDMA ERI icon mode, @@ -396,7 +396,7 @@ interface ITelephony { * 1 - FLASHING * @param subId user preferred subId. */ - int getCdmaEriIconModeForSubscriber(long subId); + int getCdmaEriIconModeForSubscriber(int subId); /** * Returns the CDMA ERI text, @@ -407,7 +407,7 @@ interface ITelephony { * Returns the CDMA ERI text for particular subId, * @param subId user preferred subId. */ - String getCdmaEriTextForSubscriber(long subId); + String getCdmaEriTextForSubscriber(int subId); /** * Returns true if OTA service provisioning needs to run. @@ -426,7 +426,7 @@ interface ITelephony { * @param subId user preferred subId. * Returns the unread count of voicemails */ - int getVoiceMessageCountForSubscriber(long subId); + int getVoiceMessageCountForSubscriber(int subId); /** * Returns the network type for data transmission @@ -438,7 +438,7 @@ interface ITelephony { * @param subId user preferred subId. * Returns the network type */ - int getNetworkTypeForSubscriber(long subId); + int getNetworkTypeForSubscriber(int subId); /** * Returns the network type for data transmission @@ -450,7 +450,7 @@ interface ITelephony { * @param subId user preferred subId. * Returns the network type */ - int getDataNetworkTypeForSubscriber(long subId); + int getDataNetworkTypeForSubscriber(int subId); /** * Returns the network type for voice @@ -462,7 +462,7 @@ interface ITelephony { * @param subId user preferred subId. * Returns the network type */ - int getVoiceNetworkTypeForSubscriber(long subId); + int getVoiceNetworkTypeForSubscriber(int subId); /** * Return true if an ICC card is present @@ -474,7 +474,7 @@ interface ITelephony { * @param slotId user preferred slotId. * Return true if an ICC card is present */ - boolean hasIccCardUsingSlotId(long slotId); + boolean hasIccCardUsingSlotId(int slotId); /** * Return if the current radio is LTE on CDMA. This @@ -494,7 +494,7 @@ interface ITelephony { * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} * or {@link PHone#LTE_ON_CDMA_TRUE} */ - int getLteOnCdmaModeForSubscriber(long subId); + int getLteOnCdmaModeForSubscriber(int subId); /** * Returns the all observed cell information of the device. @@ -689,13 +689,13 @@ interface ITelephony { * Return MDN string for CDMA phone. * @param subId user preferred subId. */ - String getCdmaMdn(long subId); + String getCdmaMdn(int subId); /** * Return MIN string for CDMA phone. * @param subId user preferred subId. */ - String getCdmaMin(long subId); + String getCdmaMin(int subId); /** * Has the calling application been granted special privileges by the carrier. @@ -733,7 +733,7 @@ interface ITelephony { * @param subId for which the simplified UI should be enabled or disabled. * @param enable true means enabling the simplified UI. */ - void enableSimplifiedNetworkSettingsForSubscriber(long subId, boolean enable); + void enableSimplifiedNetworkSettingsForSubscriber(int subId, boolean enable); /** * Get whether a simplified Mobile Network Settings UI is enabled for the @@ -742,7 +742,7 @@ interface ITelephony { * @param subId for which the simplified UI should be enabled or disabled. * @return true if the simplified UI is enabled. */ - boolean getSimplifiedNetworkSettingsEnabledForSubscriber(long subId); + boolean getSimplifiedNetworkSettingsEnabledForSubscriber(int subId); /** * Set the line 1 phone number string and its alphatag for the current ICCID @@ -754,7 +754,7 @@ interface ITelephony { * @param alphaTag alpha-tagging of the dailing nubmer * @param number The dialing number */ - void setLine1NumberForDisplayForSubscriber(long subId, String alphaTag, String number); + void setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number); /** * Returns the displayed dialing number string if it was set previously via @@ -763,7 +763,7 @@ interface ITelephony { * @param subId whose dialing number for line 1 is returned. * @return the displayed dialing number if set, or null if not set. */ - String getLine1NumberForDisplay(long subId); + String getLine1NumberForDisplay(int subId); /** * Returns the displayed alphatag of the dialing number if it was set @@ -773,7 +773,7 @@ interface ITelephony { * @return the displayed alphatag of the dialing number if set, or null if * not set. */ - String getLine1AlphaTagForDisplay(long subId); + String getLine1AlphaTagForDisplay(int subId); /** * Override the operator branding for the current ICCID. @@ -831,4 +831,18 @@ interface ITelephony { * @return phone radio type and access technology */ int getRadioAccessFamily(in int phoneId); + + /** + * Enables or disables video calling. + * + * @param enable Whether to enable video calling. + */ + void enableVideoCalling(boolean enable); + + /** + * Whether video calling has been enabled by the user. + * + * @return {@code True} if the user has enabled video calling, {@code false} otherwise. + */ + boolean isVideoCallingEnabled(); } diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index 39defcf..ee3f8b0 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -30,28 +30,28 @@ import com.android.internal.telephony.IPhoneStateListener; interface ITelephonyRegistry { void listen(String pkg, IPhoneStateListener callback, int events, boolean notifyNow); - void listenForSubscriber(in long subId, String pkg, IPhoneStateListener callback, int events, + void listenForSubscriber(in int subId, String pkg, IPhoneStateListener callback, int events, boolean notifyNow); void notifyCallState(int state, String incomingNumber); - void notifyCallStateForSubscriber(in long subId, int state, String incomingNumber); - void notifyServiceStateForPhoneId(in int phoneId, in long subId, in ServiceState state); + void notifyCallStateForSubscriber(in int subId, int state, String incomingNumber); + void notifyServiceStateForPhoneId(in int phoneId, in int subId, in ServiceState state); void notifySignalStrength(in SignalStrength signalStrength); - void notifySignalStrengthForSubscriber(in long subId, in SignalStrength signalStrength); - void notifyMessageWaitingChangedForPhoneId(in int phoneId, in long subId, in boolean mwi); + void notifySignalStrengthForSubscriber(in int subId, in SignalStrength signalStrength); + void notifyMessageWaitingChangedForPhoneId(in int phoneId, in int subId, in boolean mwi); void notifyCallForwardingChanged(boolean cfi); - void notifyCallForwardingChangedForSubscriber(in long subId, boolean cfi); + void notifyCallForwardingChangedForSubscriber(in int subId, boolean cfi); void notifyDataActivity(int state); - void notifyDataActivityForSubscriber(in long subId, int state); + void notifyDataActivityForSubscriber(in int subId, int state); void notifyDataConnection(int state, boolean isDataConnectivityPossible, String reason, String apn, String apnType, in LinkProperties linkProperties, in NetworkCapabilities networkCapabilities, int networkType, boolean roaming); - void notifyDataConnectionForSubscriber(long subId, int state, boolean isDataConnectivityPossible, + void notifyDataConnectionForSubscriber(int subId, int state, boolean isDataConnectivityPossible, String reason, String apn, String apnType, in LinkProperties linkProperties, in NetworkCapabilities networkCapabilities, int networkType, boolean roaming); void notifyDataConnectionFailed(String reason, String apnType); - void notifyDataConnectionFailedForSubscriber(long subId, String reason, String apnType); + void notifyDataConnectionFailedForSubscriber(int subId, String reason, String apnType); void notifyCellLocation(in Bundle cellLocation); - void notifyCellLocationForSubscriber(in long subId, in Bundle cellLocation); + void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation); void notifyOtaspChanged(in int otaspMode); void notifyCellInfo(in List<CellInfo> cellInfo); void notifyPreciseCallState(int ringingCallState, int foregroundCallState, @@ -59,8 +59,8 @@ interface ITelephonyRegistry { void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause); void notifyPreciseDataConnectionFailed(String reason, String apnType, String apn, String failCause); - void notifyCellInfoForSubscriber(in long subId, in List<CellInfo> cellInfo); + void notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo); void notifyDataConnectionRealTimeInfo(in DataConnectionRealTimeInfo dcRtInfo); void notifyVoLteServiceStateChanged(in VoLteServiceState lteState); - void notifyOemHookRawEventForSubscriber(in long subId, in byte[] rawData); + void notifyOemHookRawEventForSubscriber(in int subId, in byte[] rawData); } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index d093a29..b5e82e3 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -161,6 +161,7 @@ cat include/telephony/ril.h | \ public static final int DATA_PROFILE_FOTA = 3; public static final int DATA_PROFILE_CBS = 4; public static final int DATA_PROFILE_OEM_BASE = 1000; + public static final int DATA_PROFILE_INVALID = 0xFFFFFFFF; int RIL_REQUEST_GET_SIM_STATUS = 1; int RIL_REQUEST_ENTER_SIM_PIN = 2; |