OSDN Git Service

Expose getCarrierPackageNamesForBroadcastIntent as a hidden @SystemApi
authorShishir Agrawal <shishir@google.com>
Mon, 21 Jul 2014 20:17:33 +0000 (13:17 -0700)
committerShishir Agrawal <shishir@google.com>
Wed, 23 Jul 2014 22:29:50 +0000 (15:29 -0700)
It will be required by setup wizard to delegate initialization to the carrier
app.

Change-Id: Icc0fc728e1e24235632ac38a482b06a7b829de78

telephony/java/android/telephony/TelephonyManager.java
telephony/java/com/android/internal/telephony/ITelephony.aidl

index 9cff765..2555874 100644 (file)
@@ -20,6 +20,7 @@ import android.annotation.SystemApi;
 import android.annotation.SdkConstant;
 import android.annotation.SdkConstant.SdkConstantType;
 import android.content.Context;
+import android.content.Intent;
 import android.os.Bundle;
 import android.os.RemoteException;
 import android.os.ServiceManager;
@@ -2980,6 +2981,19 @@ public class TelephonyManager {
 
     /** @hide */
     @SystemApi
+    public List<String> getCarrierPackageNamesForBroadcastIntent(Intent intent) {
+        try {
+            return getITelephony().getCarrierPackageNamesForBroadcastIntent(intent);
+        } catch (RemoteException ex) {
+            Rlog.e(TAG, "getCarrierPackageNamesForBroadcastIntent RemoteException", ex);
+        } catch (NullPointerException ex) {
+            Rlog.e(TAG, "getCarrierPackageNamesForBroadcastIntent NPE", ex);
+        }
+        return null;
+    }
+
+    /** @hide */
+    @SystemApi
     public void dial(String number) {
         try {
             getITelephony().dial(number);
index 435c334..ec7b8ae 100644 (file)
@@ -16,6 +16,7 @@
 
 package com.android.internal.telephony;
 
+import android.content.Intent;
 import android.os.Bundle;
 import java.util.List;
 import android.telephony.NeighboringCellInfo;
@@ -660,6 +661,17 @@ interface ITelephony {
     int checkCarrierPrivilegesForPackage(String pkgname);
 
     /**
+     * Returns the package name of the carrier apps that should handle the input intent.
+     *
+     * @param packageManager PackageManager for getting receivers.
+     * @param intent Intent that will be broadcast.
+     * @return list of carrier app package names that can handle the intent.
+     *         Returns null if there is an error and an empty list if there
+     *         are no matching packages.
+     */
+    List<String> getCarrierPackageNamesForBroadcastIntent(in Intent intent);
+
+    /**
      * Set whether Android should display a simplified Mobile Network Settings UI.
      * The setting won't be persisted during power cycle.
      *