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