Add emergency call service selector.
Change-Id: I85b8c0a6c6d2db668caaf27abe6b022e8e06cc8c
diff --git a/src/com/android/telecomm/TelephonyUtil.java b/src/com/android/telecomm/TelephonyUtil.java
index 7a9ac22..be501f0 100644
--- a/src/com/android/telecomm/TelephonyUtil.java
+++ b/src/com/android/telecomm/TelephonyUtil.java
@@ -43,6 +43,17 @@
return selector.getComponentName().getPackageName().equals(TELEPHONY_PACKAGE_NAME);
}
+ static boolean isPstnCallService(CallServiceDescriptor descriptor) {
+ ComponentName componentName = descriptor.getServiceComponent();
+ if (TELEPHONY_PACKAGE_NAME.equals(componentName.getPackageName())) {
+ String className = componentName.getClassName();
+ return GSM_CALL_SERVICE_CLASS_NAME.equals(className) ||
+ CDMA_CALL_SERVICE_CLASS_NAME.equals(className);
+ }
+
+ return false;
+ }
+
/**
* Returns whether or not the call is currently connected as a cellular call (through the
* device's cellular radio).
@@ -57,10 +68,7 @@
if (callService == null) {
return false;
}
- CallServiceDescriptor descriptor = callService.getDescriptor();
- String className = descriptor.getServiceComponent().getClassName();
- return className.equals(GSM_CALL_SERVICE_CLASS_NAME) ||
- className.equals(CDMA_CALL_SERVICE_CLASS_NAME);
+ return isPstnCallService(callService.getDescriptor());
}
private static void verifyCallServiceExists(String serviceName) {