diff options
| author | 2017-04-11 23:12:07 +0000 | |
|---|---|---|
| committer | 2017-04-11 23:12:11 +0000 | |
| commit | 509a311976e83d21eb0b69c3877c98aaaab5a88e (patch) | |
| tree | addb2e3f1f43bd8eeef10e955b4dc5cddf145c19 | |
| parent | b287e9907a6757e8c5f3176b950a6e83df063e39 (diff) | |
| parent | 7bb85871331f261f48ff5e6c91d9d84f9751c3a0 (diff) | |
Merge "Move @SystemApi access to ImsService" into oc-dev
| -rw-r--r-- | api/system-current.txt | 4 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/ImsService.java | 42 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/ImsServiceBase.java | 45 |
3 files changed, 35 insertions, 56 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 29a869f4eb0a..23dc949a961d 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -43874,8 +43874,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<SparseArray<ImsFeature>> 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<ImsFeature> getImsFeatureMap(int slotId) { return mFeatures.get(slotId); } + /** + * @hide + */ @VisibleForTesting // Be sure to lock on mFeatures before accessing this method public ImsFeature getImsFeatureFromType(SparseArray<ImsFeature> 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; - } - -} |