OSDN Git Service

Add getSystemPhoneApplication to TelecommManager
authorYorke Lee <yorkelee@google.com>
Wed, 18 Jun 2014 20:01:26 +0000 (13:01 -0700)
committerYorke Lee <yorkelee@google.com>
Wed, 18 Jun 2014 20:01:26 +0000 (13:01 -0700)
Change-Id: Ie67698e8363d1498b37692dc7be23b14a0d8c388

telecomm/java/android/telecomm/TelecommManager.java

index a97e7e4..989c2cd 100644 (file)
@@ -16,7 +16,9 @@
 
 package android.telecomm;
 
+import android.content.ComponentName;
 import android.content.Context;
+import android.os.RemoteException;
 
 import com.android.internal.telecomm.ITelecommService;
 
@@ -45,4 +47,14 @@ public class TelecommManager {
     public static TelecommManager from(Context context) {
         return (TelecommManager) context.getSystemService(Context.TELECOMM_SERVICE);
     }
+
+    /** {@hide} */
+    public ComponentName getSystemPhoneApplication() {
+        try {
+            return mService.getSystemPhoneApplication();
+        } catch (RemoteException e) {
+            Log.e(TAG, e, "Error calling ITelecommService#getSystemPhoneApplication");
+            return null;
+        }
+    }
 }