diff --git a/api/current.txt b/api/current.txt index ebc70e1455f70..348ebf9a2c617 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 5d68d16bda7ef..4c44ce0991d68 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 20865d4e8c95f..15ccc2582444a 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; *
* 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: *
* *{@code
@@ -32,14 +34,16 @@ import android.os.PersistableBundle;
* android:label="@string/service_name"
* android:permission="android.permission.BIND_CARRIER_SERVICES">
*
- *
+ *
+ *
*
*
* }
*/
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;