summaryrefslogtreecommitdiff
path: root/telephony/java
diff options
context:
space:
mode:
authorBrad Ebinger <breadley@google.com>2020-05-20 19:28:00 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-20 19:28:00 +0000
commit9ced93931319a86f1d674c911d741ec89dd96d7d (patch)
treee493c6074c9ce9b69d43d98f8e2f4c00bf9be267 /telephony/java
parent743a9a0b4aa32fef2ca598eec84b7aed474f9abf (diff)
parent0b35eb55a86718c94281567db75565304b102ef3 (diff)
Merge "Fix MmTelFeatureConnection Memory Leak" into rvc-dev am: 0b35eb55a8
Change-Id: Id06fda9d0a3f3995c9497410e79ccb72c4862a43
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java23
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl8
2 files changed, 31 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 4246aef027bb..f5ed64ebf3fb 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -7395,6 +7395,29 @@ public class TelephonyManager {
}
/**
+ * Unregister a IImsServiceFeatureCallback previously associated with an ImsFeature through
+ * {@link #getImsMmTelFeatureAndListen(int, IImsServiceFeatureCallback)} or
+ * {@link #getImsRcsFeatureAndListen(int, IImsServiceFeatureCallback)}.
+ * @param slotIndex The SIM slot associated with the callback.
+ * @param featureType The {@link android.telephony.ims.feature.ImsFeature.FeatureType}
+ * associated with the callback.
+ * @param callback The callback to be unregistered.
+ * @hide
+ */
+ public void unregisterImsFeatureCallback(int slotIndex, int featureType,
+ IImsServiceFeatureCallback callback) {
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony != null) {
+ telephony.unregisterImsFeatureCallback(slotIndex, featureType, callback);
+ }
+ } catch (RemoteException e) {
+ Rlog.e(TAG, "unregisterImsFeatureCallback, RemoteException: "
+ + e.getMessage());
+ }
+ }
+
+ /**
* @return the {@IImsRegistration} interface that corresponds with the slot index and feature.
* @param slotIndex The SIM slot corresponding to the ImsService ImsRegistration is active for.
* @param feature An integer indicating the feature that we wish to get the ImsRegistration for.
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index f5cd68f050a4..369020033a59 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -851,6 +851,14 @@ interface ITelephony {
IImsRcsFeature getRcsFeatureAndListen(int slotId, in IImsServiceFeatureCallback callback);
/**
+ * Unregister a callback that was previously registered through
+ * {@link #getMmTelFeatureAndListen} or {@link #getRcsFeatureAndListen}. This should always be
+ * called when the callback is no longer being used.
+ */
+ void unregisterImsFeatureCallback(int slotId, int featureType,
+ in IImsServiceFeatureCallback callback);
+
+ /**
* Returns the IImsRegistration associated with the slot and feature specified.
*/
IImsRegistration getImsRegistration(int slotId, int feature);