diff options
author | Xin Li <delphij@google.com> | 2022-06-27 23:38:51 +0000 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2022-06-27 23:38:51 +0000 |
commit | 01a471a7cf5c7863ee24ec700a4a03fd848b26e3 (patch) | |
tree | 40e54e551a2cd8d9c799b17e37988fe043cef85e | |
parent | 9e0bcbb40e841ded198e5f6e0c4b5b687bb343b7 (diff) | |
parent | 95b8c7c51738969ef1029906a939d624fd9411d3 (diff) | |
download | tvsystem-01a471a7cf5c7863ee24ec700a4a03fd848b26e3.tar.gz |
Merge tm-dev-plus-aosp-without-vendor@8763363temp_sam_242648940
Bug: 236760014
Merged-In: I0cf3473fd37ca71feba40903d4b0269d7131e761
Change-Id: I725e5e5fe8ef6839e198b976165b0aaef43d56cd
-rw-r--r-- | java/com/android/libraries/tv/tvsystem/wifi/TvWifiManager.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/java/com/android/libraries/tv/tvsystem/wifi/TvWifiManager.java b/java/com/android/libraries/tv/tvsystem/wifi/TvWifiManager.java index 38de449..ad75ce5 100644 --- a/java/com/android/libraries/tv/tvsystem/wifi/TvWifiManager.java +++ b/java/com/android/libraries/tv/tvsystem/wifi/TvWifiManager.java @@ -64,12 +64,15 @@ public final class TvWifiManager { public void startLocalOnlyHotspot(@NonNull SoftApConfiguration config, @Nullable Executor executor, @Nullable WifiManager.LocalOnlyHotspotCallback callback) { - android.net.wifi.SoftApConfiguration frameworkConfig = + android.net.wifi.SoftApConfiguration.Builder frameworkConfig = new android.net.wifi.SoftApConfiguration.Builder() .setBssid(config.getBssid()) .setSsid(config.getSsid()) - .setPassphrase(config.getWpa2Passphrase(), SECURITY_TYPE_WPA2_PSK) - .build(); - mWifiManager.startLocalOnlyHotspot(frameworkConfig, executor, callback); + .setPassphrase(config.getWpa2Passphrase(), SECURITY_TYPE_WPA2_PSK); + if (config.getBssid() != null) { + frameworkConfig.setMacRandomizationSetting( + android.net.wifi.SoftApConfiguration.RANDOMIZATION_NONE); + } + mWifiManager.startLocalOnlyHotspot(frameworkConfig.build(), executor, callback); } } |