1 /* 2 * Copyright (C) 2019 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 17 package android.net.wifi; 18 19 import android.annotation.IntDef; 20 import android.annotation.StringDef; 21 22 import java.lang.annotation.Retention; 23 import java.lang.annotation.RetentionPolicy; 24 25 /** 26 * Wifi annotations meant to be statically linked into client modules, since they cannot be 27 * exposed as @SystemApi. 28 * 29 * e.g. {@link IntDef}, {@link StringDef} 30 * 31 * @hide 32 */ 33 public final class WifiAnnotations { WifiAnnotations()34 private WifiAnnotations() {} 35 36 @Retention(RetentionPolicy.SOURCE) 37 @IntDef(prefix = {"SCAN_TYPE_"}, value = { 38 WifiScanner.SCAN_TYPE_LOW_LATENCY, 39 WifiScanner.SCAN_TYPE_LOW_POWER, 40 WifiScanner.SCAN_TYPE_HIGH_ACCURACY}) 41 public @interface ScanType {} 42 43 @Retention(RetentionPolicy.SOURCE) 44 @IntDef(prefix = {"WIFI_BAND_"}, value = { 45 WifiScanner.WIFI_BAND_UNSPECIFIED, 46 WifiScanner.WIFI_BAND_24_GHZ, 47 WifiScanner.WIFI_BAND_5_GHZ, 48 WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY, 49 WifiScanner.WIFI_BAND_6_GHZ}) 50 public @interface WifiBandBasic {} 51 52 @IntDef(prefix = { "CHANNEL_WIDTH_" }, value = { 53 SoftApInfo.CHANNEL_WIDTH_INVALID, 54 SoftApInfo.CHANNEL_WIDTH_20MHZ_NOHT, 55 SoftApInfo.CHANNEL_WIDTH_20MHZ, 56 SoftApInfo.CHANNEL_WIDTH_40MHZ, 57 SoftApInfo.CHANNEL_WIDTH_80MHZ, 58 SoftApInfo.CHANNEL_WIDTH_80MHZ_PLUS_MHZ, 59 SoftApInfo.CHANNEL_WIDTH_160MHZ, 60 SoftApInfo.CHANNEL_WIDTH_2160MHZ, 61 SoftApInfo.CHANNEL_WIDTH_4320MHZ, 62 SoftApInfo.CHANNEL_WIDTH_6480MHZ, 63 SoftApInfo.CHANNEL_WIDTH_8640MHZ, 64 }) 65 @Retention(RetentionPolicy.SOURCE) 66 public @interface Bandwidth {} 67 68 @IntDef(prefix = { "CHANNEL_WIDTH_" }, value = { 69 ScanResult.CHANNEL_WIDTH_20MHZ, 70 ScanResult.CHANNEL_WIDTH_40MHZ, 71 ScanResult.CHANNEL_WIDTH_80MHZ, 72 ScanResult.CHANNEL_WIDTH_160MHZ, 73 ScanResult.CHANNEL_WIDTH_80MHZ_PLUS_MHZ, 74 }) 75 @Retention(RetentionPolicy.SOURCE) 76 public @interface ChannelWidth{} 77 78 @IntDef(prefix = { "WIFI_STANDARD_" }, value = { 79 ScanResult.WIFI_STANDARD_UNKNOWN, 80 ScanResult.WIFI_STANDARD_LEGACY, 81 ScanResult.WIFI_STANDARD_11N, 82 ScanResult.WIFI_STANDARD_11AC, 83 ScanResult.WIFI_STANDARD_11AX, 84 ScanResult.WIFI_STANDARD_11AD, 85 }) 86 @Retention(RetentionPolicy.SOURCE) 87 public @interface WifiStandard{} 88 89 @IntDef(prefix = { "PROTOCOL_" }, value = { 90 ScanResult.PROTOCOL_NONE, 91 ScanResult.PROTOCOL_WPA, 92 ScanResult.PROTOCOL_RSN, 93 ScanResult.PROTOCOL_OSEN, 94 ScanResult.PROTOCOL_WAPI 95 }) 96 @Retention(RetentionPolicy.SOURCE) 97 public @interface Protocol {} 98 99 @IntDef(prefix = { "KEY_MGMT_" }, value = { 100 ScanResult.KEY_MGMT_NONE, 101 ScanResult.KEY_MGMT_PSK, 102 ScanResult.KEY_MGMT_EAP, 103 ScanResult.KEY_MGMT_FT_PSK, 104 ScanResult.KEY_MGMT_FT_EAP, 105 ScanResult.KEY_MGMT_PSK_SHA256, 106 ScanResult.KEY_MGMT_EAP_SHA256, 107 ScanResult.KEY_MGMT_OSEN, 108 ScanResult.KEY_MGMT_SAE, 109 ScanResult.KEY_MGMT_OWE, 110 ScanResult.KEY_MGMT_EAP_SUITE_B_192, 111 ScanResult.KEY_MGMT_FT_SAE, 112 ScanResult.KEY_MGMT_OWE_TRANSITION, 113 ScanResult.KEY_MGMT_WAPI_PSK, 114 ScanResult.KEY_MGMT_WAPI_CERT 115 }) 116 @Retention(RetentionPolicy.SOURCE) 117 public @interface KeyMgmt {} 118 119 @IntDef(prefix = { "CIPHER_" }, value = { 120 ScanResult.CIPHER_NONE, 121 ScanResult.CIPHER_NO_GROUP_ADDRESSED, 122 ScanResult.CIPHER_TKIP, 123 ScanResult.CIPHER_CCMP, 124 ScanResult.CIPHER_GCMP_256, 125 ScanResult.CIPHER_SMS4, 126 ScanResult.CIPHER_GCMP_128, 127 ScanResult.CIPHER_BIP_GMAC_128, 128 ScanResult.CIPHER_BIP_GMAC_256, 129 ScanResult.CIPHER_BIP_CMAC_256, 130 }) 131 @Retention(RetentionPolicy.SOURCE) 132 public @interface Cipher {} 133 } 134