Merge changes I6d267dda,I2a9aa02b into main
* changes: Use java_aconfig_library for nearby and thread flags Use java_aconfig_library for android_core_networking flags
This commit is contained in:
commit
a22fdc2214
28 changed files with 108 additions and 171 deletions
|
|
@ -215,6 +215,7 @@ bootclasspath_fragment {
|
|||
"android.net.nsd",
|
||||
"android.net.thread",
|
||||
"android.net.wear",
|
||||
"android.net.http.internal",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,9 @@ java_defaults {
|
|||
":framework-tethering-srcs",
|
||||
],
|
||||
libs: ["framework-connectivity.stubs.module_lib"],
|
||||
static_libs: [
|
||||
"com.android.net.flags-aconfig-java",
|
||||
],
|
||||
aidl: {
|
||||
include_dirs: [
|
||||
"packages/modules/Connectivity/framework/aidl-export",
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import android.util.ArraySet;
|
|||
import android.util.Log;
|
||||
|
||||
import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.net.flags.Flags;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
|
@ -62,16 +63,6 @@ import java.util.function.Supplier;
|
|||
*/
|
||||
@SystemApi
|
||||
public class TetheringManager {
|
||||
// TODO : remove this class when udc-mainline-prod is abandoned and android.net.flags.Flags is
|
||||
// available here
|
||||
/** @hide */
|
||||
public static class Flags {
|
||||
static final String TETHERING_REQUEST_WITH_SOFT_AP_CONFIG =
|
||||
"com.android.net.flags.tethering_request_with_soft_ap_config";
|
||||
static final String TETHERING_REQUEST_VIRTUAL =
|
||||
"com.android.net.flags.tethering_request_virtual";
|
||||
}
|
||||
|
||||
private static final String TAG = TetheringManager.class.getSimpleName();
|
||||
private static final int DEFAULT_TIMEOUT_MS = 60_000;
|
||||
private static final long CONNECTOR_POLL_INTERVAL_MILLIS = 200L;
|
||||
|
|
@ -204,7 +195,7 @@ public class TetheringManager {
|
|||
* AVF(Android Virtualization Framework).
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.TETHERING_REQUEST_VIRTUAL)
|
||||
@FlaggedApi(Flags.FLAG_TETHERING_REQUEST_VIRTUAL)
|
||||
@SystemApi
|
||||
public static final int TETHERING_VIRTUAL = 7;
|
||||
|
||||
|
|
@ -705,7 +696,7 @@ public class TetheringManager {
|
|||
/**
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
@FlaggedApi(Flags.FLAG_TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
public TetheringRequest(@NonNull final TetheringRequestParcel request) {
|
||||
mRequestParcel = request;
|
||||
}
|
||||
|
|
@ -714,7 +705,7 @@ public class TetheringManager {
|
|||
mRequestParcel = in.readParcelable(TetheringRequestParcel.class.getClassLoader());
|
||||
}
|
||||
|
||||
@FlaggedApi(Flags.TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
@FlaggedApi(Flags.FLAG_TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
@NonNull
|
||||
public static final Creator<TetheringRequest> CREATOR = new Creator<>() {
|
||||
@Override
|
||||
|
|
@ -728,13 +719,13 @@ public class TetheringManager {
|
|||
}
|
||||
};
|
||||
|
||||
@FlaggedApi(Flags.TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
@FlaggedApi(Flags.FLAG_TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@FlaggedApi(Flags.TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
@FlaggedApi(Flags.FLAG_TETHERING_REQUEST_WITH_SOFT_AP_CONFIG)
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
dest.writeParcelable(mRequestParcel, flags);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,16 @@ aconfig_declarations {
|
|||
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
||||
}
|
||||
|
||||
java_aconfig_library {
|
||||
name: "com.android.net.thread.flags-aconfig-java",
|
||||
aconfig_declarations: "com.android.net.thread.flags-aconfig",
|
||||
defaults: ["framework-minus-apex-aconfig-java-defaults"],
|
||||
min_sdk_version: "30",
|
||||
apex_available: [
|
||||
"com.android.tethering",
|
||||
],
|
||||
}
|
||||
|
||||
aconfig_declarations {
|
||||
name: "nearby_flags",
|
||||
package: "com.android.nearby.flags",
|
||||
|
|
@ -48,6 +58,16 @@ aconfig_declarations {
|
|||
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
||||
}
|
||||
|
||||
java_aconfig_library {
|
||||
name: "com.android.nearby.flags-aconfig-java",
|
||||
aconfig_declarations: "nearby_flags",
|
||||
defaults: ["framework-minus-apex-aconfig-java-defaults"],
|
||||
min_sdk_version: "30",
|
||||
apex_available: [
|
||||
"com.android.tethering",
|
||||
],
|
||||
}
|
||||
|
||||
aconfig_declarations {
|
||||
name: "com.android.networksecurity.flags-aconfig",
|
||||
package: "com.android.net.ct.flags",
|
||||
|
|
|
|||
|
|
@ -8,3 +8,11 @@ flag {
|
|||
description: "Controls whether the Android Thread feature is enabled"
|
||||
bug: "301473012"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "configuration_enabled"
|
||||
is_exported: true
|
||||
namespace: "thread_network"
|
||||
description: "Controls whether the Android Thread configuration is enabled"
|
||||
bug: "342519412"
|
||||
}
|
||||
|
|
@ -62,6 +62,8 @@ java_defaults {
|
|||
static_libs: [
|
||||
// Cannot go to framework-connectivity because mid_sdk checks require 31.
|
||||
"modules-utils-binary-xml",
|
||||
"com.android.nearby.flags-aconfig-java",
|
||||
"com.android.net.thread.flags-aconfig-java",
|
||||
],
|
||||
impl_only_libs: [
|
||||
// The build system will use framework-bluetooth module_current stubs, because
|
||||
|
|
@ -97,20 +99,6 @@ filegroup {
|
|||
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
||||
}
|
||||
|
||||
// The filegroup lists files that are necessary for verifying building mdns as a standalone,
|
||||
// for use with service-connectivity-mdns-standalone-build-test
|
||||
// This filegroup should never be included in anywhere in the module build. It is only used for
|
||||
// building service-connectivity-mdns-standalone-build-test target. The files will be renamed by
|
||||
// copybara to prevent them from being shadowed by the bootclasspath copies.
|
||||
filegroup {
|
||||
name: "framework-connectivity-t-mdns-standalone-build-sources",
|
||||
srcs: [
|
||||
"src/android/net/nsd/OffloadEngine.java",
|
||||
"src/android/net/nsd/OffloadServiceInfo.java",
|
||||
],
|
||||
visibility: ["//packages/modules/Connectivity:__subpackages__"],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "framework-connectivity-t-pre-jarjar",
|
||||
defaults: ["framework-connectivity-t-defaults"],
|
||||
|
|
@ -141,6 +129,8 @@ java_sdk_library {
|
|||
// been included in static_libs might still need to
|
||||
// be in stub_only_libs to be usable when generating the API stubs.
|
||||
"com.android.net.flags-aconfig-java",
|
||||
"com.android.nearby.flags-aconfig-java",
|
||||
"com.android.net.thread.flags-aconfig-java",
|
||||
// Use prebuilt framework-connectivity stubs to avoid circular dependencies
|
||||
"sdk_module-lib_current_framework-connectivity",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -65,13 +65,6 @@ import java.util.Objects;
|
|||
public class IpSecManager {
|
||||
private static final String TAG = "IpSecManager";
|
||||
|
||||
// TODO : remove this class when udc-mainline-prod is abandoned and android.net.flags.Flags is
|
||||
// available here
|
||||
/** @hide */
|
||||
public static class Flags {
|
||||
static final String IPSEC_TRANSFORM_STATE = "com.android.net.flags.ipsec_transform_state";
|
||||
}
|
||||
|
||||
/**
|
||||
* Feature flag to declare the kernel support of updating IPsec SAs.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
*/
|
||||
package android.net;
|
||||
|
||||
import static android.net.IpSecManager.Flags.IPSEC_TRANSFORM_STATE;
|
||||
import static android.net.IpSecManager.INVALID_RESOURCE_ID;
|
||||
|
||||
import android.annotation.CallbackExecutor;
|
||||
|
|
@ -35,6 +34,7 @@ import android.os.ServiceSpecificException;
|
|||
import android.util.Log;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.net.flags.Flags;
|
||||
|
||||
import dalvik.system.CloseGuard;
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ public final class IpSecTransform implements AutoCloseable {
|
|||
* occurs.
|
||||
* @see IpSecTransformState
|
||||
*/
|
||||
@FlaggedApi(IPSEC_TRANSFORM_STATE)
|
||||
@FlaggedApi(Flags.FLAG_IPSEC_TRANSFORM_STATE)
|
||||
public void requestIpSecTransformState(
|
||||
@CallbackExecutor @NonNull Executor executor,
|
||||
@NonNull OutcomeReceiver<IpSecTransformState, RuntimeException> callback) {
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@
|
|||
*/
|
||||
package android.net;
|
||||
|
||||
import static android.net.IpSecManager.Flags.IPSEC_TRANSFORM_STATE;
|
||||
|
||||
import static com.android.internal.annotations.VisibleForTesting.Visibility;
|
||||
|
||||
import android.annotation.FlaggedApi;
|
||||
|
|
@ -26,6 +24,7 @@ import android.os.Parcelable;
|
|||
import android.os.SystemClock;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.net.flags.Flags;
|
||||
import com.android.net.module.util.HexDump;
|
||||
|
||||
import java.util.Objects;
|
||||
|
|
@ -39,7 +38,7 @@ import java.util.Objects;
|
|||
* IpSecTransformStates at two timestamps. By comparing the changes in packet counts and sequence
|
||||
* numbers, callers can estimate IPsec data loss in the inbound direction.
|
||||
*/
|
||||
@FlaggedApi(IPSEC_TRANSFORM_STATE)
|
||||
@FlaggedApi(Flags.FLAG_IPSEC_TRANSFORM_STATE)
|
||||
public final class IpSecTransformState implements Parcelable {
|
||||
private final long mTimestamp;
|
||||
private final long mTxHighestSequenceNumber;
|
||||
|
|
@ -197,7 +196,7 @@ public final class IpSecTransformState implements Parcelable {
|
|||
* <p>Except for testing, IPsec callers normally do not instantiate {@link IpSecTransformState}
|
||||
* themselves but instead get a reference via {@link IpSecTransformState}
|
||||
*/
|
||||
@FlaggedApi(IPSEC_TRANSFORM_STATE)
|
||||
@FlaggedApi(Flags.FLAG_IPSEC_TRANSFORM_STATE)
|
||||
public static final class Builder {
|
||||
private long mTimestamp;
|
||||
private long mTxHighestSequenceNumber;
|
||||
|
|
|
|||
|
|
@ -24,12 +24,14 @@ import android.os.Parcel;
|
|||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.net.flags.Flags;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Encapsulates parameters for {@link NsdManager#discoverServices}.
|
||||
*/
|
||||
@FlaggedApi(NsdManager.Flags.NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
@FlaggedApi(Flags.FLAG_NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
public final class DiscoveryRequest implements Parcelable {
|
||||
private final int mProtocolType;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import android.util.SparseArray;
|
|||
import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.modules.utils.build.SdkLevel;
|
||||
import com.android.net.flags.Flags;
|
||||
import com.android.net.module.util.CollectionUtils;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
|
|
@ -148,22 +149,6 @@ public final class NsdManager {
|
|||
private static final String TAG = NsdManager.class.getSimpleName();
|
||||
private static final boolean DBG = false;
|
||||
|
||||
// TODO : remove this class when udc-mainline-prod is abandoned and android.net.flags.Flags is
|
||||
// available here
|
||||
/** @hide */
|
||||
public static class Flags {
|
||||
static final String REGISTER_NSD_OFFLOAD_ENGINE_API =
|
||||
"com.android.net.flags.register_nsd_offload_engine_api";
|
||||
static final String NSD_SUBTYPES_SUPPORT_ENABLED =
|
||||
"com.android.net.flags.nsd_subtypes_support_enabled";
|
||||
static final String ADVERTISE_REQUEST_API =
|
||||
"com.android.net.flags.advertise_request_api";
|
||||
static final String NSD_CUSTOM_HOSTNAME_ENABLED =
|
||||
"com.android.net.flags.nsd_custom_hostname_enabled";
|
||||
static final String NSD_CUSTOM_TTL_ENABLED =
|
||||
"com.android.net.flags.nsd_custom_ttl_enabled";
|
||||
}
|
||||
|
||||
/**
|
||||
* A regex for the acceptable format of a type or subtype label.
|
||||
* @hide
|
||||
|
|
@ -451,7 +436,7 @@ public final class NsdManager {
|
|||
*
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(NsdManager.Flags.REGISTER_NSD_OFFLOAD_ENGINE_API)
|
||||
@FlaggedApi(Flags.FLAG_REGISTER_NSD_OFFLOAD_ENGINE_API)
|
||||
@SystemApi
|
||||
@RequiresPermission(anyOf = {NETWORK_SETTINGS, PERMISSION_MAINLINE_NETWORK_STACK,
|
||||
NETWORK_STACK})
|
||||
|
|
@ -489,7 +474,7 @@ public final class NsdManager {
|
|||
*
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(NsdManager.Flags.REGISTER_NSD_OFFLOAD_ENGINE_API)
|
||||
@FlaggedApi(Flags.FLAG_REGISTER_NSD_OFFLOAD_ENGINE_API)
|
||||
@SystemApi
|
||||
@RequiresPermission(anyOf = {NETWORK_SETTINGS, PERMISSION_MAINLINE_NETWORK_STACK,
|
||||
NETWORK_STACK})
|
||||
|
|
@ -1506,7 +1491,7 @@ public final class NsdManager {
|
|||
* @param listener The listener notifies of a successful discovery and is used
|
||||
* to stop discovery on this serviceType through a call on {@link #stopServiceDiscovery}.
|
||||
*/
|
||||
@FlaggedApi(Flags.NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
@FlaggedApi(Flags.FLAG_NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
public void discoverServices(@NonNull DiscoveryRequest discoveryRequest,
|
||||
@NonNull Executor executor, @NonNull DiscoveryListener listener) {
|
||||
int key = putListener(listener, executor, discoveryRequest);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import android.util.ArrayMap;
|
|||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.net.flags.Flags;
|
||||
import com.android.net.module.util.InetAddressUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
|
@ -527,7 +528,7 @@ public final class NsdServiceInfo implements Parcelable {
|
|||
* Only one subtype will be registered if multiple elements of {@code subtypes} have the same
|
||||
* case-insensitive value.
|
||||
*/
|
||||
@FlaggedApi(NsdManager.Flags.NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
@FlaggedApi(Flags.FLAG_NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
public void setSubtypes(@NonNull Set<String> subtypes) {
|
||||
mSubtypes.clear();
|
||||
mSubtypes.addAll(subtypes);
|
||||
|
|
@ -540,7 +541,7 @@ public final class NsdServiceInfo implements Parcelable {
|
|||
* NsdManager.DiscoveryListener}), the return value may or may not include the subtypes of this
|
||||
* service.
|
||||
*/
|
||||
@FlaggedApi(NsdManager.Flags.NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
@FlaggedApi(Flags.FLAG_NSD_SUBTYPES_SUPPORT_ENABLED)
|
||||
@NonNull
|
||||
public Set<String> getSubtypes() {
|
||||
return Collections.unmodifiableSet(mSubtypes);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ import android.annotation.LongDef;
|
|||
import android.annotation.NonNull;
|
||||
import android.annotation.SystemApi;
|
||||
|
||||
import com.android.net.flags.Flags;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
|
|
@ -34,7 +36,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
*
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi("com.android.net.flags.register_nsd_offload_engine_api")
|
||||
@FlaggedApi(Flags.FLAG_REGISTER_NSD_OFFLOAD_ENGINE_API)
|
||||
@SystemApi
|
||||
public interface OffloadEngine {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import android.os.Build;
|
|||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.android.net.flags.Flags;
|
||||
import com.android.net.module.util.HexDump;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -40,7 +41,7 @@ import java.util.Objects;
|
|||
*
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi("com.android.net.flags.register_nsd_offload_engine_api")
|
||||
@FlaggedApi(Flags.FLAG_REGISTER_NSD_OFFLOAD_ENGINE_API)
|
||||
@SystemApi
|
||||
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
|
||||
public final class OffloadServiceInfo implements Parcelable {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ import android.util.SparseIntArray;
|
|||
import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.modules.utils.build.SdkLevel;
|
||||
import com.android.net.flags.Flags;
|
||||
|
||||
import libcore.net.event.NetworkEventDispatcher;
|
||||
|
||||
|
|
@ -125,24 +126,6 @@ public class ConnectivityManager {
|
|||
private static final String TAG = "ConnectivityManager";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
// TODO : remove this class when udc-mainline-prod is abandoned and android.net.flags.Flags is
|
||||
// available here
|
||||
/** @hide */
|
||||
public static class Flags {
|
||||
static final String SET_DATA_SAVER_VIA_CM =
|
||||
"com.android.net.flags.set_data_saver_via_cm";
|
||||
static final String SUPPORT_IS_UID_NETWORKING_BLOCKED =
|
||||
"com.android.net.flags.support_is_uid_networking_blocked";
|
||||
static final String BASIC_BACKGROUND_RESTRICTIONS_ENABLED =
|
||||
"com.android.net.flags.basic_background_restrictions_enabled";
|
||||
static final String METERED_NETWORK_FIREWALL_CHAINS =
|
||||
"com.android.net.flags.metered_network_firewall_chains";
|
||||
static final String BLOCKED_REASON_OEM_DENY_CHAINS =
|
||||
"com.android.net.flags.blocked_reason_oem_deny_chains";
|
||||
static final String BLOCKED_REASON_NETWORK_RESTRICTED =
|
||||
"com.android.net.flags.blocked_reason_network_restricted";
|
||||
}
|
||||
|
||||
/**
|
||||
* A change in network connectivity has occurred. A default connection has either
|
||||
* been established or lost. The NetworkInfo for the affected network is
|
||||
|
|
@ -919,7 +902,7 @@ public class ConnectivityManager {
|
|||
*
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.BASIC_BACKGROUND_RESTRICTIONS_ENABLED)
|
||||
@FlaggedApi(Flags.FLAG_BASIC_BACKGROUND_RESTRICTIONS_ENABLED)
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_APP_BACKGROUND = 1 << 6;
|
||||
|
||||
|
|
@ -932,7 +915,7 @@ public class ConnectivityManager {
|
|||
* @see #FIREWALL_CHAIN_OEM_DENY_3
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.BLOCKED_REASON_OEM_DENY_CHAINS)
|
||||
@FlaggedApi(Flags.FLAG_BLOCKED_REASON_OEM_DENY_CHAINS)
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_OEM_DENY = 1 << 7;
|
||||
|
||||
|
|
@ -943,7 +926,7 @@ public class ConnectivityManager {
|
|||
*
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.BLOCKED_REASON_NETWORK_RESTRICTED)
|
||||
@FlaggedApi(Flags.FLAG_BLOCKED_REASON_NETWORK_RESTRICTED)
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final int BLOCKED_REASON_NETWORK_RESTRICTED = 1 << 8;
|
||||
|
||||
|
|
@ -1052,7 +1035,7 @@ public class ConnectivityManager {
|
|||
* exempted for specific situations while in the background.
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.BASIC_BACKGROUND_RESTRICTIONS_ENABLED)
|
||||
@FlaggedApi(Flags.FLAG_BASIC_BACKGROUND_RESTRICTIONS_ENABLED)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
public static final int FIREWALL_CHAIN_BACKGROUND = 6;
|
||||
|
||||
|
|
@ -1120,7 +1103,7 @@ public class ConnectivityManager {
|
|||
* @hide
|
||||
*/
|
||||
// TODO: Merge this chain with data saver and support setFirewallChainEnabled
|
||||
@FlaggedApi(Flags.METERED_NETWORK_FIREWALL_CHAINS)
|
||||
@FlaggedApi(Flags.FLAG_METERED_NETWORK_FIREWALL_CHAINS)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
public static final int FIREWALL_CHAIN_METERED_ALLOW = 10;
|
||||
|
||||
|
|
@ -1139,7 +1122,7 @@ public class ConnectivityManager {
|
|||
* @hide
|
||||
*/
|
||||
// TODO: Support setFirewallChainEnabled to control this chain
|
||||
@FlaggedApi(Flags.METERED_NETWORK_FIREWALL_CHAINS)
|
||||
@FlaggedApi(Flags.FLAG_METERED_NETWORK_FIREWALL_CHAINS)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
public static final int FIREWALL_CHAIN_METERED_DENY_USER = 11;
|
||||
|
||||
|
|
@ -1158,7 +1141,7 @@ public class ConnectivityManager {
|
|||
* @hide
|
||||
*/
|
||||
// TODO: Support setFirewallChainEnabled to control this chain
|
||||
@FlaggedApi(Flags.METERED_NETWORK_FIREWALL_CHAINS)
|
||||
@FlaggedApi(Flags.FLAG_METERED_NETWORK_FIREWALL_CHAINS)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
public static final int FIREWALL_CHAIN_METERED_DENY_ADMIN = 12;
|
||||
|
||||
|
|
@ -6453,7 +6436,7 @@ public class ConnectivityManager {
|
|||
* @throws IllegalStateException if failed.
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.SET_DATA_SAVER_VIA_CM)
|
||||
@FlaggedApi(Flags.FLAG_SET_DATA_SAVER_VIA_CM)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
@RequiresPermission(anyOf = {
|
||||
android.Manifest.permission.NETWORK_SETTINGS,
|
||||
|
|
@ -6714,7 +6697,7 @@ public class ConnectivityManager {
|
|||
// is provided by linux file group permission AID_NET_BW_ACCT and the
|
||||
// selinux context fs_bpf_net*.
|
||||
// Only the system server process and the network stack have access.
|
||||
@FlaggedApi(Flags.SUPPORT_IS_UID_NETWORKING_BLOCKED)
|
||||
@FlaggedApi(Flags.FLAG_SUPPORT_IS_UID_NETWORKING_BLOCKED)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
// Note b/326143935 kernel bug can trigger crash on some T device.
|
||||
@RequiresApi(VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import android.util.Range;
|
|||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.modules.utils.build.SdkLevel;
|
||||
import com.android.net.flags.Flags;
|
||||
import com.android.net.module.util.BitUtils;
|
||||
import com.android.net.module.util.CollectionUtils;
|
||||
import com.android.net.module.util.NetworkCapabilitiesUtils;
|
||||
|
|
@ -124,22 +125,6 @@ import java.util.StringJoiner;
|
|||
public final class NetworkCapabilities implements Parcelable {
|
||||
private static final String TAG = "NetworkCapabilities";
|
||||
|
||||
// TODO : remove this class when udc-mainline-prod is abandoned and android.net.flags.Flags is
|
||||
// available here
|
||||
/** @hide */
|
||||
public static class Flags {
|
||||
static final String FLAG_FORBIDDEN_CAPABILITY =
|
||||
"com.android.net.flags.forbidden_capability";
|
||||
static final String FLAG_NET_CAPABILITY_LOCAL_NETWORK =
|
||||
"com.android.net.flags.net_capability_local_network";
|
||||
static final String REQUEST_RESTRICTED_WIFI =
|
||||
"com.android.net.flags.request_restricted_wifi";
|
||||
static final String SUPPORT_TRANSPORT_SATELLITE =
|
||||
"com.android.net.flags.support_transport_satellite";
|
||||
static final String NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED =
|
||||
"com.android.net.flags.net_capability_not_bandwidth_constrained";
|
||||
}
|
||||
|
||||
/**
|
||||
* Mechanism to support redaction of fields in NetworkCapabilities that are guarded by specific
|
||||
* app permissions.
|
||||
|
|
@ -761,7 +746,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||
* usage on constrained networks, such as disabling network access to apps that are not in the
|
||||
* foreground.
|
||||
*/
|
||||
@FlaggedApi(Flags.NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED)
|
||||
@FlaggedApi(Flags.FLAG_NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED)
|
||||
public static final int NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED = 37;
|
||||
|
||||
private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED;
|
||||
|
|
@ -1374,7 +1359,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||
/**
|
||||
* Indicates this network uses a Satellite transport.
|
||||
*/
|
||||
@FlaggedApi(Flags.SUPPORT_TRANSPORT_SATELLITE)
|
||||
@FlaggedApi(Flags.FLAG_SUPPORT_TRANSPORT_SATELLITE)
|
||||
public static final int TRANSPORT_SATELLITE = 10;
|
||||
|
||||
/** @hide */
|
||||
|
|
@ -2864,7 +2849,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||
* @return
|
||||
*/
|
||||
@NonNull
|
||||
@FlaggedApi(Flags.REQUEST_RESTRICTED_WIFI)
|
||||
@FlaggedApi(Flags.FLAG_REQUEST_RESTRICTED_WIFI)
|
||||
public Set<Integer> getSubscriptionIds() {
|
||||
return new ArraySet<>(mSubIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ import android.os.Process;
|
|||
import android.text.TextUtils;
|
||||
import android.util.Range;
|
||||
|
||||
import com.android.net.flags.Flags;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -144,12 +146,6 @@ import java.util.Set;
|
|||
* Look up the specific capability to learn whether its usage requires this self-certification.
|
||||
*/
|
||||
public class NetworkRequest implements Parcelable {
|
||||
|
||||
/** @hide */
|
||||
public static class Flags {
|
||||
static final String REQUEST_RESTRICTED_WIFI =
|
||||
"com.android.net.flags.request_restricted_wifi";
|
||||
}
|
||||
/**
|
||||
* The first requestId value that will be allocated.
|
||||
* @hide only used by ConnectivityService.
|
||||
|
|
@ -616,7 +612,7 @@ public class NetworkRequest implements Parcelable {
|
|||
* @param subIds A {@code Set} that represents subscription IDs.
|
||||
*/
|
||||
@NonNull
|
||||
@FlaggedApi(Flags.REQUEST_RESTRICTED_WIFI)
|
||||
@FlaggedApi(Flags.FLAG_REQUEST_RESTRICTED_WIFI)
|
||||
public Builder setSubscriptionIds(@NonNull Set<Integer> subIds) {
|
||||
mNetworkCapabilities.setSubscriptionIds(subIds);
|
||||
return this;
|
||||
|
|
@ -880,7 +876,7 @@ public class NetworkRequest implements Parcelable {
|
|||
* @return Set of Integer values for this instance.
|
||||
*/
|
||||
@NonNull
|
||||
@FlaggedApi(Flags.REQUEST_RESTRICTED_WIFI)
|
||||
@FlaggedApi(Flags.FLAG_REQUEST_RESTRICTED_WIFI)
|
||||
public Set<Integer> getSubscriptionIds() {
|
||||
// No need to make a defensive copy here as NC#getSubscriptionIds() already returns
|
||||
// a new set.
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ java_library {
|
|||
],
|
||||
static_libs: [
|
||||
"modules-utils-preconditions",
|
||||
"com.android.nearby.flags-aconfig-java",
|
||||
],
|
||||
visibility: [
|
||||
"//packages/modules/Connectivity/nearby/tests:__subpackages__",
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import android.util.Log;
|
|||
|
||||
import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.internal.util.Preconditions;
|
||||
import com.android.nearby.flags.Flags;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
|
@ -84,7 +85,7 @@ public class NearbyManager {
|
|||
* Return value of {@link #getPoweredOffFindingMode()} when this powered off finding is not
|
||||
* supported the device.
|
||||
*/
|
||||
@FlaggedApi("com.android.nearby.flags.powered_off_finding")
|
||||
@FlaggedApi(Flags.FLAG_POWERED_OFF_FINDING)
|
||||
public static final int POWERED_OFF_FINDING_MODE_UNSUPPORTED = 0;
|
||||
|
||||
/**
|
||||
|
|
@ -92,7 +93,7 @@ public class NearbyManager {
|
|||
* #setPoweredOffFindingMode(int)} when powered off finding is supported but disabled. The
|
||||
* device will not start to advertise when powered off.
|
||||
*/
|
||||
@FlaggedApi("com.android.nearby.flags.powered_off_finding")
|
||||
@FlaggedApi(Flags.FLAG_POWERED_OFF_FINDING)
|
||||
public static final int POWERED_OFF_FINDING_MODE_DISABLED = 1;
|
||||
|
||||
/**
|
||||
|
|
@ -100,7 +101,7 @@ public class NearbyManager {
|
|||
* #setPoweredOffFindingMode(int)} when powered off finding is enabled. The device will start to
|
||||
* advertise when powered off.
|
||||
*/
|
||||
@FlaggedApi("com.android.nearby.flags.powered_off_finding")
|
||||
@FlaggedApi(Flags.FLAG_POWERED_OFF_FINDING)
|
||||
public static final int POWERED_OFF_FINDING_MODE_ENABLED = 2;
|
||||
|
||||
/**
|
||||
|
|
@ -526,7 +527,7 @@ public class NearbyManager {
|
|||
*
|
||||
* @throws IllegalArgumentException if the length of one of the EIDs is not 20 bytes
|
||||
*/
|
||||
@FlaggedApi("com.android.nearby.flags.powered_off_finding")
|
||||
@FlaggedApi(Flags.FLAG_POWERED_OFF_FINDING)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)
|
||||
public void setPoweredOffFindingEphemeralIds(@NonNull List<byte[]> eids) {
|
||||
Objects.requireNonNull(eids);
|
||||
|
|
@ -570,7 +571,7 @@ public class NearbyManager {
|
|||
* @throws IllegalStateException if called with {@link #POWERED_OFF_FINDING_MODE_ENABLED} when
|
||||
* Bluetooth or location services are disabled
|
||||
*/
|
||||
@FlaggedApi("com.android.nearby.flags.powered_off_finding")
|
||||
@FlaggedApi(Flags.FLAG_POWERED_OFF_FINDING)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)
|
||||
public void setPoweredOffFindingMode(@PoweredOffFindingMode int poweredOffFindingMode) {
|
||||
Preconditions.checkArgument(
|
||||
|
|
@ -602,7 +603,7 @@ public class NearbyManager {
|
|||
* #POWERED_OFF_FINDING_MODE_ENABLED} if this was the last value set by {@link
|
||||
* #setPoweredOffFindingMode(int)}
|
||||
*/
|
||||
@FlaggedApi("com.android.nearby.flags.powered_off_finding")
|
||||
@FlaggedApi(Flags.FLAG_POWERED_OFF_FINDING)
|
||||
@RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)
|
||||
public @PoweredOffFindingMode int getPoweredOffFindingMode() {
|
||||
if (!isPoweredOffFindingSupported()) {
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ java_library {
|
|||
},
|
||||
srcs: [
|
||||
"src/com/android/server/connectivity/mdns/**/*.java",
|
||||
":framework-connectivity-t-mdns-standalone-build-sources",
|
||||
":service-mdns-droidstubs",
|
||||
],
|
||||
exclude_srcs: [
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue