1 /* 2 * Copyright (C) 2021 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 com.android.server.wifi; 18 19 20 import android.annotation.NonNull; 21 import android.net.MacAddress; 22 import android.net.wifi.QosPolicyParams; 23 import android.net.wifi.SecurityParams; 24 import android.net.wifi.WifiConfiguration; 25 26 import java.util.ArrayList; 27 import java.util.List; 28 import java.util.Map; 29 30 /** Abstraction of Supplicant STA Iface HAL interface */ 31 interface ISupplicantStaIfaceHal { 32 /** 33 * Enable/Disable verbose logging. 34 */ enableVerboseLogging(boolean verboseEnabled, boolean halVerboseEnabled)35 void enableVerboseLogging(boolean verboseEnabled, boolean halVerboseEnabled); 36 37 /** 38 * Begin initializing the ISupplicantStaIfaceHal object. Specific initialization 39 * logic differs between the HIDL and AIDL implementations. 40 * 41 * @return true if the initialization routine was successful 42 */ initialize()43 boolean initialize(); 44 45 /** 46 * Setup a STA interface for the specified iface name. 47 * 48 * @param ifaceName Name of the interface. 49 * @return true on success, false otherwise. 50 */ setupIface(@onNull String ifaceName)51 boolean setupIface(@NonNull String ifaceName); 52 53 /** 54 * Teardown a STA interface for the specified iface name. 55 * 56 * @param ifaceName Name of the interface. 57 * @return true on success, false otherwise. 58 */ teardownIface(@onNull String ifaceName)59 boolean teardownIface(@NonNull String ifaceName); 60 61 /** 62 * Registers a death notification for supplicant. 63 * @return Returns true on success. 64 */ registerDeathHandler(@onNull WifiNative.SupplicantDeathEventHandler handler)65 boolean registerDeathHandler(@NonNull WifiNative.SupplicantDeathEventHandler handler); 66 67 /** 68 * Deregisters a death notification for supplicant. 69 * @return Returns true on success. 70 */ deregisterDeathHandler()71 boolean deregisterDeathHandler(); 72 73 /** 74 * Signals whether initialization started successfully. 75 */ isInitializationStarted()76 boolean isInitializationStarted(); 77 78 /** 79 * Signals whether initialization completed successfully. 80 */ isInitializationComplete()81 boolean isInitializationComplete(); 82 83 /** 84 * Start the supplicant daemon. 85 * 86 * @return true on success, false otherwise. 87 */ startDaemon()88 boolean startDaemon(); 89 90 /** 91 * Terminate the supplicant daemon & wait for its death. 92 */ terminate()93 void terminate(); 94 95 /** 96 * Add the provided network configuration to wpa_supplicant and initiate connection to it. 97 * This method does the following: 98 * 1. If |config| is different to the current supplicant network, removes all supplicant 99 * networks and saves |config|. 100 * 2. Select the new network in wpa_supplicant. 101 * 102 * @param ifaceName Name of the interface. 103 * @param config WifiConfiguration parameters for the provided network. 104 * @return {@code true} if it succeeds, {@code false} otherwise 105 */ connectToNetwork(@onNull String ifaceName, @NonNull WifiConfiguration config)106 boolean connectToNetwork(@NonNull String ifaceName, @NonNull WifiConfiguration config); 107 108 /** 109 * Initiates roaming to the already configured network in wpa_supplicant. If the network 110 * configuration provided does not match the already configured network, then this triggers 111 * a new connection attempt (instead of roam). 112 * 113 * @param ifaceName Name of the interface. 114 * @param config WifiConfiguration parameters for the provided network. 115 * @return {@code true} if it succeeds, {@code false} otherwise 116 */ roamToNetwork(@onNull String ifaceName, WifiConfiguration config)117 boolean roamToNetwork(@NonNull String ifaceName, WifiConfiguration config); 118 119 /** 120 * Clean HAL cached data for |networkId| in the framework. 121 * 122 * @param networkId Network id of the network to be removed from supplicant. 123 */ removeNetworkCachedData(int networkId)124 void removeNetworkCachedData(int networkId); 125 126 /** 127 * Clear HAL cached data if MAC address is changed. 128 * 129 * @param networkId Network id of the network to be checked. 130 * @param curMacAddress Current MAC address 131 */ removeNetworkCachedDataIfNeeded(int networkId, MacAddress curMacAddress)132 void removeNetworkCachedDataIfNeeded(int networkId, MacAddress curMacAddress); 133 134 /** 135 * Remove all networks from supplicant 136 * 137 * @param ifaceName Name of the interface. 138 */ removeAllNetworks(@onNull String ifaceName)139 boolean removeAllNetworks(@NonNull String ifaceName); 140 141 /** 142 * Disable the current network in supplicant 143 * 144 * @param ifaceName Name of the interface. 145 */ disableCurrentNetwork(@onNull String ifaceName)146 boolean disableCurrentNetwork(@NonNull String ifaceName); 147 148 /** 149 * Set the currently configured network's bssid. 150 * 151 * @param ifaceName Name of the interface. 152 * @param bssidStr Bssid to set in the form of "XX:XX:XX:XX:XX:XX" 153 * @return true if succeeds, false otherwise. 154 */ setCurrentNetworkBssid(@onNull String ifaceName, String bssidStr)155 boolean setCurrentNetworkBssid(@NonNull String ifaceName, String bssidStr); 156 157 /** 158 * Get the currently configured network's WPS NFC token. 159 * 160 * @param ifaceName Name of the interface. 161 * @return Hex string corresponding to the WPS NFC token. 162 */ getCurrentNetworkWpsNfcConfigurationToken(@onNull String ifaceName)163 String getCurrentNetworkWpsNfcConfigurationToken(@NonNull String ifaceName); 164 165 /** 166 * Get the eap anonymous identity for the currently configured network. 167 * 168 * @param ifaceName Name of the interface. 169 * @return anonymous identity string if succeeds, null otherwise. 170 */ getCurrentNetworkEapAnonymousIdentity(@onNull String ifaceName)171 String getCurrentNetworkEapAnonymousIdentity(@NonNull String ifaceName); 172 173 /** 174 * Send the eap identity response for the currently configured network. 175 * 176 * @param ifaceName Name of the interface. 177 * @param identity Identity used for EAP-Identity 178 * @param encryptedIdentity Encrypted identity used for EAP-AKA/EAP-SIM 179 * @return true if succeeds, false otherwise. 180 */ sendCurrentNetworkEapIdentityResponse( @onNull String ifaceName, @NonNull String identity, String encryptedIdentity)181 boolean sendCurrentNetworkEapIdentityResponse( 182 @NonNull String ifaceName, @NonNull String identity, String encryptedIdentity); 183 184 /** 185 * Send the eap sim gsm auth response for the currently configured network. 186 * 187 * @param ifaceName Name of the interface. 188 * @param paramsStr String to send. 189 * @return true if succeeds, false otherwise. 190 */ sendCurrentNetworkEapSimGsmAuthResponse( @onNull String ifaceName, String paramsStr)191 boolean sendCurrentNetworkEapSimGsmAuthResponse( 192 @NonNull String ifaceName, String paramsStr); 193 194 /** 195 * Send the eap sim gsm auth failure for the currently configured network. 196 * 197 * @param ifaceName Name of the interface. 198 * @return true if succeeds, false otherwise. 199 */ sendCurrentNetworkEapSimGsmAuthFailure(@onNull String ifaceName)200 boolean sendCurrentNetworkEapSimGsmAuthFailure(@NonNull String ifaceName); 201 202 /** 203 * Send the eap sim umts auth response for the currently configured network. 204 * 205 * @param ifaceName Name of the interface. 206 * @param paramsStr String to send. 207 * @return true if succeeds, false otherwise. 208 */ sendCurrentNetworkEapSimUmtsAuthResponse( @onNull String ifaceName, String paramsStr)209 boolean sendCurrentNetworkEapSimUmtsAuthResponse( 210 @NonNull String ifaceName, String paramsStr); 211 212 /** 213 * Send the eap sim umts auts response for the currently configured network. 214 * 215 * @param ifaceName Name of the interface. 216 * @param paramsStr String to send. 217 * @return true if succeeds, false otherwise. 218 */ sendCurrentNetworkEapSimUmtsAutsResponse( @onNull String ifaceName, String paramsStr)219 boolean sendCurrentNetworkEapSimUmtsAutsResponse( 220 @NonNull String ifaceName, String paramsStr); 221 222 /** 223 * Send the eap sim umts auth failure for the currently configured network. 224 * 225 * @param ifaceName Name of the interface. 226 * @return true if succeeds, false otherwise. 227 */ sendCurrentNetworkEapSimUmtsAuthFailure(@onNull String ifaceName)228 boolean sendCurrentNetworkEapSimUmtsAuthFailure(@NonNull String ifaceName); 229 230 /** 231 * Set WPS device name. 232 * 233 * @param ifaceName Name of the interface. 234 * @param deviceName String to be set. 235 * @return true if request is sent successfully, false otherwise. 236 */ setWpsDeviceName(@onNull String ifaceName, String deviceName)237 boolean setWpsDeviceName(@NonNull String ifaceName, String deviceName); 238 239 /** 240 * Set WPS device type. 241 * 242 * @param ifaceName Name of the interface. 243 * @param typeStr Type specified as a string. Used format: <categ>-<OUI>-<subcateg> 244 * @return true if request is sent successfully, false otherwise. 245 */ setWpsDeviceType(@onNull String ifaceName, String typeStr)246 boolean setWpsDeviceType(@NonNull String ifaceName, String typeStr); 247 248 /** 249 * Set WPS manufacturer. 250 * 251 * @param ifaceName Name of the interface. 252 * @param manufacturer String to be set. 253 * @return true if request is sent successfully, false otherwise. 254 */ setWpsManufacturer(@onNull String ifaceName, String manufacturer)255 boolean setWpsManufacturer(@NonNull String ifaceName, String manufacturer); 256 257 /** 258 * Set WPS model name. 259 * 260 * @param ifaceName Name of the interface. 261 * @param modelName String to be set. 262 * @return true if request is sent successfully, false otherwise. 263 */ setWpsModelName(@onNull String ifaceName, String modelName)264 boolean setWpsModelName(@NonNull String ifaceName, String modelName); 265 266 /** 267 * Set WPS model number. 268 * 269 * @param ifaceName Name of the interface. 270 * @param modelNumber String to be set. 271 * @return true if request is sent successfully, false otherwise. 272 */ setWpsModelNumber(@onNull String ifaceName, String modelNumber)273 boolean setWpsModelNumber(@NonNull String ifaceName, String modelNumber); 274 275 /** 276 * Set WPS serial number. 277 * 278 * @param ifaceName Name of the interface. 279 * @param serialNumber String to be set. 280 * @return true if request is sent successfully, false otherwise. 281 */ setWpsSerialNumber(@onNull String ifaceName, String serialNumber)282 boolean setWpsSerialNumber(@NonNull String ifaceName, String serialNumber); 283 284 /** 285 * Set WPS config methods 286 * 287 * @param ifaceName Name of the interface. 288 * @param configMethodsStr List of config methods. 289 * @return true if request is sent successfully, false otherwise. 290 */ setWpsConfigMethods(@onNull String ifaceName, String configMethodsStr)291 boolean setWpsConfigMethods(@NonNull String ifaceName, String configMethodsStr); 292 293 /** 294 * Trigger a reassociation even if the iface is currently connected. 295 * 296 * @param ifaceName Name of the interface. 297 * @return true if request is sent successfully, false otherwise. 298 */ reassociate(@onNull String ifaceName)299 boolean reassociate(@NonNull String ifaceName); 300 301 /** 302 * Trigger a reconnection if the iface is disconnected. 303 * 304 * @param ifaceName Name of the interface. 305 * @return true if request is sent successfully, false otherwise. 306 */ reconnect(@onNull String ifaceName)307 boolean reconnect(@NonNull String ifaceName); 308 309 /** 310 * Trigger a disconnection from the currently connected network. 311 * 312 * @param ifaceName Name of the interface. 313 * @return true if request is sent successfully, false otherwise. 314 */ disconnect(@onNull String ifaceName)315 boolean disconnect(@NonNull String ifaceName); 316 317 /** 318 * Enable or disable power save mode. 319 * 320 * @param ifaceName Name of the interface. 321 * @param enable true to enable, false to disable. 322 * @return true if request is sent successfully, false otherwise. 323 */ setPowerSave(@onNull String ifaceName, boolean enable)324 boolean setPowerSave(@NonNull String ifaceName, boolean enable); 325 326 /** 327 * Initiate TDLS discover with the specified AP. 328 * 329 * @param ifaceName Name of the interface. 330 * @param macAddress MAC Address of the AP. 331 * @return true if request is sent successfully, false otherwise. 332 */ initiateTdlsDiscover(@onNull String ifaceName, String macAddress)333 boolean initiateTdlsDiscover(@NonNull String ifaceName, String macAddress); 334 335 /** 336 * Initiate TDLS setup with the specified AP. 337 * 338 * @param ifaceName Name of the interface. 339 * @param macAddress MAC Address of the AP. 340 * @return true if request is sent successfully, false otherwise. 341 */ initiateTdlsSetup(@onNull String ifaceName, String macAddress)342 boolean initiateTdlsSetup(@NonNull String ifaceName, String macAddress); 343 344 /** 345 * Initiate TDLS teardown with the specified AP. 346 * @param ifaceName Name of the interface. 347 * @param macAddress MAC Address of the AP. 348 * @return true if request is sent successfully, false otherwise. 349 */ initiateTdlsTeardown(@onNull String ifaceName, String macAddress)350 boolean initiateTdlsTeardown(@NonNull String ifaceName, String macAddress); 351 352 /** 353 * Request the specified ANQP elements |elements| from the specified AP |bssid|. 354 * 355 * @param ifaceName Name of the interface. 356 * @param bssid BSSID of the AP 357 * @param infoElements ANQP elements to be queried. Refer to ISupplicantStaIface.AnqpInfoId. 358 * @param hs20SubTypes HS subtypes to be queried. Refer to ISupplicantStaIface.Hs20AnqpSubTypes. 359 * @return true if request is sent successfully, false otherwise. 360 */ initiateAnqpQuery(@onNull String ifaceName, String bssid, ArrayList<Short> infoElements, ArrayList<Integer> hs20SubTypes)361 boolean initiateAnqpQuery(@NonNull String ifaceName, String bssid, 362 ArrayList<Short> infoElements, 363 ArrayList<Integer> hs20SubTypes); 364 365 /** 366 * Request Venue URL ANQP element from the specified AP |bssid|. 367 * 368 * @param ifaceName Name of the interface. 369 * @param bssid BSSID of the AP 370 * @return true if request is sent successfully, false otherwise. 371 */ initiateVenueUrlAnqpQuery(@onNull String ifaceName, String bssid)372 boolean initiateVenueUrlAnqpQuery(@NonNull String ifaceName, String bssid); 373 374 /** 375 * Request the specified ANQP ICON from the specified AP |bssid|. 376 * 377 * @param ifaceName Name of the interface. 378 * @param bssid BSSID of the AP 379 * @param fileName Name of the file to request. 380 * @return true if request is sent successfully, false otherwise. 381 */ initiateHs20IconQuery(@onNull String ifaceName, String bssid, String fileName)382 boolean initiateHs20IconQuery(@NonNull String ifaceName, String bssid, String fileName); 383 384 /** 385 * Gets MAC address from the supplicant 386 * 387 * @param ifaceName Name of the interface. 388 * @return string containing the MAC address, or null on a failed call 389 */ getMacAddress(@onNull String ifaceName)390 String getMacAddress(@NonNull String ifaceName); 391 392 /** 393 * Start using the added RX filters. 394 * 395 * @param ifaceName Name of the interface. 396 * @return true if request is sent successfully, false otherwise. 397 */ startRxFilter(@onNull String ifaceName)398 boolean startRxFilter(@NonNull String ifaceName); 399 400 /** 401 * Stop using the added RX filters. 402 * 403 * @param ifaceName Name of the interface. 404 * @return true if request is sent successfully, false otherwise. 405 */ stopRxFilter(@onNull String ifaceName)406 boolean stopRxFilter(@NonNull String ifaceName); 407 408 /** 409 * Add an RX filter. 410 * 411 * @param ifaceName Name of the interface. 412 * @param type one of {@link WifiNative#RX_FILTER_TYPE_V4_MULTICAST} 413 * {@link WifiNative#RX_FILTER_TYPE_V6_MULTICAST} values. 414 * @return true if request is sent successfully, false otherwise. 415 */ addRxFilter(@onNull String ifaceName, int type)416 boolean addRxFilter(@NonNull String ifaceName, int type); 417 418 /** 419 * Remove an RX filter. 420 * 421 * @param ifaceName Name of the interface. 422 * @param type one of {@link WifiNative#RX_FILTER_TYPE_V4_MULTICAST} 423 * {@link WifiNative#RX_FILTER_TYPE_V6_MULTICAST} values. 424 * @return true if request is sent successfully, false otherwise. 425 */ removeRxFilter(@onNull String ifaceName, int type)426 boolean removeRxFilter(@NonNull String ifaceName, int type); 427 428 /** 429 * Set Bt coexistence mode. 430 * 431 * @param ifaceName Name of the interface. 432 * @param mode one of the above {@link WifiNative#BLUETOOTH_COEXISTENCE_MODE_DISABLED}, 433 * {@link WifiNative#BLUETOOTH_COEXISTENCE_MODE_ENABLED} or 434 * {@link WifiNative#BLUETOOTH_COEXISTENCE_MODE_SENSE}. 435 * @return true if request is sent successfully, false otherwise. 436 */ setBtCoexistenceMode(@onNull String ifaceName, int mode)437 boolean setBtCoexistenceMode(@NonNull String ifaceName, int mode); 438 439 /** Enable or disable BT coexistence mode. 440 * 441 * @param ifaceName Name of the interface. 442 * @param enable true to enable, false to disable. 443 * @return true if request is sent successfully, false otherwise. 444 */ setBtCoexistenceScanModeEnabled(@onNull String ifaceName, boolean enable)445 boolean setBtCoexistenceScanModeEnabled(@NonNull String ifaceName, boolean enable); 446 447 /** 448 * Enable or disable suspend mode optimizations. 449 * 450 * @param ifaceName Name of the interface. 451 * @param enable true to enable, false otherwise. 452 * @return true if request is sent successfully, false otherwise. 453 */ setSuspendModeEnabled(@onNull String ifaceName, boolean enable)454 boolean setSuspendModeEnabled(@NonNull String ifaceName, boolean enable); 455 456 /** 457 * Set country code. 458 * 459 * @param ifaceName Name of the interface. 460 * @param codeStr 2 byte ASCII string. For ex: US, CA. 461 * @return true if request is sent successfully, false otherwise. 462 */ setCountryCode(@onNull String ifaceName, String codeStr)463 boolean setCountryCode(@NonNull String ifaceName, String codeStr); 464 465 /** 466 * Flush all previously configured HLPs. 467 * 468 * @param ifaceName Name of the interface. 469 * @return true if request is sent successfully, false otherwise. 470 */ flushAllHlp(@onNull String ifaceName)471 boolean flushAllHlp(@NonNull String ifaceName); 472 473 /** 474 * Set FILS HLP packet. 475 * 476 * @param ifaceName Name of the interface. 477 * @param dst Destination MAC address. 478 * @param hlpPacket Hlp Packet data in hex. 479 * @return true if request is sent successfully, false otherwise. 480 */ addHlpReq(@onNull String ifaceName, byte [] dst, byte [] hlpPacket)481 boolean addHlpReq(@NonNull String ifaceName, byte [] dst, byte [] hlpPacket); 482 483 /** 484 * Start WPS pin registrar operation with the specified peer and pin. 485 * 486 * @param ifaceName Name of the interface. 487 * @param bssidStr BSSID of the peer. 488 * @param pin Pin to be used. 489 * @return true if request is sent successfully, false otherwise. 490 */ startWpsRegistrar(@onNull String ifaceName, String bssidStr, String pin)491 boolean startWpsRegistrar(@NonNull String ifaceName, String bssidStr, String pin); 492 493 /** 494 * Start WPS pin display operation with the specified peer. 495 * 496 * @param ifaceName Name of the interface. 497 * @param bssidStr BSSID of the peer. Use empty bssid to indicate wildcard. 498 * @return true if request is sent successfully, false otherwise. 499 */ startWpsPbc(@onNull String ifaceName, String bssidStr)500 boolean startWpsPbc(@NonNull String ifaceName, String bssidStr); 501 502 /** 503 * Start WPS pin keypad operation with the specified pin. 504 * 505 * @param ifaceName Name of the interface. 506 * @param pin Pin to be used. 507 * @return true if request is sent successfully, false otherwise. 508 */ startWpsPinKeypad(@onNull String ifaceName, String pin)509 boolean startWpsPinKeypad(@NonNull String ifaceName, String pin); 510 511 /** 512 * Start WPS pin display operation with the specified peer. 513 * 514 * @param ifaceName Name of the interface. 515 * @param bssidStr BSSID of the peer. Use empty bssid to indicate wildcard. 516 * @return new pin generated on success, null otherwise. 517 */ startWpsPinDisplay(@onNull String ifaceName, String bssidStr)518 String startWpsPinDisplay(@NonNull String ifaceName, String bssidStr); 519 520 /** 521 * Cancels any ongoing WPS requests. 522 * 523 * @param ifaceName Name of the interface. 524 * @return true if request is sent successfully, false otherwise. 525 */ cancelWps(@onNull String ifaceName)526 boolean cancelWps(@NonNull String ifaceName); 527 528 /** 529 * Sets whether to use external sim for SIM/USIM processing. 530 * 531 * @param ifaceName Name of the interface. 532 * @param useExternalSim true to enable, false otherwise. 533 * @return true if request is sent successfully, false otherwise. 534 */ setExternalSim(@onNull String ifaceName, boolean useExternalSim)535 boolean setExternalSim(@NonNull String ifaceName, boolean useExternalSim); 536 537 /** 538 * Enable/Disable auto reconnect to networks. 539 * Use this to prevent wpa_supplicant from trying to connect to networks 540 * on its own. 541 * 542 * @param enable true to enable, false to disable. 543 * @return true if no exceptions occurred, false otherwise 544 */ enableAutoReconnect(@onNull String ifaceName, boolean enable)545 boolean enableAutoReconnect(@NonNull String ifaceName, boolean enable); 546 547 /** 548 * Set the debug log level for wpa_supplicant 549 * 550 * @param turnOnVerbose Whether to turn on verbose logging or not. 551 * @return true if request is sent successfully, false otherwise. 552 */ setLogLevel(boolean turnOnVerbose)553 boolean setLogLevel(boolean turnOnVerbose); 554 555 /** 556 * Set concurrency priority between P2P & STA operations. 557 * 558 * @param isStaHigherPriority Set to true to prefer STA over P2P during concurrency operations, 559 * false otherwise. 560 * @return true if request is sent successfully, false otherwise. 561 */ setConcurrencyPriority(boolean isStaHigherPriority)562 boolean setConcurrencyPriority(boolean isStaHigherPriority); 563 564 /** 565 * Returns a bitmask of advanced capabilities: WPA3 SAE/SUITE B and OWE 566 * Bitmask used is: 567 * - WIFI_FEATURE_WPA3_SAE 568 * - WIFI_FEATURE_WPA3_SUITE_B 569 * - WIFI_FEATURE_OWE 570 * 571 * On error, or if these features are not supported, 0 is returned. 572 */ getAdvancedCapabilities(@onNull String ifaceName)573 long getAdvancedCapabilities(@NonNull String ifaceName); 574 575 /** 576 * Get the driver supported features through supplicant. 577 * 578 * @param ifaceName Name of the interface. 579 * @return bitmask defined by WifiManager.WIFI_FEATURE_*. 580 */ getWpaDriverFeatureSet(@onNull String ifaceName)581 long getWpaDriverFeatureSet(@NonNull String ifaceName); 582 583 /** 584 * Returns connection capabilities of the current network 585 * 586 * @param ifaceName Name of the interface. 587 * @return connection capabilities of the current network 588 */ getConnectionCapabilities(@onNull String ifaceName)589 WifiNative.ConnectionCapabilities getConnectionCapabilities(@NonNull String ifaceName); 590 591 /** 592 * Returns signal poll results for all Wi-Fi links of the interface. 593 * 594 * @param ifaceName Name of the interface. 595 * @return Signal poll results. 596 */ getSignalPollResults(@onNull String ifaceName)597 WifiSignalPollResults getSignalPollResults(@NonNull String ifaceName); 598 599 /** 600 * Returns connection MLO links info 601 * 602 * @param ifaceName Name of the interface. 603 * @return connection MLO links info 604 */ getConnectionMloLinksInfo(@onNull String ifaceName)605 WifiNative.ConnectionMloLinksInfo getConnectionMloLinksInfo(@NonNull String ifaceName); 606 607 /** 608 * Adds a DPP peer URI to the URI list. 609 * 610 * Returns an ID to be used later to refer to this URI (>0). 611 * On error, or if these features are not supported, -1 is returned. 612 */ addDppPeerUri(@onNull String ifaceName, @NonNull String uri)613 int addDppPeerUri(@NonNull String ifaceName, @NonNull String uri); 614 615 /** 616 * Removes a DPP URI to the URI list given an ID. 617 * 618 * Returns true when operation is successful 619 * On error, or if these features are not supported, false is returned. 620 */ removeDppUri(@onNull String ifaceName, int bootstrapId)621 boolean removeDppUri(@NonNull String ifaceName, int bootstrapId); 622 623 /** 624 * Stops/aborts DPP Initiator request 625 * 626 * Returns true when operation is successful 627 * On error, or if these features are not supported, false is returned. 628 */ stopDppInitiator(@onNull String ifaceName)629 boolean stopDppInitiator(@NonNull String ifaceName); 630 631 /** 632 * Starts DPP Configurator-Initiator request 633 * 634 * Returns true when operation is successful 635 * On error, or if these features are not supported, false is returned. 636 */ startDppConfiguratorInitiator(@onNull String ifaceName, int peerBootstrapId, int ownBootstrapId, @NonNull String ssid, String password, String psk, int netRole, int securityAkm, byte[] privEcKey)637 boolean startDppConfiguratorInitiator(@NonNull String ifaceName, int peerBootstrapId, 638 int ownBootstrapId, @NonNull String ssid, String password, String psk, 639 int netRole, int securityAkm, byte[] privEcKey); 640 641 /** 642 * Starts DPP Enrollee-Initiator request 643 * 644 * Returns true when operation is successful 645 * On error, or if these features are not supported, false is returned. 646 */ startDppEnrolleeInitiator(@onNull String ifaceName, int peerBootstrapId, int ownBootstrapId)647 boolean startDppEnrolleeInitiator(@NonNull String ifaceName, int peerBootstrapId, 648 int ownBootstrapId); 649 650 /** 651 * Generate a DPP QR code based boot strap info 652 * 653 * Returns DppResponderBootstrapInfo; 654 */ generateDppBootstrapInfoForResponder( @onNull String ifaceName, String macAddress, @NonNull String deviceInfo, int dppCurve)655 WifiNative.DppBootstrapQrCodeInfo generateDppBootstrapInfoForResponder( 656 @NonNull String ifaceName, String macAddress, @NonNull String deviceInfo, 657 int dppCurve); 658 659 /** 660 * Starts DPP Enrollee-Responder request 661 * 662 * Returns true when operation is successful 663 * On error, or if these features are not supported, false is returned. 664 */ startDppEnrolleeResponder(@onNull String ifaceName, int listenChannel)665 boolean startDppEnrolleeResponder(@NonNull String ifaceName, int listenChannel); 666 667 /** 668 * Stops/aborts DPP Responder request. 669 * 670 * Returns true when operation is successful 671 * On error, or if these features are not supported, false is returned. 672 */ stopDppResponder(@onNull String ifaceName, int ownBootstrapId)673 boolean stopDppResponder(@NonNull String ifaceName, int ownBootstrapId); 674 675 /** 676 * Register callbacks for DPP events. 677 * 678 * @param dppCallback DPP callback object. 679 */ registerDppCallback(WifiNative.DppEventCallback dppCallback)680 void registerDppCallback(WifiNative.DppEventCallback dppCallback); 681 682 /** 683 * Set MBO cellular data availability. 684 * 685 * @param ifaceName Name of the interface. 686 * @param available true means cellular data available, false otherwise. 687 * Returns true when operation is successful 688 */ setMboCellularDataStatus(@onNull String ifaceName, boolean available)689 boolean setMboCellularDataStatus(@NonNull String ifaceName, boolean available); 690 691 /** 692 * Check if we've roamed to a linked network and make the linked network the current network 693 * if we have. 694 * 695 * @param ifaceName Name of the interface. 696 * @param newNetworkId Network id of the new network we've roamed to. If fromFramework is 697 * {@code true}, this will be a framework network id. Otherwise, this will 698 * be a remote network id. 699 * @param fromFramework {@code true} if the network id is a framework network id, {@code false} 700 if the network id is a remote network id. 701 * @return true if we've roamed to a linked network, false if not. 702 */ updateOnLinkedNetworkRoaming(@onNull String ifaceName, int newNetworkId, boolean fromFramework)703 boolean updateOnLinkedNetworkRoaming(@NonNull String ifaceName, 704 int newNetworkId, boolean fromFramework); 705 706 /** 707 * Updates the linked networks for the current network and sends them to the supplicant. 708 * 709 * @param ifaceName Name of the interface. 710 * @param networkId Network id of the network to link the configurations to. 711 * @param linkedConfigurations Map of config profile key to config for linking. 712 * @return true if networks were successfully linked, false otherwise. 713 */ updateLinkedNetworks(@onNull String ifaceName, int networkId, Map<String, WifiConfiguration> linkedConfigurations)714 boolean updateLinkedNetworks(@NonNull String ifaceName, int networkId, 715 Map<String, WifiConfiguration> linkedConfigurations); 716 717 /** 718 * Gets the security params of the current network associated with this interface 719 * 720 * @param ifaceName Name of the interface 721 * @return Security params of the current network associated with the interface 722 */ getCurrentNetworkSecurityParams(@onNull String ifaceName)723 SecurityParams getCurrentNetworkSecurityParams(@NonNull String ifaceName); 724 725 /** 726 * Set whether the network-centric QoS policy feature is enabled or not for this interface. 727 * 728 * @param ifaceName name of the interface. 729 * @param isEnabled true if the feature is enabled, false otherwise. 730 * @return true if operation is successful, false otherwise. 731 */ setNetworkCentricQosPolicyFeatureEnabled(@onNull String ifaceName, boolean isEnabled)732 boolean setNetworkCentricQosPolicyFeatureEnabled(@NonNull String ifaceName, boolean isEnabled); 733 734 /** 735 * Sends a QoS policy response. 736 * 737 * @param ifaceName Name of the interface. 738 * @param qosPolicyRequestId Dialog token to identify the request. 739 * @param morePolicies Flag to indicate more QoS policies can be accommodated. 740 * @param qosPolicyStatusList List of framework QosPolicyStatus objects. 741 * @return true if response is sent successfully, false otherwise. 742 */ sendQosPolicyResponse(String ifaceName, int qosPolicyRequestId, boolean morePolicies, @NonNull List<SupplicantStaIfaceHal.QosPolicyStatus> qosPolicyStatusList)743 boolean sendQosPolicyResponse(String ifaceName, int qosPolicyRequestId, boolean morePolicies, 744 @NonNull List<SupplicantStaIfaceHal.QosPolicyStatus> qosPolicyStatusList); 745 746 /** 747 * Indicates the removal of all active QoS policies configured by the AP. 748 * 749 * @param ifaceName Name of the interface. 750 */ removeAllQosPolicies(String ifaceName)751 boolean removeAllQosPolicies(String ifaceName); 752 753 /** 754 * Send a set of QoS SCS policy add requests to the AP. 755 * 756 * Immediate response will indicate which policies were sent to the AP, and which were 757 * rejected immediately by the supplicant. If any requests were sent to the AP, the AP's 758 * response will arrive later in the onQosPolicyResponseForScs callback. 759 * 760 * @param ifaceName Name of the interface. 761 * @param policies List of policies that the caller is requesting to add. 762 * @return List of responses for each policy in the request, or null if an error occurred. 763 * Status code will be one of 764 * {@link SupplicantStaIfaceHal.QosPolicyScsRequestStatusCode}. 765 */ addQosPolicyRequestForScs( @onNull String ifaceName, @NonNull List<QosPolicyParams> policies)766 List<SupplicantStaIfaceHal.QosPolicyStatus> addQosPolicyRequestForScs( 767 @NonNull String ifaceName, @NonNull List<QosPolicyParams> policies); 768 769 /** 770 * Request the removal of specific QoS policies for SCS. 771 * 772 * Immediate response will indicate which policies were sent to the AP, and which were 773 * rejected immediately by the supplicant. If any requests were sent to the AP, the AP's 774 * response will arrive later in the onQosPolicyResponseForScs callback. 775 * 776 * @param ifaceName Name of the interface. 777 * @param policyIds List of policy IDs for policies that should be removed. 778 * @return List of responses for each policy in the request, or null if an error occurred. 779 * Status code will be one of 780 * {@link SupplicantStaIfaceHal.QosPolicyScsRequestStatusCode}. 781 */ removeQosPolicyForScs( @onNull String ifaceName, @NonNull List<Byte> policyIds)782 List<SupplicantStaIfaceHal.QosPolicyStatus> removeQosPolicyForScs( 783 @NonNull String ifaceName, @NonNull List<Byte> policyIds); 784 785 /** 786 * Register a callback to receive notifications for QoS SCS transactions. 787 * Callback should only be registered once. 788 * 789 * @param callback {@link SupplicantStaIfaceHal.QosScsResponseCallback} to register. 790 */ registerQosScsResponseCallback(SupplicantStaIfaceHal.QosScsResponseCallback callback)791 void registerQosScsResponseCallback(SupplicantStaIfaceHal.QosScsResponseCallback callback); 792 793 /** 794 * Generate DPP credential for network access 795 * 796 * @param ifaceName Name of the interface. 797 * @param ssid ssid of the network 798 * @param privEcKey Private EC Key for DPP Configurator 799 * Returns true when operation is successful. On error, false is returned. 800 */ generateSelfDppConfiguration(@onNull String ifaceName, @NonNull String ssid, byte[] privEcKey)801 boolean generateSelfDppConfiguration(@NonNull String ifaceName, @NonNull String ssid, 802 byte[] privEcKey); 803 804 /** 805 * Set the currently configured network's anonymous identity. 806 * 807 * @param ifaceName Name of the interface. 808 * @param anonymousIdentity the anonymouns identity. 809 * @param updateToNativeService write the data to the native service. 810 * @return true if succeeds, false otherwise. 811 */ setEapAnonymousIdentity(@onNull String ifaceName, String anonymousIdentity, boolean updateToNativeService)812 boolean setEapAnonymousIdentity(@NonNull String ifaceName, String anonymousIdentity, 813 boolean updateToNativeService); 814 } 815