Telephony plumbing for SIM call manager voice status
For now, we add to GsmCdmaPhone's ServiceState merging logic, which is
already where IMS registration state is folded into the voice service
state value. This will be propagated to downstream callers via the
regular ServiceState and TelephonyCallback.ServiceStateListener APIs.
Bug: 205737545
Test: atest GsmCdmaPhoneTest
Change-Id: I2a67893ccab97a2fde4965f0018afddc211fa01b
Merged-In: I2a67893ccab97a2fde4965f0018afddc211fa01b
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 1947d91..2ec0ed1 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -11193,6 +11193,12 @@
}
}
+ @Override
+ public boolean isUsingNewDataStack() {
+ TelephonyPermissions.enforceShellOnly(Binder.getCallingUid(), "isUsingNewDataStack");
+ return getDefaultPhone().isUsingNewDataStack();
+ }
+
/**
* Sets the modem service class Name that Telephony will bind to.
*
@@ -11227,8 +11233,19 @@
}
@Override
- public boolean isUsingNewDataStack() {
- TelephonyPermissions.enforceShellOnly(Binder.getCallingUid(), "isUsingNewDataStack");
- return getDefaultPhone().isUsingNewDataStack();
+ public void setVoiceServiceStateOverride(int subId, boolean hasService, String callingPackage) {
+ // Only telecom (and shell, for CTS purposes) is allowed to call this method.
+ mApp.enforceCallingOrSelfPermission(
+ permission.BIND_TELECOM_CONNECTION_SERVICE, "setVoiceServiceStateOverride");
+ mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
+
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ Phone phone = getPhone(subId);
+ if (phone == null) return;
+ phone.setVoiceServiceStateOverride(hasService);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
}