summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Grace Jia <xiaotonj@google.com> 2020-01-24 10:45:36 -0800
committer android-build-merger <android-build-merger@google.com> 2020-01-24 10:45:36 -0800
commitf24dfaf17fe4507901fec8fcdd2e128b182ab8fc (patch)
tree68aee4f8c82145998c47504697bf3f9c1f392c83
parentcaabef3f2c1ef639c3712842ba01f4b12afd2e40 (diff)
parentbae97dc91e75be0fbc5e9ea2f9feab8d55e14788 (diff)
Merge "Support API to toggle IMS on and off."
am: bae97dc91e Change-Id: Id7a1a75472b13d5fbfa520dbdefc29e9c3a9b90e
-rwxr-xr-xapi/system-current.txt1
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java24
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl5
3 files changed, 30 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 2e4bc251b201..b1fa0bad9102 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -9522,6 +9522,7 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestNumberVerification(@NonNull android.telephony.PhoneNumberRange, long, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.NumberVerificationCallback);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetAllCarrierActions();
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetCarrierKeysForImsiEncryption();
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void resetIms(int);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean resetRadioConfig();
method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 8dd4478ed62e..6c8252ee8538 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -6878,6 +6878,30 @@ public class TelephonyManager {
}
}
+
+ /**
+ * Resets the {@link android.telephony.ims.ImsService} associated with the specified sim slot.
+ * Used by diagnostic apps to force the IMS stack to be disabled and re-enabled in an effort to
+ * recover from scenarios where the {@link android.telephony.ims.ImsService} gets in to a bad
+ * state.
+ *
+ * @param slotIndex the sim slot to reset the IMS stack on.
+ * @hide */
+ @SystemApi
+ @WorkerThread
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void resetIms(int slotIndex) {
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony != null) {
+ telephony.resetIms(slotIndex);
+ }
+ } catch (RemoteException e) {
+ Rlog.e(TAG, "toggleImsOnOff, RemoteException: "
+ + e.getMessage());
+ }
+ }
+
/**
* Enables IMS for the framework. This will trigger IMS registration and ImsFeature capability
* status updates, if not already enabled.
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 1f84451a35e4..625f5252026c 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -828,6 +828,11 @@ interface ITelephony {
void disableIms(int slotId);
/**
+ * Toggle framework IMS disables and enables.
+ */
+ void resetIms(int slotIndex);
+
+ /**
* Get IImsMmTelFeature binder from ImsResolver that corresponds to the subId and MMTel feature
* as well as registering the MmTelFeature for callbacks using the IImsServiceFeatureCallback
* interface.