Merge "Update CarrierService long lived binding API" into mnc-dev
diff --git a/api/current.txt b/api/current.txt
index f099253..d266f1e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28599,8 +28599,7 @@
     method public final void notifyCarrierNetworkChange(boolean);
     method public android.os.IBinder onBind(android.content.Intent);
     method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier);
-    field public static final java.lang.String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService";
-    field public static final java.lang.String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService";
+    field public static final java.lang.String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService";
   }
 
   public final class MessagePdu implements android.os.Parcelable {
diff --git a/api/system-current.txt b/api/system-current.txt
index 49cc7cc..a7c0f49 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -30647,8 +30647,7 @@
     method public final void notifyCarrierNetworkChange(boolean);
     method public android.os.IBinder onBind(android.content.Intent);
     method public abstract android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier);
-    field public static final java.lang.String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService";
-    field public static final java.lang.String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService";
+    field public static final java.lang.String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService";
   }
 
   public final class MessagePdu implements android.os.Parcelable {
diff --git a/core/java/android/service/carrier/CarrierService.java b/core/java/android/service/carrier/CarrierService.java
index 225e70d..455e1b2 100644
--- a/core/java/android/service/carrier/CarrierService.java
+++ b/core/java/android/service/carrier/CarrierService.java
@@ -29,8 +29,8 @@
  * <p>
  * To extend this class, you must declare the service in your manifest file to require the
  * {@link android.Manifest.permission#BIND_CARRIER_SERVICES} permission and include an intent
- * filter with the {@link #CONFIG_SERVICE_INTERFACE} action if the service exposes carrier config
- * and the {@link #BIND_SERVICE_INTERFACE} action if the service should have a long-lived binding.
+ * filter with the {@link #CARRIER_SERVICE_INTERFACE}. If the service should have a long-lived
+ * binding, set android.service.carrier.LONG_LIVED_BINDING to true in the service's metadata.
  * For example:
  * </p>
  *
@@ -39,16 +39,16 @@
  *       android:label="@string/service_name"
  *       android:permission="android.permission.BIND_CARRIER_SERVICES">
  *  <intent-filter>
- *      <action android:name="android.service.carrier.ConfigService" />
- *      <action android:name="android.service.carrier.BindService" />
+ *      <action android:name="android.service.carrier.CarrierService" />
  *  </intent-filter>
+ *  <meta-data android:name="android.service.carrier.LONG_LIVED_BINDING"
+ *             android:value="true" />
  * </service>
  * }</pre>
  */
 public abstract class CarrierService extends Service {
 
-    public static final String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService";
-    public static final String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService";
+    public static final String CARRIER_SERVICE_INTERFACE = "android.service.carrier.CarrierService";
 
     private static ITelephonyRegistry sRegistry;
 
@@ -127,13 +127,7 @@
     @Override
     @CallSuper
     public IBinder onBind(Intent intent) {
-        switch (intent.getAction()) {
-            case CONFIG_SERVICE_INTERFACE:
-            case BIND_SERVICE_INTERFACE:
-                return mStubWrapper;
-            default:
-                return null;
-        }
+        return mStubWrapper;
     }
 
     /**