Merge "Removing some of the API don't have to be @SystemApi"

This commit is contained in:
Treehugger Robot
2020-03-17 12:51:25 +00:00
committed by Gerrit Code Review
6 changed files with 17 additions and 35 deletions

View File

@@ -4619,7 +4619,6 @@ package android.net {
method @Nullable public android.net.Network getNetwork(); method @Nullable public android.net.Network getNetwork();
method public void onAddKeepalivePacketFilter(int, @NonNull android.net.KeepalivePacketData); method public void onAddKeepalivePacketFilter(int, @NonNull android.net.KeepalivePacketData);
method public void onAutomaticReconnectDisabled(); method public void onAutomaticReconnectDisabled();
method public void onBandwidthUpdateRequested();
method public void onNetworkUnwanted(); method public void onNetworkUnwanted();
method public void onRemoveKeepalivePacketFilter(int); method public void onRemoveKeepalivePacketFilter(int);
method public void onSaveAcceptUnvalidated(boolean); method public void onSaveAcceptUnvalidated(boolean);
@@ -4633,23 +4632,17 @@ package android.net {
method public void sendNetworkScore(int); method public void sendNetworkScore(int);
method public void sendSocketKeepaliveEvent(int, int); method public void sendSocketKeepaliveEvent(int, int);
method public void setConnected(); method public void setConnected();
method @Deprecated public void setLegacyExtraInfo(@Nullable String);
method @Deprecated public void setLegacySubtype(int, @NonNull String);
method public void unregister(); method public void unregister();
field public static final int VALIDATION_STATUS_NOT_VALID = 2; // 0x2 field public static final int VALIDATION_STATUS_NOT_VALID = 2; // 0x2
field public static final int VALIDATION_STATUS_VALID = 1; // 0x1 field public static final int VALIDATION_STATUS_VALID = 1; // 0x1
field public final int providerId;
} }
public final class NetworkAgentConfig implements android.os.Parcelable { public final class NetworkAgentConfig implements android.os.Parcelable {
method public int describeContents(); method public int describeContents();
method public int getLegacyType(); method public int getLegacyType();
method @NonNull public String getLegacyTypeName(); method @NonNull public String getLegacyTypeName();
method @Nullable public String getSubscriberId();
method public boolean isExplicitlySelected(); method public boolean isExplicitlySelected();
method public boolean isNat64DetectionEnabled();
method public boolean isPartialConnectivityAcceptable(); method public boolean isPartialConnectivityAcceptable();
method public boolean isProvisioningNotificationEnabled();
method public boolean isUnvalidatedConnectivityAcceptable(); method public boolean isUnvalidatedConnectivityAcceptable();
method public void writeToParcel(@NonNull android.os.Parcel, int); method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkAgentConfig> CREATOR; field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkAgentConfig> CREATOR;
@@ -4658,18 +4651,14 @@ package android.net {
public static class NetworkAgentConfig.Builder { public static class NetworkAgentConfig.Builder {
ctor public NetworkAgentConfig.Builder(); ctor public NetworkAgentConfig.Builder();
method @NonNull public android.net.NetworkAgentConfig build(); method @NonNull public android.net.NetworkAgentConfig build();
method @NonNull public android.net.NetworkAgentConfig.Builder disableNat64Detection();
method @NonNull public android.net.NetworkAgentConfig.Builder disableProvisioningNotification();
method @NonNull public android.net.NetworkAgentConfig.Builder setExplicitlySelected(boolean); method @NonNull public android.net.NetworkAgentConfig.Builder setExplicitlySelected(boolean);
method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyType(int); method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyType(int);
method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyTypeName(@NonNull String); method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyTypeName(@NonNull String);
method @NonNull public android.net.NetworkAgentConfig.Builder setPartialConnectivityAcceptable(boolean); method @NonNull public android.net.NetworkAgentConfig.Builder setPartialConnectivityAcceptable(boolean);
method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
method @NonNull public android.net.NetworkAgentConfig.Builder setUnvalidatedConnectivityAcceptable(boolean); method @NonNull public android.net.NetworkAgentConfig.Builder setUnvalidatedConnectivityAcceptable(boolean);
} }
public final class NetworkCapabilities implements android.os.Parcelable { public final class NetworkCapabilities implements android.os.Parcelable {
method public boolean deduceRestrictedCapability();
method @NonNull public java.util.List<java.lang.Integer> getAdministratorUids(); method @NonNull public java.util.List<java.lang.Integer> getAdministratorUids();
method @Nullable public String getSSID(); method @Nullable public String getSSID();
method @NonNull public int[] getTransportTypes(); method @NonNull public int[] getTransportTypes();
@@ -4694,27 +4683,9 @@ package android.net {
field public final android.net.WifiKey wifiKey; field public final android.net.WifiKey wifiKey;
} }
public class NetworkPolicyManager {
method @NonNull public android.telephony.SubscriptionPlan[] getSubscriptionPlans(int, @NonNull String);
method @RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY) public void registerSubscriptionCallback(@NonNull android.net.NetworkPolicyManager.SubscriptionCallback);
method public void setSubscriptionOverride(int, int, int, long, @NonNull String);
method public void setSubscriptionPlans(int, @NonNull android.telephony.SubscriptionPlan[], @NonNull String);
method @RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY) public void unregisterSubscriptionCallback(@NonNull android.net.NetworkPolicyManager.SubscriptionCallback);
field public static final int SUBSCRIPTION_OVERRIDE_CONGESTED = 2; // 0x2
field public static final int SUBSCRIPTION_OVERRIDE_UNMETERED = 1; // 0x1
}
public static class NetworkPolicyManager.SubscriptionCallback {
ctor public NetworkPolicyManager.SubscriptionCallback();
method public void onSubscriptionOverride(int, int, int);
method public void onSubscriptionPlansChanged(int, @NonNull android.telephony.SubscriptionPlan[]);
}
public class NetworkProvider { public class NetworkProvider {
ctor public NetworkProvider(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String); ctor public NetworkProvider(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String);
method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void declareNetworkRequestUnfulfillable(@NonNull android.net.NetworkRequest); method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void declareNetworkRequestUnfulfillable(@NonNull android.net.NetworkRequest);
method @Nullable public android.os.Messenger getMessenger();
method @NonNull public String getName();
method public int getProviderId(); method public int getProviderId();
method public void onNetworkRequested(@NonNull android.net.NetworkRequest, int, int); method public void onNetworkRequested(@NonNull android.net.NetworkRequest, int, int);
method public void onRequestWithdrawn(@NonNull android.net.NetworkRequest); method public void onRequestWithdrawn(@NonNull android.net.NetworkRequest);

View File

@@ -78,6 +78,7 @@ public abstract class NetworkAgent {
/** /**
* The ID of the {@link NetworkProvider} that created this object, or * The ID of the {@link NetworkProvider} that created this object, or
* {@link NetworkProvider#ID_NONE} if unknown. * {@link NetworkProvider#ID_NONE} if unknown.
* @hide
*/ */
public final int providerId; public final int providerId;
@@ -584,6 +585,7 @@ public abstract class NetworkAgent {
* *
* @deprecated this is for backward compatibility only. * @deprecated this is for backward compatibility only.
* @param legacySubtype the legacy subtype. * @param legacySubtype the legacy subtype.
* @hide
*/ */
@Deprecated @Deprecated
public void setLegacySubtype(final int legacySubtype, @NonNull final String legacySubtypeName) { public void setLegacySubtype(final int legacySubtype, @NonNull final String legacySubtypeName) {
@@ -608,6 +610,7 @@ public abstract class NetworkAgent {
* *
* @deprecated this is for backward compatibility only. * @deprecated this is for backward compatibility only.
* @param extraInfo the ExtraInfo. * @param extraInfo the ExtraInfo.
* @hide
*/ */
@Deprecated @Deprecated
public void setLegacyExtraInfo(@Nullable final String extraInfo) { public void setLegacyExtraInfo(@Nullable final String extraInfo) {
@@ -711,6 +714,7 @@ public abstract class NetworkAgent {
/** /**
* Called when ConnectivityService request a bandwidth update. The parent factory * Called when ConnectivityService request a bandwidth update. The parent factory
* shall try to overwrite this method and produce a bandwidth update if capable. * shall try to overwrite this method and produce a bandwidth update if capable.
* @hide
*/ */
public void onBandwidthUpdateRequested() { public void onBandwidthUpdateRequested() {
pollLceData(); pollLceData();

View File

@@ -108,6 +108,7 @@ public final class NetworkAgentConfig implements Parcelable {
/** /**
* *
* @return whether the sign in to network notification is enabled by this configuration. * @return whether the sign in to network notification is enabled by this configuration.
* @hide
*/ */
public boolean isProvisioningNotificationEnabled() { public boolean isProvisioningNotificationEnabled() {
return !provisioningNotificationDisabled; return !provisioningNotificationDisabled;
@@ -122,6 +123,7 @@ public final class NetworkAgentConfig implements Parcelable {
/** /**
* @return the subscriber ID, or null if none. * @return the subscriber ID, or null if none.
* @hide
*/ */
@Nullable @Nullable
public String getSubscriberId() { public String getSubscriberId() {
@@ -138,6 +140,7 @@ public final class NetworkAgentConfig implements Parcelable {
/** /**
* @return whether NAT64 prefix detection is enabled. * @return whether NAT64 prefix detection is enabled.
* @hide
*/ */
public boolean isNat64DetectionEnabled() { public boolean isNat64DetectionEnabled() {
return !skip464xlat; return !skip464xlat;
@@ -247,6 +250,7 @@ public final class NetworkAgentConfig implements Parcelable {
* Sets the subscriber ID for this network. * Sets the subscriber ID for this network.
* *
* @return this builder, to facilitate chaining. * @return this builder, to facilitate chaining.
* @hide
*/ */
@NonNull @NonNull
public Builder setSubscriberId(@Nullable String subscriberId) { public Builder setSubscriberId(@Nullable String subscriberId) {
@@ -259,6 +263,7 @@ public final class NetworkAgentConfig implements Parcelable {
* and reduce idle traffic on networks that are known to be IPv6-only without a NAT64. * and reduce idle traffic on networks that are known to be IPv6-only without a NAT64.
* *
* @return this builder, to facilitate chaining. * @return this builder, to facilitate chaining.
* @hide
*/ */
@NonNull @NonNull
public Builder disableNat64Detection() { public Builder disableNat64Detection() {
@@ -271,6 +276,7 @@ public final class NetworkAgentConfig implements Parcelable {
* perform its own carrier-specific provisioning procedure. * perform its own carrier-specific provisioning procedure.
* *
* @return this builder, to facilitate chaining. * @return this builder, to facilitate chaining.
* @hide
*/ */
@NonNull @NonNull
public Builder disableProvisioningNotification() { public Builder disableProvisioningNotification() {

View File

@@ -613,7 +613,6 @@ public final class NetworkCapabilities implements Parcelable {
* @return {@code true} if the network should be restricted. * @return {@code true} if the network should be restricted.
* @hide * @hide
*/ */
@SystemApi
public boolean deduceRestrictedCapability() { public boolean deduceRestrictedCapability() {
// Check if we have any capability that forces the network to be restricted. // Check if we have any capability that forces the network to be restricted.
final boolean forceRestrictedCapability = final boolean forceRestrictedCapability =

View File

@@ -21,7 +21,6 @@ import static android.content.pm.PackageManager.GET_SIGNATURES;
import android.annotation.IntDef; import android.annotation.IntDef;
import android.annotation.NonNull; import android.annotation.NonNull;
import android.annotation.RequiresPermission; import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService; import android.annotation.SystemService;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage;
@@ -56,7 +55,6 @@ import java.util.concurrent.ConcurrentHashMap;
* @hide * @hide
*/ */
@SystemService(Context.NETWORK_POLICY_SERVICE) @SystemService(Context.NETWORK_POLICY_SERVICE)
@SystemApi
public class NetworkPolicyManager { public class NetworkPolicyManager {
/* POLICY_* are masks and can be ORed, although currently they are not.*/ /* POLICY_* are masks and can be ORed, although currently they are not.*/
@@ -162,11 +160,13 @@ public class NetworkPolicyManager {
/** /**
* Mask used to check if an override value is marked as unmetered. * Mask used to check if an override value is marked as unmetered.
* @hide
*/ */
public static final int SUBSCRIPTION_OVERRIDE_UNMETERED = 1 << 0; public static final int SUBSCRIPTION_OVERRIDE_UNMETERED = 1 << 0;
/** /**
* Mask used to check if an override value is marked as congested. * Mask used to check if an override value is marked as congested.
* @hide
*/ */
public static final int SUBSCRIPTION_OVERRIDE_CONGESTED = 1 << 1; public static final int SUBSCRIPTION_OVERRIDE_CONGESTED = 1 << 1;
@@ -294,7 +294,6 @@ public class NetworkPolicyManager {
/** @hide */ /** @hide */
@RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY) @RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY)
@SystemApi
public void registerSubscriptionCallback(@NonNull SubscriptionCallback callback) { public void registerSubscriptionCallback(@NonNull SubscriptionCallback callback) {
if (callback == null) { if (callback == null) {
throw new NullPointerException("Callback cannot be null."); throw new NullPointerException("Callback cannot be null.");
@@ -309,7 +308,6 @@ public class NetworkPolicyManager {
/** @hide */ /** @hide */
@RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY) @RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY)
@SystemApi
public void unregisterSubscriptionCallback(@NonNull SubscriptionCallback callback) { public void unregisterSubscriptionCallback(@NonNull SubscriptionCallback callback) {
if (callback == null) { if (callback == null) {
throw new NullPointerException("Callback cannot be null."); throw new NullPointerException("Callback cannot be null.");
@@ -373,6 +371,7 @@ public class NetworkPolicyManager {
* requested state until explicitly cleared, or the next reboot, * requested state until explicitly cleared, or the next reboot,
* whichever happens first * whichever happens first
* @param callingPackage the name of the package making the call. * @param callingPackage the name of the package making the call.
* @hide
*/ */
public void setSubscriptionOverride(int subId, @SubscriptionOverrideMask int overrideMask, public void setSubscriptionOverride(int subId, @SubscriptionOverrideMask int overrideMask,
@SubscriptionOverrideMask int overrideValue, long timeoutMillis, @SubscriptionOverrideMask int overrideValue, long timeoutMillis,
@@ -391,6 +390,7 @@ public class NetworkPolicyManager {
* @param subId the subscriber this relationship applies to. * @param subId the subscriber this relationship applies to.
* @param plans the list of plans. * @param plans the list of plans.
* @param callingPackage the name of the package making the call * @param callingPackage the name of the package making the call
* @hide
*/ */
public void setSubscriptionPlans(int subId, @NonNull SubscriptionPlan[] plans, public void setSubscriptionPlans(int subId, @NonNull SubscriptionPlan[] plans,
@NonNull String callingPackage) { @NonNull String callingPackage) {
@@ -406,6 +406,7 @@ public class NetworkPolicyManager {
* *
* @param subId the subscriber to get the subscription plans for. * @param subId the subscriber to get the subscription plans for.
* @param callingPackage the name of the package making the call. * @param callingPackage the name of the package making the call.
* @hide
*/ */
@NonNull @NonNull
public SubscriptionPlan[] getSubscriptionPlans(int subId, @NonNull String callingPackage) { public SubscriptionPlan[] getSubscriptionPlans(int subId, @NonNull String callingPackage) {
@@ -549,7 +550,6 @@ public class NetworkPolicyManager {
} }
/** @hide */ /** @hide */
@SystemApi
public static class SubscriptionCallback { public static class SubscriptionCallback {
/** /**
* Notify clients of a new override about a given subscription. * Notify clients of a new override about a given subscription.

View File

@@ -106,10 +106,12 @@ public class NetworkProvider {
} }
// TODO: consider adding a register() method so ConnectivityManager does not need to call this. // TODO: consider adding a register() method so ConnectivityManager does not need to call this.
/** @hide */
public @Nullable Messenger getMessenger() { public @Nullable Messenger getMessenger() {
return mMessenger; return mMessenger;
} }
/** @hide */
public @NonNull String getName() { public @NonNull String getName() {
return mName; return mName;
} }