From e6ec7d8b8f0bd9875cbaff5aa1c3bc2b69e6cc51 Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Mon, 23 Jan 2017 16:20:33 -0800 Subject: Adds @hide ImsResolver API and device overlays (2/3) - Adds config_ims_package device overlay, which specifies the default package name to bind to. - Adds config_dynamic_bind_ims device overlay, which determines whether or not the new dynamic binding system is used. - Adds @hide TelephonyManager API to interface with the ImsResolver Test: Manual Merged-In: I82a41da00e6da34629a40db431f13b968dfafe2e Change-Id: I82a41da00e6da34629a40db431f13b968dfafe2e --- core/res/res/values/config.xml | 7 ++++ core/res/res/values/symbols.xml | 2 ++ .../java/android/telephony/TelephonyManager.java | 37 ++++++++++++++++++++++ .../com/android/internal/telephony/ITelephony.aidl | 10 ++++++ 4 files changed, 56 insertions(+) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index dbc4324ec92a..fbde9c0324f4 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2267,6 +2267,13 @@ false + + + + + true + true diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 9db131b373a5..bdac134f20cb 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -252,6 +252,8 @@ + + diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 307dc1a6e74f..1554868c30f2 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -16,6 +16,7 @@ package android.telephony; +import android.annotation.IntDef; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SdkConstant; @@ -39,8 +40,11 @@ import android.service.carrier.CarrierIdentifier; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telephony.TelephonyHistogram; +import android.telephony.ims.feature.ImsFeature; import android.util.Log; +import com.android.ims.internal.IImsServiceController; +import com.android.ims.internal.IImsServiceFeatureListener; import com.android.internal.telecom.ITelecomService; import com.android.internal.telephony.CellNetworkScanResult; import com.android.internal.telephony.IPhoneSubInfo; @@ -53,6 +57,8 @@ import com.android.internal.telephony.TelephonyProperties; import java.io.FileInputStream; import java.io.IOException; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -4041,6 +4047,37 @@ public class TelephonyManager { } } + /** @hide */ + @IntDef({ImsFeature.EMERGENCY_MMTEL, ImsFeature.MMTEL, ImsFeature.RCS}) + @Retention(RetentionPolicy.SOURCE) + public @interface Feature {} + + /** + * Returns the {@link IImsServiceController} that corresponds to the given slot Id and IMS + * feature or {@link null} if the service is not available. If an ImsServiceController is + * available, the {@link IImsServiceFeatureListener} callback is registered as a listener for + * feature updates. + * @param slotId The SIM slot that we are requesting the {@link IImsServiceController} for. + * @param feature The IMS Feature we are requesting, corresponding to {@link ImsFeature}. + * @param callback Listener that will send updates to ImsManager when there are updates to + * ImsServiceController. + * @return {@link IImsServiceController} interface for the feature specified or {@link null} if + * it is unavailable. + * @hide + */ + public IImsServiceController getImsServiceControllerAndListen(int slotId, @Feature int feature, + IImsServiceFeatureListener callback) { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.getImsServiceControllerAndListen(slotId, feature, callback); + } + } catch (RemoteException e) { + Rlog.e(TAG, "getImsServiceControllerAndListen, RemoteException: " + e.getMessage()); + } + return null; + } + /** * Set IMS registration state * diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index a8eaf3627013..d406cb07fc45 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -31,6 +31,8 @@ import android.telephony.RadioAccessFamily; import android.telephony.ServiceState; import android.telephony.TelephonyHistogram; import android.telephony.VisualVoicemailSmsFilterSettings; +import com.android.ims.internal.IImsServiceController; +import com.android.ims.internal.IImsServiceFeatureListener; import com.android.internal.telephony.CellNetworkScanResult; import com.android.internal.telephony.OperatorInfo; @@ -714,6 +716,14 @@ interface ITelephony { */ int getTetherApnRequired(); + /** + * Get ImsServiceController binder from ImsResolver that corresponds to the subId and feature + * requested as well as registering the ImsServiceController for callbacks using the + * IImsServiceFeatureListener interface. + */ + IImsServiceController getImsServiceControllerAndListen(int slotId, int feature, + IImsServiceFeatureListener callback); + /** * Set the network selection mode to automatic. * -- cgit v1.2.3-59-g8ed1b