From 42ecc9eb902ef90876cd345a906c24e0d58720a3 Mon Sep 17 00:00:00 2001 From: Zach Johnson Date: Fri, 22 May 2015 15:56:09 -0700 Subject: Drop the "Config". Just "CarrierService". It's cleaner. b/21308727 Change-Id: I6515888c7804349ecd07c4dd74575ef89a4bea59 --- .../service/carrier/CarrierConfigService.java | 104 --------------------- .../android/service/carrier/CarrierService.java | 104 +++++++++++++++++++++ .../service/carrier/ICarrierConfigService.aidl | 32 ------- .../android/service/carrier/ICarrierService.aidl | 32 +++++++ 4 files changed, 136 insertions(+), 136 deletions(-) delete mode 100644 core/java/android/service/carrier/CarrierConfigService.java create mode 100644 core/java/android/service/carrier/CarrierService.java delete mode 100644 core/java/android/service/carrier/ICarrierConfigService.aidl create mode 100644 core/java/android/service/carrier/ICarrierService.aidl (limited to 'core/java/android/service/carrier') diff --git a/core/java/android/service/carrier/CarrierConfigService.java b/core/java/android/service/carrier/CarrierConfigService.java deleted file mode 100644 index bf33ad5..0000000 --- a/core/java/android/service/carrier/CarrierConfigService.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package android.service.carrier; - -import android.app.Service; -import android.content.Intent; -import android.os.IBinder; -import android.os.PersistableBundle; - -/** - * A service that sets carrier configuration for telephony services. - *

- * 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: - *

- * - *
{@code
- * 
- *  
- *      
- *  
- * 
- * }
- */ -public abstract class CarrierConfigService extends Service { - - public static final String SERVICE_INTERFACE = "android.service.carrier.CarrierConfigService"; - - private final ICarrierConfigService.Stub mStubWrapper; - - public CarrierConfigService() { - mStubWrapper = new ICarrierConfigServiceWrapper(); - } - - /** - * Override this method to set carrier configuration. - *

- * This method will be called by telephony services to get carrier-specific configuration - * values. The returned config will be saved by the system until, - *

    - *
  1. The carrier app package is updated, or
  2. - *
  3. The carrier app requests a reload with - * {@link android.telephony.CarrierConfigManager#reloadCarrierConfigForSubId - * reloadCarrierConfigForSubId}.
  4. - *
- * This method can be called after a SIM card loads, which may be before or after boot. - *

- *

- * This method should not block for a long time. If expensive operations (e.g. network access) - * are required, this method can schedule the work and return null. Then, use - * {@link android.telephony.CarrierConfigManager#reloadCarrierConfigForSubId - * reloadCarrierConfigForSubId} to trigger a reload when the config is ready. - *

- *

- * Implementations should use the keys defined in {@link android.telephony.CarrierConfigManager - * CarrierConfigManager}. Any configuration values not set in the returned {@link - * PersistableBundle} may be overridden by the system's default configuration service. - *

- * - * @param id contains details about the current carrier that can be used do decide what - * configuration values to return. - * @return a {@link PersistableBundle} object containing the configuration or null if default - * values should be used. - */ - public abstract PersistableBundle onLoadConfig(CarrierIdentifier id); - - /** @hide */ - @Override - public final IBinder onBind(Intent intent) { - if (!SERVICE_INTERFACE.equals(intent.getAction())) { - return null; - } - return mStubWrapper; - } - - /** - * A wrapper around ICarrierConfigService that forwards calls to implementations of - * {@link CarrierConfigService}. - * - * @hide - */ - private class ICarrierConfigServiceWrapper extends ICarrierConfigService.Stub { - - @Override - public PersistableBundle getCarrierConfig(CarrierIdentifier id) { - return CarrierConfigService.this.onLoadConfig(id); - } - } -} diff --git a/core/java/android/service/carrier/CarrierService.java b/core/java/android/service/carrier/CarrierService.java new file mode 100644 index 0000000..20865d4 --- /dev/null +++ b/core/java/android/service/carrier/CarrierService.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package android.service.carrier; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; +import android.os.PersistableBundle; + +/** + * A service that exposes carrier-specific functionality to the system. + *

+ * 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: + *

+ * + *
{@code
+ * 
+ *  
+ *      
+ *  
+ * 
+ * }
+ */ +public abstract class CarrierService extends Service { + + public static final String SERVICE_INTERFACE = "android.service.carrier.CarrierService"; + + private final ICarrierService.Stub mStubWrapper; + + public CarrierService() { + mStubWrapper = new ICarrierServiceWrapper(); + } + + /** + * Override this method to set carrier configuration. + *

+ * This method will be called by telephony services to get carrier-specific configuration + * values. The returned config will be saved by the system until, + *

    + *
  1. The carrier app package is updated, or
  2. + *
  3. The carrier app requests a reload with + * {@link android.telephony.CarrierConfigManager#reloadCarrierConfigForSubId + * reloadCarrierConfigForSubId}.
  4. + *
+ * This method can be called after a SIM card loads, which may be before or after boot. + *

+ *

+ * This method should not block for a long time. If expensive operations (e.g. network access) + * are required, this method can schedule the work and return null. Then, use + * {@link android.telephony.CarrierConfigManager#reloadCarrierConfigForSubId + * reloadCarrierConfigForSubId} to trigger a reload when the config is ready. + *

+ *

+ * Implementations should use the keys defined in {@link android.telephony.CarrierConfigManager + * CarrierConfigManager}. Any configuration values not set in the returned {@link + * PersistableBundle} may be overridden by the system's default configuration service. + *

+ * + * @param id contains details about the current carrier that can be used do decide what + * configuration values to return. + * @return a {@link PersistableBundle} object containing the configuration or null if default + * values should be used. + */ + public abstract PersistableBundle onLoadConfig(CarrierIdentifier id); + + /** @hide */ + @Override + public final IBinder onBind(Intent intent) { + if (!SERVICE_INTERFACE.equals(intent.getAction())) { + return null; + } + return mStubWrapper; + } + + /** + * A wrapper around ICarrierService that forwards calls to implementations of + * {@link CarrierService}. + * + * @hide + */ + private class ICarrierServiceWrapper extends ICarrierService.Stub { + + @Override + public PersistableBundle getCarrierConfig(CarrierIdentifier id) { + return CarrierService.this.onLoadConfig(id); + } + } +} diff --git a/core/java/android/service/carrier/ICarrierConfigService.aidl b/core/java/android/service/carrier/ICarrierConfigService.aidl deleted file mode 100644 index abbc000..0000000 --- a/core/java/android/service/carrier/ICarrierConfigService.aidl +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2015, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.service.carrier; - -import android.os.PersistableBundle; -import android.service.carrier.CarrierIdentifier; - -/** - * Service used to get carrier config from carrier apps. - * - * @see android.service.carrier.CarrierConfigService - * @hide - */ -interface ICarrierConfigService { - - /** @see android.service.carrier.CarrierConfigService#onLoadConfig */ - PersistableBundle getCarrierConfig(in CarrierIdentifier id); -} diff --git a/core/java/android/service/carrier/ICarrierService.aidl b/core/java/android/service/carrier/ICarrierService.aidl new file mode 100644 index 0000000..4c87585 --- /dev/null +++ b/core/java/android/service/carrier/ICarrierService.aidl @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2015, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.service.carrier; + +import android.os.PersistableBundle; +import android.service.carrier.CarrierIdentifier; + +/** + * Service used to expose carrier-specific functionality to the system. + * + * @see android.service.carrier.CarrierService + * @hide + */ +interface ICarrierService { + + /** @see android.service.carrier.CarrierService#onLoadConfig */ + PersistableBundle getCarrierConfig(in CarrierIdentifier id); +} -- cgit v1.1