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
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 56029d5..bfc69a5 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -11305,4 +11305,21 @@
Log.d(LOG_TAG, "result = " + result);
return result;
}
+
+ @Override
+ 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);
+ }
+ }
}