Rename NetworkMisc to NetworkAgentConfig.
am: 2dda9e0627
Change-Id: I1dae34487a5ea484c17895a2d7ae694e8ae1973a
This commit is contained in:
@@ -3173,8 +3173,8 @@ public class ConnectivityManager {
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.NETWORK_FACTORY)
|
||||
public Network registerNetworkAgent(Messenger messenger, NetworkInfo ni, LinkProperties lp,
|
||||
NetworkCapabilities nc, int score, NetworkMisc misc) {
|
||||
return registerNetworkAgent(messenger, ni, lp, nc, score, misc, NetworkProvider.ID_NONE);
|
||||
NetworkCapabilities nc, int score, NetworkAgentConfig config) {
|
||||
return registerNetworkAgent(messenger, ni, lp, nc, score, config, NetworkProvider.ID_NONE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3184,9 +3184,10 @@ public class ConnectivityManager {
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.NETWORK_FACTORY)
|
||||
public Network registerNetworkAgent(Messenger messenger, NetworkInfo ni, LinkProperties lp,
|
||||
NetworkCapabilities nc, int score, NetworkMisc misc, int providerId) {
|
||||
NetworkCapabilities nc, int score, NetworkAgentConfig config, int providerId) {
|
||||
|
||||
try {
|
||||
return mService.registerNetworkAgent(messenger, ni, lp, nc, score, misc, providerId);
|
||||
return mService.registerNetworkAgent(messenger, ni, lp, nc, score, config, providerId);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import android.app.PendingIntent;
|
||||
import android.net.ConnectionInfo;
|
||||
import android.net.LinkProperties;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkAgentConfig;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.NetworkMisc;
|
||||
import android.net.NetworkQuotaInfo;
|
||||
import android.net.NetworkRequest;
|
||||
import android.net.NetworkState;
|
||||
@@ -153,7 +153,8 @@ interface IConnectivityManager
|
||||
void declareNetworkRequestUnfulfillable(in NetworkRequest request);
|
||||
|
||||
Network registerNetworkAgent(in Messenger messenger, in NetworkInfo ni, in LinkProperties lp,
|
||||
in NetworkCapabilities nc, int score, in NetworkMisc misc, in int factorySerialNumber);
|
||||
in NetworkCapabilities nc, int score, in NetworkAgentConfig config,
|
||||
in int factorySerialNumber);
|
||||
|
||||
NetworkRequest requestNetwork(in NetworkCapabilities networkCapabilities,
|
||||
in Messenger messenger, int timeoutSec, in IBinder binder, int legacy);
|
||||
|
||||
@@ -221,8 +221,8 @@ public abstract class NetworkAgent {
|
||||
this(looper, context, logTag, ni, nc, lp, score, null, NetworkProvider.ID_NONE);
|
||||
}
|
||||
public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
|
||||
NetworkCapabilities nc, LinkProperties lp, int score, NetworkMisc misc) {
|
||||
this(looper, context, logTag, ni, nc, lp, score, misc, NetworkProvider.ID_NONE);
|
||||
NetworkCapabilities nc, LinkProperties lp, int score, NetworkAgentConfig config) {
|
||||
this(looper, context, logTag, ni, nc, lp, score, config, NetworkProvider.ID_NONE);
|
||||
}
|
||||
|
||||
public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
|
||||
@@ -231,7 +231,7 @@ public abstract class NetworkAgent {
|
||||
}
|
||||
|
||||
public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
|
||||
NetworkCapabilities nc, LinkProperties lp, int score, NetworkMisc misc,
|
||||
NetworkCapabilities nc, LinkProperties lp, int score, NetworkAgentConfig config,
|
||||
int providerId) {
|
||||
mHandler = new NetworkAgentHandler(looper);
|
||||
LOG_TAG = logTag;
|
||||
@@ -245,7 +245,7 @@ public abstract class NetworkAgent {
|
||||
ConnectivityManager cm = (ConnectivityManager)mContext.getSystemService(
|
||||
Context.CONNECTIVITY_SERVICE);
|
||||
network = cm.registerNetworkAgent(new Messenger(mHandler), new NetworkInfo(ni),
|
||||
new LinkProperties(lp), new NetworkCapabilities(nc), score, misc,
|
||||
new LinkProperties(lp), new NetworkCapabilities(nc), score, config,
|
||||
providerId);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
package android.net;
|
||||
|
||||
parcelable NetworkMisc;
|
||||
parcelable NetworkAgentConfig;
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.net;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -26,7 +28,7 @@ import android.os.Parcelable;
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public class NetworkMisc implements Parcelable {
|
||||
public class NetworkAgentConfig implements Parcelable {
|
||||
|
||||
/**
|
||||
* If the {@link Network} is a VPN, whether apps are allowed to bypass the
|
||||
@@ -83,17 +85,17 @@ public class NetworkMisc implements Parcelable {
|
||||
*/
|
||||
public boolean hasShownBroken;
|
||||
|
||||
public NetworkMisc() {
|
||||
public NetworkAgentConfig() {
|
||||
}
|
||||
|
||||
public NetworkMisc(NetworkMisc nm) {
|
||||
if (nm != null) {
|
||||
allowBypass = nm.allowBypass;
|
||||
explicitlySelected = nm.explicitlySelected;
|
||||
acceptUnvalidated = nm.acceptUnvalidated;
|
||||
subscriberId = nm.subscriberId;
|
||||
provisioningNotificationDisabled = nm.provisioningNotificationDisabled;
|
||||
skip464xlat = nm.skip464xlat;
|
||||
public NetworkAgentConfig(@Nullable NetworkAgentConfig nac) {
|
||||
if (nac != null) {
|
||||
allowBypass = nac.allowBypass;
|
||||
explicitlySelected = nac.explicitlySelected;
|
||||
acceptUnvalidated = nac.acceptUnvalidated;
|
||||
subscriberId = nac.subscriberId;
|
||||
provisioningNotificationDisabled = nac.provisioningNotificationDisabled;
|
||||
skip464xlat = nac.skip464xlat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,22 +114,23 @@ public class NetworkMisc implements Parcelable {
|
||||
out.writeInt(skip464xlat ? 1 : 0);
|
||||
}
|
||||
|
||||
public static final @android.annotation.NonNull Creator<NetworkMisc> CREATOR = new Creator<NetworkMisc>() {
|
||||
public static final @NonNull Creator<NetworkAgentConfig> CREATOR =
|
||||
new Creator<NetworkAgentConfig>() {
|
||||
@Override
|
||||
public NetworkMisc createFromParcel(Parcel in) {
|
||||
NetworkMisc networkMisc = new NetworkMisc();
|
||||
networkMisc.allowBypass = in.readInt() != 0;
|
||||
networkMisc.explicitlySelected = in.readInt() != 0;
|
||||
networkMisc.acceptUnvalidated = in.readInt() != 0;
|
||||
networkMisc.subscriberId = in.readString();
|
||||
networkMisc.provisioningNotificationDisabled = in.readInt() != 0;
|
||||
networkMisc.skip464xlat = in.readInt() != 0;
|
||||
return networkMisc;
|
||||
public NetworkAgentConfig createFromParcel(Parcel in) {
|
||||
NetworkAgentConfig networkAgentConfig = new NetworkAgentConfig();
|
||||
networkAgentConfig.allowBypass = in.readInt() != 0;
|
||||
networkAgentConfig.explicitlySelected = in.readInt() != 0;
|
||||
networkAgentConfig.acceptUnvalidated = in.readInt() != 0;
|
||||
networkAgentConfig.subscriberId = in.readString();
|
||||
networkAgentConfig.provisioningNotificationDisabled = in.readInt() != 0;
|
||||
networkAgentConfig.skip464xlat = in.readInt() != 0;
|
||||
return networkAgentConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NetworkMisc[] newArray(int size) {
|
||||
return new NetworkMisc[size];
|
||||
public NetworkAgentConfig[] newArray(int size) {
|
||||
return new NetworkAgentConfig[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user