am f4311129: Add interface to determine whether the IMS service is available
[android/platform/frameworks/opt/net/ims.git] / src / java / com / android / ims / ImsManager.java
index d36ccf2..26389a1 100644 (file)
@@ -420,6 +420,22 @@ public class ImsManager {
         createImsService(true);
     }
 
+    /*
+     * Returns a flag indicating whether the IMS service is available.
+     */
+    public boolean isServiceAvailable() {
+        if (mImsService != null) {
+            return true;
+        }
+
+        IBinder binder = ServiceManager.checkService(getImsServiceName(mPhoneId));
+        if (binder != null) {
+            return true;
+        }
+
+        return false;
+    }
+
     /**
      * Opens the IMS service for making calls and/or receiving generic IMS calls.
      * The caller may make subsquent calls through {@link #makeCall}.