From 7bb85871331f261f48ff5e6c91d9d84f9751c3a0 Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Mon, 3 Apr 2017 11:43:09 -0700 Subject: Move @SystemApi access to ImsService Keeping a separate ImsServiceBase class for binding is redundant. Moving @SystemApi access to ImsService instead. Test: Compile and Run Change-Id: I95ed659efe1c74ccac321d1a9079f7c1b683c66b --- api/system-current.txt | 4 +- .../java/android/telephony/ims/ImsService.java | 42 +++++++++++++++----- .../java/android/telephony/ims/ImsServiceBase.java | 45 ---------------------- 3 files changed, 35 insertions(+), 56 deletions(-) delete mode 100644 telephony/java/android/telephony/ims/ImsServiceBase.java diff --git a/api/system-current.txt b/api/system-current.txt index e166eadc788a..f4ddafc611b3 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -43892,8 +43892,8 @@ package android.telephony.gsm { package android.telephony.ims { - public class ImsServiceBase extends android.app.Service { - ctor public ImsServiceBase(); + public class ImsService extends android.app.Service { + ctor public ImsService(); method public android.os.IBinder onBind(android.content.Intent); } diff --git a/telephony/java/android/telephony/ims/ImsService.java b/telephony/java/android/telephony/ims/ImsService.java index f1f683c70735..ba70374edb7b 100644 --- a/telephony/java/android/telephony/ims/ImsService.java +++ b/telephony/java/android/telephony/ims/ImsService.java @@ -16,7 +16,9 @@ package android.telephony.ims; +import android.annotation.SystemApi; import android.app.PendingIntent; +import android.app.Service; import android.content.Intent; import android.content.pm.PackageManager; import android.os.IBinder; @@ -72,26 +74,30 @@ import static android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE; * {@link CarrierConfigManager#KEY_CONFIG_IMS_PACKAGE_OVERRIDE_STRING}. * * The features that are currently supported in an ImsService are: - * - RCS_FEATURE: This ImsService implements the {@link RcsFeature} class. - * - MMTEL_FEATURE: This ImsService implements the {@link MMTelFeature} class. - * - EMERGENCY_MMTEL_FEATURE: This ImsService implements the {@link MMTelFeature} class and will be + * - RCS_FEATURE: This ImsService implements the RcsFeature class. + * - MMTEL_FEATURE: This ImsService implements the MMTelFeature class. + * - EMERGENCY_MMTEL_FEATURE: This ImsService implements the MMTelFeature class and will be * available to place emergency calls at all times. This MUST be implemented by the default * ImsService provided in the device overlay. - * - * @hide + * @hide */ -public abstract class ImsService extends ImsServiceBase { +@SystemApi +public class ImsService extends Service { private static final String LOG_TAG = "ImsService"; /** * The intent that must be defined as an intent-filter in the AndroidManifest of the ImsService. + * @hide */ public static final String SERVICE_INTERFACE = "android.telephony.ims.ImsService"; // A map of slot Id -> Set of features corresponding to that slot. private final SparseArray> mFeatures = new SparseArray<>(); + /** + * @hide + */ // Implements all supported features as a flat interface. protected final IBinder mImsServiceController = new IImsServiceController.Stub() { @@ -328,6 +334,9 @@ public abstract class ImsService extends ImsServiceBase { }; + /** + * @hide + */ @Override public IBinder onBind(Intent intent) { if(SERVICE_INTERFACE.equals(intent.getAction())) { @@ -409,12 +418,18 @@ public abstract class ImsService extends ImsServiceBase { return null; } + /** + * @hide + */ @VisibleForTesting // Be sure to lock on mFeatures before accessing this method public SparseArray getImsFeatureMap(int slotId) { return mFeatures.get(slotId); } + /** + * @hide + */ @VisibleForTesting // Be sure to lock on mFeatures before accessing this method public ImsFeature getImsFeatureFromType(SparseArray set, int featureType) { @@ -451,17 +466,26 @@ public abstract class ImsService extends ImsServiceBase { /** * @return An implementation of MMTelFeature that will be used by the system for MMTel * functionality. Must be able to handle emergency calls at any time as well. + * @hide */ - public abstract MMTelFeature onCreateEmergencyMMTelImsFeature(int slotId); + public MMTelFeature onCreateEmergencyMMTelImsFeature(int slotId) { + return null; + } /** * @return An implementation of MMTelFeature that will be used by the system for MMTel * functionality. + * @hide */ - public abstract MMTelFeature onCreateMMTelImsFeature(int slotId); + public MMTelFeature onCreateMMTelImsFeature(int slotId) { + return null; + } /** * @return An implementation of RcsFeature that will be used by the system for RCS. + * @hide */ - public abstract RcsFeature onCreateRcsFeature(int slotId); + public RcsFeature onCreateRcsFeature(int slotId) { + return null; + } } diff --git a/telephony/java/android/telephony/ims/ImsServiceBase.java b/telephony/java/android/telephony/ims/ImsServiceBase.java deleted file mode 100644 index bb36862ef25f..000000000000 --- a/telephony/java/android/telephony/ims/ImsServiceBase.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2017 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.telephony.ims; - -import android.annotation.SystemApi; -import android.app.Service; -import android.content.Intent; -import android.os.Binder; -import android.os.IBinder; - -/** - * Base ImsService Implementation, which is used by the ImsResolver to bind. ImsServices that do not - * need to provide an ImsService implementation but still wish to be managed by the ImsResolver - * lifecycle may implement this class directly. - * @hide - */ -@SystemApi -public class ImsServiceBase extends Service { - - /** - * Binder connection that does nothing but keep the connection between this Service and the - * framework active. If this service crashes, the framework will be notified. - */ - private IBinder mConnection = new Binder(); - - @Override - public IBinder onBind(Intent intent) { - return mConnection; - } - -} -- cgit v1.2.3-59-g8ed1b