Merge "Renamed data/net service provider onDestroy to close"
This commit is contained in:
@@ -5081,16 +5081,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 {
|
||||
@@ -5427,20 +5426,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);
|
||||
@@ -5959,8 +5957,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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user