diff options
| -rw-r--r-- | api/system-current.txt | 12 | ||||
| -rw-r--r-- | telephony/java/android/telephony/NetworkService.java | 18 | ||||
| -rw-r--r-- | telephony/java/android/telephony/data/DataService.java | 18 | ||||
| -rw-r--r-- | telephony/java/android/telephony/data/QualifiedNetworksService.java | 2 |
4 files changed, 22 insertions, 28 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index cc93bbafd046..b4fce5d4bbe3 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5730,16 +5730,15 @@ package android.telephony { public abstract class NetworkService extends android.app.Service { ctor public NetworkService(); method protected abstract android.telephony.NetworkService.NetworkServiceProvider createNetworkServiceProvider(int); - field public static final java.lang.String NETWORK_SERVICE_EXTRA_SLOT_ID = "android.telephony.extra.SLOT_ID"; field public static final java.lang.String NETWORK_SERVICE_INTERFACE = "android.telephony.NetworkService"; } - public class NetworkService.NetworkServiceProvider { + public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable { ctor public NetworkService.NetworkServiceProvider(int); + method public abstract void close(); method public void getNetworkRegistrationState(int, android.telephony.NetworkServiceCallback); method public final int getSlotId(); method public final void notifyNetworkRegistrationStateChanged(); - method protected void onDestroy(); } public class NetworkServiceCallback { @@ -6079,20 +6078,19 @@ package android.telephony.data { public abstract class DataService extends android.app.Service { ctor public DataService(); method public abstract android.telephony.data.DataService.DataServiceProvider createDataServiceProvider(int); - field public static final java.lang.String DATA_SERVICE_EXTRA_SLOT_ID = "android.telephony.data.extra.SLOT_ID"; field public static final java.lang.String DATA_SERVICE_INTERFACE = "android.telephony.data.DataService"; field public static final int REQUEST_REASON_HANDOVER = 3; // 0x3 field public static final int REQUEST_REASON_NORMAL = 1; // 0x1 field public static final int REQUEST_REASON_SHUTDOWN = 2; // 0x2 } - public class DataService.DataServiceProvider { + public abstract class DataService.DataServiceProvider implements java.lang.AutoCloseable { ctor public DataService.DataServiceProvider(int); + method public abstract void close(); method public void deactivateDataCall(int, int, android.telephony.data.DataServiceCallback); method public void getDataCallList(android.telephony.data.DataServiceCallback); method public final int getSlotId(); method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>); - method protected void onDestroy(); method public void setDataProfile(java.util.List<android.telephony.data.DataProfile>, boolean, android.telephony.data.DataServiceCallback); method public void setInitialAttachApn(android.telephony.data.DataProfile, boolean, android.telephony.data.DataServiceCallback); method public void setupDataCall(int, android.telephony.data.DataProfile, boolean, boolean, int, android.net.LinkProperties, android.telephony.data.DataServiceCallback); @@ -6614,8 +6612,8 @@ package android.telephony.ims { field public static final int CODE_SIP_SERVER_TIMEOUT = 353; // 0x161 field public static final int CODE_SIP_SERVICE_UNAVAILABLE = 352; // 0x160 field public static final int CODE_SIP_TEMPRARILY_UNAVAILABLE = 336; // 0x150 - field public static final int CODE_SIP_TRANSACTION_DOES_NOT_EXIST = 343; // 0x157 field public static final int CODE_SIP_TOO_MANY_HOPS = 374; // 0x176 + field public static final int CODE_SIP_TRANSACTION_DOES_NOT_EXIST = 343; // 0x157 field public static final int CODE_SIP_UNDECIPHERABLE = 378; // 0x17a field public static final int CODE_SIP_USER_MARKED_UNWANTED = 365; // 0x16d field public static final int CODE_SIP_USER_REJECTED = 361; // 0x169 diff --git a/telephony/java/android/telephony/NetworkService.java b/telephony/java/android/telephony/NetworkService.java index 4354314dac29..4bca404d9444 100644 --- a/telephony/java/android/telephony/NetworkService.java +++ b/telephony/java/android/telephony/NetworkService.java @@ -16,7 +16,6 @@ package android.telephony; -import android.annotation.CallSuper; import android.annotation.SystemApi; import android.app.Service; import android.content.Intent; @@ -53,7 +52,6 @@ public abstract class NetworkService extends Service { private final String TAG = NetworkService.class.getSimpleName(); public static final String NETWORK_SERVICE_INTERFACE = "android.telephony.NetworkService"; - public static final String NETWORK_SERVICE_EXTRA_SLOT_ID = "android.telephony.extra.SLOT_ID"; private static final int NETWORK_SERVICE_CREATE_NETWORK_SERVICE_PROVIDER = 1; private static final int NETWORK_SERVICE_REMOVE_NETWORK_SERVICE_PROVIDER = 2; @@ -81,7 +79,7 @@ public abstract class NetworkService extends Service { * must extend this class to support network connection. Note that each instance of network * service is associated with one physical SIM slot. */ - public class NetworkServiceProvider { + public abstract class NetworkServiceProvider implements AutoCloseable { private final int mSlotId; private final List<INetworkServiceCallback> @@ -137,12 +135,12 @@ public abstract class NetworkService extends Service { } /** - * Called when the instance of network service is destroyed (e.g. got unbind or binder died). + * Called when the instance of network service is destroyed (e.g. got unbind or binder died) + * or when the network service provider is removed. The extended class should implement this + * method to perform cleanup works. */ - @CallSuper - protected void onDestroy() { - mNetworkRegistrationStateChangedCallbacks.clear(); - } + @Override + public abstract void close(); } private class NetworkServiceHandler extends Handler { @@ -168,7 +166,7 @@ public abstract class NetworkService extends Service { case NETWORK_SERVICE_REMOVE_NETWORK_SERVICE_PROVIDER: // If the service provider doesn't exist yet, we try to create it. if (serviceProvider != null) { - serviceProvider.onDestroy(); + serviceProvider.close(); mServiceMap.remove(slotId); } break; @@ -176,7 +174,7 @@ public abstract class NetworkService extends Service { for (int i = 0; i < mServiceMap.size(); i++) { serviceProvider = mServiceMap.get(i); if (serviceProvider != null) { - serviceProvider.onDestroy(); + serviceProvider.close(); } } mServiceMap.clear(); diff --git a/telephony/java/android/telephony/data/DataService.java b/telephony/java/android/telephony/data/DataService.java index 1db58506bb1c..74d1e838f186 100644 --- a/telephony/java/android/telephony/data/DataService.java +++ b/telephony/java/android/telephony/data/DataService.java @@ -16,7 +16,6 @@ package android.telephony.data; -import android.annotation.CallSuper; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -60,7 +59,6 @@ public abstract class DataService extends Service { private static final String TAG = DataService.class.getSimpleName(); public static final String DATA_SERVICE_INTERFACE = "android.telephony.data.DataService"; - public static final String DATA_SERVICE_EXTRA_SLOT_ID = "android.telephony.data.extra.SLOT_ID"; /** {@hide} */ @IntDef(prefix = "REQUEST_REASON_", value = { @@ -116,7 +114,7 @@ public abstract class DataService extends Service { * must extend this class to support data connection. Note that each instance of data service * provider is associated with one physical SIM slot. */ - public class DataServiceProvider { + public abstract class DataServiceProvider implements AutoCloseable { private final int mSlotId; @@ -250,12 +248,12 @@ public abstract class DataService extends Service { } /** - * Called when the instance of data service is destroyed (e.g. got unbind or binder died). + * Called when the instance of data service is destroyed (e.g. got unbind or binder died) + * or when the data service provider is removed. The extended class should implement this + * method to perform cleanup works. */ - @CallSuper - protected void onDestroy() { - mDataCallListChangedCallbacks.clear(); - } + @Override + public abstract void close(); } private static final class SetupDataCallRequest { @@ -345,7 +343,7 @@ public abstract class DataService extends Service { break; case DATA_SERVICE_REMOVE_DATA_SERVICE_PROVIDER: if (serviceProvider != null) { - serviceProvider.onDestroy(); + serviceProvider.close(); mServiceMap.remove(slotId); } break; @@ -353,7 +351,7 @@ public abstract class DataService extends Service { for (int i = 0; i < mServiceMap.size(); i++) { serviceProvider = mServiceMap.get(i); if (serviceProvider != null) { - serviceProvider.onDestroy(); + serviceProvider.close(); } } mServiceMap.clear(); diff --git a/telephony/java/android/telephony/data/QualifiedNetworksService.java b/telephony/java/android/telephony/data/QualifiedNetworksService.java index 57d9cced53b1..45b4849990c2 100644 --- a/telephony/java/android/telephony/data/QualifiedNetworksService.java +++ b/telephony/java/android/telephony/data/QualifiedNetworksService.java @@ -151,7 +151,7 @@ public abstract class QualifiedNetworksService extends Service { /** * Called when the qualified networks updater is removed. The extended class should - * implement this method to perform clean up works. + * implement this method to perform cleanup works. */ @Override public abstract void close(); |