1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package android.net.connectivity; 17 18 import android.compat.annotation.ChangeId; 19 import android.compat.annotation.EnabledAfter; 20 import android.compat.annotation.EnabledSince; 21 import android.os.Build; 22 23 /** 24 * The class contains all CompatChanges for the Connectivity module. 25 * 26 * <p>This is the centralized place for the CompatChanges used in the Connectivity module. 27 * Putting all the CompatChanges in single place makes it possible to manage them under a single 28 * platform_compat_config. 29 * @hide 30 */ 31 public final class ConnectivityCompatChanges { 32 33 /** 34 * The {@link android.net.LinkProperties#getRoutes()} now can contain excluded as well as 35 * included routes. Use {@link android.net.RouteInfo#getType()} to determine route type. 36 * 37 * @hide 38 */ 39 @ChangeId 40 @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.S_V2) 41 public static final long EXCLUDED_ROUTES = 186082280; 42 43 /** 44 * When enabled, apps targeting < Android 12 are considered legacy for 45 * the NSD native daemon. 46 * The platform will only keep the daemon running as long as there are 47 * any legacy apps connected. 48 * 49 * After Android 12, direct communication with the native daemon might not work since the native 50 * daemon won't always stay alive. Using the NSD APIs from NsdManager as the replacement is 51 * recommended. 52 * Another alternative could be bundling your own mdns solutions instead of 53 * depending on the system mdns native daemon. 54 * 55 * This compatibility change applies to Android 13 and later only. To toggle behavior on 56 * Android 12 and Android 12L, use RUN_NATIVE_NSD_ONLY_IF_LEGACY_APPS. 57 * 58 * @hide 59 */ 60 @ChangeId 61 @EnabledSince(targetSdkVersion = android.os.Build.VERSION_CODES.S) 62 // This was a platform change ID with value 191844585L before T 63 public static final long RUN_NATIVE_NSD_ONLY_IF_LEGACY_APPS_T_AND_LATER = 235355681L; 64 65 /** 66 * The self certified capabilities check should be enabled after android 13. 67 * 68 * <p> See {@link android.net.NetworkCapabilities} for more details. 69 * 70 * @hide 71 */ 72 @ChangeId 73 @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.TIRAMISU) 74 public static final long ENABLE_SELF_CERTIFIED_CAPABILITIES_DECLARATION = 266524688; 75 76 /** 77 * Apps targeting < Android 14 use a legacy NSD backend. 78 * 79 * The legacy apps use a legacy native daemon as NsdManager backend, but other apps use a 80 * platform-integrated mDNS implementation as backend. 81 * 82 * @hide 83 */ 84 @ChangeId 85 @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.TIRAMISU) 86 public static final long ENABLE_PLATFORM_MDNS_BACKEND = 270306772L; ConnectivityCompatChanges()87 private ConnectivityCompatChanges() { 88 } 89 } 90