diff options
| author | 2015-05-27 16:20:15 -0700 | |
|---|---|---|
| committer | 2015-05-27 16:53:09 -0700 | |
| commit | 5c04bd767b23bb7f9faa0eeb9b9ab4c5525c6ea7 (patch) | |
| tree | 9b22a2be1e349abe3fa7e1f52e45d12f7dd0ae12 | |
| parent | 42ecc9eb902ef90876cd345a906c24e0d58720a3 (diff) | |
Update intents for CarrierService
Keep the bind intent and the config intent separate.
Change-Id: I645a7e697d49d46a4870b7b3a252b3214ee85412
| -rw-r--r-- | api/current.txt | 3 | ||||
| -rw-r--r-- | api/system-current.txt | 3 | ||||
| -rw-r--r-- | core/java/android/service/carrier/CarrierService.java | 13 |
3 files changed, 13 insertions, 6 deletions
diff --git a/api/current.txt b/api/current.txt index ebc70e1455f7..348ebf9a2c61 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28620,7 +28620,8 @@ package android.service.carrier { ctor public CarrierService(); method public final 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 SERVICE_INTERFACE = "android.service.carrier.CarrierService"; + 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"; } public final class MessagePdu implements android.os.Parcelable { diff --git a/api/system-current.txt b/api/system-current.txt index 5d68d16bda7e..4c44ce0991d6 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -30646,7 +30646,8 @@ package android.service.carrier { ctor public CarrierService(); method public final 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 SERVICE_INTERFACE = "android.service.carrier.CarrierService"; + 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"; } 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 20865d4e8c95..15ccc2582444 100644 --- a/core/java/android/service/carrier/CarrierService.java +++ b/core/java/android/service/carrier/CarrierService.java @@ -24,7 +24,9 @@ import android.os.PersistableBundle; * <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 #SERVICE_INTERFACE} action. For example: + * 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. + * For example: * </p> * * <pre>{@code @@ -32,14 +34,16 @@ import android.os.PersistableBundle; * android:label="@string/service_name" * android:permission="android.permission.BIND_CARRIER_SERVICES"> * <intent-filter> - * <action android:name="android.service.carrier.CarrierService" /> + * <action android:name="android.service.carrier.ConfigService" /> + * <action android:name="android.service.carrier.BindService" /> * </intent-filter> * </service> * }</pre> */ public abstract class CarrierService extends Service { - public static final String SERVICE_INTERFACE = "android.service.carrier.CarrierService"; + public static final String CONFIG_SERVICE_INTERFACE = "android.service.carrier.ConfigService"; + public static final String BIND_SERVICE_INTERFACE = "android.service.carrier.BindService"; private final ICarrierService.Stub mStubWrapper; @@ -82,7 +86,8 @@ public abstract class CarrierService extends Service { /** @hide */ @Override public final IBinder onBind(Intent intent) { - if (!SERVICE_INTERFACE.equals(intent.getAction())) { + if (!CONFIG_SERVICE_INTERFACE.equals(intent.getAction()) + || !BIND_SERVICE_INTERFACE.equals(intent.getAction())) { return null; } return mStubWrapper; |