Merge "MSIM support for hidden IMS capability and registration query APIs."

This commit is contained in:
Brad Ebinger
2018-02-16 20:35:45 +00:00
committed by Gerrit Code Review
3 changed files with 92 additions and 69 deletions

View File

@@ -52,6 +52,7 @@ import android.telephony.ims.aidl.IImsMmTelFeature;
import android.telephony.ims.aidl.IImsRcsFeature; import android.telephony.ims.aidl.IImsRcsFeature;
import android.telephony.ims.aidl.IImsRegistration; import android.telephony.ims.aidl.IImsRegistration;
import android.telephony.ims.feature.ImsFeature; import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.util.Log; import android.util.Log;
import com.android.ims.internal.IImsServiceFeatureCallback; import com.android.ims.internal.IImsServiceFeatureCallback;
@@ -6236,84 +6237,106 @@ public class TelephonyManager {
return false; return false;
} }
/**
* Returns the IMS Registration Status
* @hide
*/
public boolean isImsRegistered() {
try {
ITelephony telephony = getITelephony();
if (telephony == null)
return false;
return telephony.isImsRegistered();
} catch (RemoteException ex) {
return false;
} catch (NullPointerException ex) {
return false;
}
}
/** /**
* Returns the IMS Registration Status for a particular Subscription ID * Returns the IMS Registration Status for a particular Subscription ID.
* *
* @param subId Subscription ID * @param subId Subscription ID
* @return true if IMS status is registered, false if the IMS status is not registered or a * @return true if IMS status is registered, false if the IMS status is not registered or a
* RemoteException occurred. * RemoteException occurred.
*
* @hide * @hide
*/ */
public boolean isImsRegistered(int subId) { public boolean isImsRegistered(int subId) {
try {
return getITelephony().isImsRegisteredForSubscriber(subId);
} catch (RemoteException ex) {
return false;
} catch (NullPointerException ex) {
return false;
}
}
/**
* Returns the Status of Volte
* @hide
*/
public boolean isVolteAvailable() {
try {
return getITelephony().isVolteAvailable();
} catch (RemoteException ex) {
return false;
} catch (NullPointerException ex) {
return false;
}
}
/**
* Returns the Status of video telephony (VT)
* @hide
*/
public boolean isVideoTelephonyAvailable() {
try { try {
return getITelephony().isVideoTelephonyAvailable(); return getITelephony().isImsRegistered(subId);
} catch (RemoteException ex) { } catch (RemoteException | NullPointerException ex) {
return false;
} catch (NullPointerException ex) {
return false; return false;
} }
} }
/** /**
* Returns the Status of Wi-Fi Calling * Returns the IMS Registration Status for a particular Subscription ID, which is determined
* when the TelephonyManager is created using {@link #createForSubscriptionId(int)}. If an
* invalid subscription ID is used during creation, will the default subscription ID will be
* used.
*
* @return true if IMS status is registered, false if the IMS status is not registered or a
* RemoteException occurred.
* @see SubscriptionManager#getDefaultSubscriptionId()
* @hide
*/
public boolean isImsRegistered() {
try {
return getITelephony().isImsRegistered(getSubId());
} catch (RemoteException | NullPointerException ex) {
return false;
}
}
/**
* The current status of Voice over LTE for the subscription associated with this instance when
* it was created using {@link #createForSubscriptionId(int)}. If an invalid subscription ID was
* used during creation, the default subscription ID will be used.
* @return true if Voice over LTE is available or false if it is unavailable or unknown.
* @see SubscriptionManager#getDefaultSubscriptionId()
* @hide
*/
public boolean isVolteAvailable() {
try {
return getITelephony().isVolteAvailable(getSubId());
} catch (RemoteException | NullPointerException ex) {
return false;
}
}
/**
* The availability of Video Telephony (VT) for the subscription ID specified when this instance
* was created using {@link #createForSubscriptionId(int)}. If an invalid subscription ID was
* used during creation, the default subscription ID will be used. To query the
* underlying technology that VT is available on, use {@link #getImsRegTechnologyForMmTel}.
* @return true if VT is available, or false if it is unavailable or unknown.
* @hide
*/
public boolean isVideoTelephonyAvailable() {
try {
return getITelephony().isVideoTelephonyAvailable(getSubId());
} catch (RemoteException | NullPointerException ex) {
return false;
}
}
/**
* Returns the Status of Wi-Fi calling (Voice over WiFi) for the subscription ID specified.
* @param subId the subscription ID.
* @return true if VoWiFi is available, or false if it is unavailable or unknown.
* @hide * @hide
*/ */
public boolean isWifiCallingAvailable() { public boolean isWifiCallingAvailable() {
try { try {
return getITelephony().isWifiCallingAvailable(); return getITelephony().isWifiCallingAvailable(getSubId());
} catch (RemoteException ex) { } catch (RemoteException | NullPointerException ex) {
return false;
} catch (NullPointerException ex) {
return false; return false;
} }
} }
/**
* The technology that IMS is registered for for the MMTEL feature.
* @param subId subscription ID to get IMS registration technology for.
* @return The IMS registration technology that IMS is registered to for the MMTEL feature.
* Valid return results are:
* - {@link ImsRegistrationImplBase#REGISTRATION_TECH_LTE} for LTE registration,
* - {@link ImsRegistrationImplBase#REGISTRATION_TECH_IWLAN} for IWLAN registration, or
* - {@link ImsRegistrationImplBase#REGISTRATION_TECH_NONE} if we are not registered or the
* result is unavailable.
* @hide
*/
public @ImsRegistrationImplBase.ImsRegistrationTech int getImsRegTechnologyForMmTel() {
try {
return getITelephony().getImsRegTechnologyForMmTel(getSubId());
} catch (RemoteException ex) {
return ImsRegistrationImplBase.REGISTRATION_TECH_NONE;
}
}
/** /**
* Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the default phone. * Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the default phone.
* *

View File

@@ -80,7 +80,7 @@ public abstract class ImsFeature {
public static final String EXTRA_PHONE_ID = "android:phone_id"; public static final String EXTRA_PHONE_ID = "android:phone_id";
/** /**
* Invalid feature value\ * Invalid feature value
* @hide * @hide
*/ */
public static final int FEATURE_INVALID = -1; public static final int FEATURE_INVALID = -1;

View File

@@ -1122,11 +1122,6 @@ interface ITelephony {
*/ */
boolean isHearingAidCompatibilitySupported(); boolean isHearingAidCompatibilitySupported();
/**
* Get IMS Registration Status
*/
boolean isImsRegistered();
/** /**
* Get IMS Registration Status on a particular subid. * Get IMS Registration Status on a particular subid.
* *
@@ -1134,22 +1129,27 @@ interface ITelephony {
* *
* @return {@code true} if the IMS status is registered. * @return {@code true} if the IMS status is registered.
*/ */
boolean isImsRegisteredForSubscriber(int subId); boolean isImsRegistered(int subId);
/** /**
* Returns the Status of Wi-Fi Calling * Returns the Status of Wi-Fi Calling for the subscription id specified.
*/ */
boolean isWifiCallingAvailable(); boolean isWifiCallingAvailable(int subId);
/** /**
* Returns the Status of Volte * Returns the Status of VoLTE for the subscription ID specified.
*/ */
boolean isVolteAvailable(); boolean isVolteAvailable(int subId);
/** /**
* Returns the Status of VT (video telephony) * Returns the Status of VT (video telephony) for the subscription ID specified.
*/ */
boolean isVideoTelephonyAvailable(); boolean isVideoTelephonyAvailable(int subId);
/**
* Returns the MMTEL IMS registration technology for the subsciption ID specified.
*/
int getImsRegTechnologyForMmTel(int subId);
/** /**
* Returns the unique device ID of phone, for example, the IMEI for * Returns the unique device ID of phone, for example, the IMEI for