Commit Graph

3060 Commits

Author SHA1 Message Date
TreeHugger Robot
3a2b8e81e5 Merge "[Settings] Remove WFC enabled state condition of querying Telecomm." into udc-dev 2023-05-04 14:57:36 +00:00
tom hsu
21860761e8 [Settings] Remove WFC enabled state condition of querying Telecomm.
- Query WFC enabled state by querying Telecomm may have problem.
 - Only use ImsMmTelManager API to check WFC enabled state.

Bug: 278108377
Test: atest passed
Change-Id: I6d1122bcf66ed5cd274e99b7b4f13558ab922162
2023-05-02 12:57:35 +00:00
Weng Su
8c50edd1e7 Fixed speed selection lost when changing password in Wi-Fi hotspot settings
- Use current SoftApConfiguration to build new SoftApConfiguration to keep unchanged properties

Bug: 279717060
Test: manual test
atest -c WifiTetherSettingsTest

Change-Id: I3ee7960b13b339445cc79c3d440f5c56c78c015f
2023-04-27 14:55:52 +08:00
Weng Su
bf0e8c1dc7 Restart Wi-Fi tethering automatically if configuration change
- When the Wi-Fi Hotspot is already started, if the user changes the configuration, the Wi-Fi Hotspot will be restarted automatically.

- When the Wi-Fi hotspot restarts, display a circle on the screen to indicate that it is processing.

Bug: 245258763
Test: manual test
atest -c WifiTetherSettingsTest \
         WifiHotspotSpeedSettingsTest
atest -c WifiHotspotRepositoryTest \
         WifiHotspotSecuritySettingsTest \
         WifiHotspotSecurityViewModelTest \
         WifiHotspotSpeedViewModelTest \
         WifiTetherViewModelTest

Change-Id: I6fdd5892916703095f28d0589ebc3b7dd59fcd61
2023-04-21 13:06:44 +08:00
Weng Su
d965ff3049 Fallback to "Extended Compatibility" if Speed feature is not ready
- Fallback to the "Extended Compatibility" design when the following conditions occur
  - 5 GHz band is not supported on the device
  - 5 GHz SAP available channels cannot be obtained from WifiManager
  - 6 GHz SAP available channels cannot be obtained from WifiManager

Bug: 272450463
Test: manual test
atest -c WifiTetherSettingsTest
atest -c WifiTetherViewModelTest \
         WifiHotspotRepositoryTest \
         WifiTetherSecurityPreferenceControllerTest.java \
         WifiTetherMaximizeCompatibilityPreferenceControllerTest

Change-Id: If7c8c41ebe86f5e7d8e4737ab7a82d38c9d633de
2023-04-18 20:49:25 +08:00
Treehugger Robot
be76ebdc5b Merge "Add Wi-Fi hotspot > Security Settings page" into udc-dev 2023-04-13 08:24:34 +00:00
Weng Su
9f80cd2f77 Add Wi-Fi hotspot > Security Settings page
- Restrict low security type when 6 GHz band is selected
  - Disable "WPA2/WPA3-Personal" security type
  - Disable "WPA2-Personal" security type
  - Disable "None" security type

- Automatically updated security type to WPA3 when 6 GHz band is selected
  - Regenerate password when security type is changed from None

Bug: 245258763
Test: manual test
atest -c WifiTetherSettingsTest
atest -c WifiTetherViewModelTest \
         WifiHotspotSecuritySettingsTest \
         WifiHotspotSecurityViewModelTest \
         WifiHotspotRepositoryTest

Change-Id: I31b08795419baed10dc40b876aeec175f6f41e69
2023-04-12 18:19:49 +08:00
Quang Luong
d6d560ff6e Don't overwrite security params when editing saved config
WifiConfigController2 sets the security params of a saved config, which
may overwrite @hide fields like SecurityParams#mIsAddedByAutoUpgrade. To
prevent this, only set the security params for a new config, and use the
existing security params for existing configs.

Bug: 262312532
Test: atest WifiConfigController2Test
Change-Id: I9ef5eb8ce2b4208e1fad27bd68fc4f0fad7d1008
2023-04-04 00:55:13 +00:00
TreeHugger Robot
d82f2eae5c Merge "Revert "Disallow screenshot on Wi-Fi QR code settings"" into tm-qpr-dev am: 23c17977fb am: b3599ae3b6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22317902

Change-Id: I3940fb8e1333d051d12ddb5001717d473bf89d39
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-30 17:18:01 +00:00
TreeHugger Robot
b3599ae3b6 Merge "Revert "Disallow screenshot on Wi-Fi QR code settings"" into tm-qpr-dev am: 23c17977fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22317902

Change-Id: Ieb852ea9a7963f0407f7a78e38df0050085ffbfc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-30 16:30:11 +00:00
TreeHugger Robot
23c17977fb Merge "Revert "Disallow screenshot on Wi-Fi QR code settings"" into tm-qpr-dev 2023-03-29 19:51:37 +00:00
Weng Su
cc53f44d49 Revert "Disallow screenshot on Wi-Fi QR code settings"
This reverts commit 950837b20f.

Reason for revert: The security issue is downgraded to NSI, remove the screenshot protection to rollback the original design.

Change-Id: Iecaf7e4e19dc3452a7d2aeaf32bf38619e760c76
2023-03-28 19:30:11 +00:00
TreeHugger Robot
df292224e2 Merge "Added "Speed and Compatibility" Settings page" into udc-dev 2023-03-25 08:01:30 +00:00
Etan Cohen
a7e606e406 Merge "Force MAC randomization to enabled on ACTION_WIFI_ADD_NETWORKS" into udc-dev 2023-03-23 04:24:41 +00:00
Weng Su
17631aeff7 Added "Speed and Compatibility" Settings page
- Show each band option individually in single-band devices
  - Show "2.4 and 5GHz" combined option in dual-band devices

- Disable 5 GHz option if the device is in the restricted country

- Disable 6 GHz option if the device is in the restricted country
  - Hide 6 GHz option if the old device does not support 6 GHz band.

Bug: 245258763
Test: manual test
atest -c WifiHotspotSpeedSettingsTest
atest -c WifiHotspotSpeedViewModelTest \
         WifiHotspotRepositoryTest

Change-Id: I358d4ff8d62df72fd5080e55f40d588c238d01fb
2023-03-23 10:53:43 +08:00
Zoey Chen
cb4e0bd018 [Settings] Should not show WFC UI in the SIM page if the SIM does not
support WFC

Bug: 270792637
Test: manual
Change-Id: Ic67bd2e766d66c91fc4b0fcf5a5355debd805ac6
2023-03-20 09:15:55 +00:00
Etan Cohen
d3f7fa6aef Force MAC randomization to enabled on ACTION_WIFI_ADD_NETWORKS
The ACTION_WIFI_ADD_NETWORKS allows an app to request the user to
confirm addition of WiFi networks. The intent attaches
WifiNetworkSuggestions (used to specify the networks). However, the
calling app may configure MAC randomization to be disabled - using
reflection.

Fix to always override the MAC randomization setting to enabled. This
will override any user configuration to disable randomization - however,
considering this is (now) a new configuration it should safely start
from the default Setting.

Verified using using a test app to force non-randomized (using
reflection) value and confirm that without change randomization is
disabled and that with change it is reset correctly.

Bug: 236825742
Test: manual - use a test app
Change-Id: I3fba958c461d88005fdb5d2c3d1f2fd4ce725b8c
2023-03-19 16:20:48 +00:00
Lifu Tang
caa1b51ef2 Revert "Remove duplicate strings."
Revert submission 19748582-settings_yesno

Reason for revert: Common strings in English could be translated into different strings in other languages.

Reverted changes: /q/submissionid:19748582-settings_yesno

Bug: 272603842
Test: build and open Settings app
Test: atest SettingsRoboTests
Change-Id: Iaad301c5513478fb95e40987ea3ccb4f923d71fa
2023-03-15 22:39:24 +00:00
Weng Su
bcca5ebf1a Add "Speed & compatibility" preference to Wi-Fi hotspot Settings
- Show 4 speed types in summary
  - 2.4 Ghz
  - 5 Ghz
  - 2.4 and 5 GHz
  - 6 GHz

Bug: 245258763
Test: manual test
atest -c WifiTetherViewModelTest
atest -c WifiHotspotRepositoryTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: I6deb41cb355b0ceb1f1fd2d84408a83b90433e7d
2023-03-09 20:06:37 +08:00
Weng Su
d7bbd4505c Refer to the last Hotspot password when generating the password
- Query the last Hotspot password when security type is SECURITY_TYPE_OPEN and it will be used when the user changes to another security type

- If the last hotspot password is an empty string, then generate random password

Bug: 201789473
Test: manual test
atest -c WifiHotspotRepositoryTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPasswordPreferenceControllerTest

Change-Id: Id3a846099238433e7b6c8b934fa26a74df0dcb61
2023-02-24 11:22:40 +08:00
Arc Wang
5ccbb3ee4d Merge "Allow save by AddNetworkFragment itself" 2023-02-13 14:23:19 +00:00
Arc Wang
da01d199c1 Allow save by AddNetworkFragment itself
Before this change, the calling Activity needs to
check result and get WifiConfiguration to save
data by WifiManager API.

This change allows callings app to specify an auto
save extra to save WifiConfiguration by
AddNetworkFragment itself.

Bug: 268411305
Test: manual
Change-Id: I83002c3de3d6726e9be363d5ac057b4ae9e1707e
2023-02-13 17:24:02 +08:00
Bonian Chen
eb8ec1b1e4 Merge "[Settings] Avoid from user without sufficient permission to change WiFi calling" 2023-02-10 16:22:46 +00:00
Bonian Chen
a1d3fe061e [Settings] Avoid from user without sufficient permission to change WiFi
calling

Enhance security control through close UI when accessing by user with
restriction.

Bug: 262390632
Bug: 262243015
Test: local

Change-Id: I4fadaf2bdc55b97419f9e6abbd3cfa63af034f6a
2023-02-10 12:58:36 +00:00
Weng Su
a346f5b5e2 Initialize Anonymous identity field for TTLS and PEAP EAP methods
- The anonymized identity field will only be displayed for TTLS and PEAP EAP methods

- Initialize the default anonymous identity when it is displayed

Bug: 267517525
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test

Change-Id: I08bd322ff6d86c44298ebd1c4926c0a1363a16ce
2023-02-08 23:42:33 +08:00
Weng Su
f779e6c9d3 Add toggle for Wi-Fi hotspot
- Add Wi-Fi hotspot toggle with vertical divider

- Disable preference and toggle when Data Saver is enabled

Bug: 245569117
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=TetherSettingsTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPreferenceControllerTest
atest -c TetheringManagerModelTest

Change-Id: Ic2baf7d3d0a7bf9527da38d24ecc511b7c91265a
2023-01-13 08:52:54 +08:00
Weng Su
fbe02cd543 Fix the end-icon missing issue for Wi-Fi networks
- Because WifiEntryPreference needs to support policy transparency, the inherited class is changed from Preference to RestrictedPreference.

- The RestrictedPreference will hides the end icon as default, causing this issue to happen.

- Override the getSecondTargetResId() function with necessary resource id to avoid the end-icon being hidden.

- Remove the redundant setWidgetLayoutResource, because it will be initialized in the extended class.

Bug: 262456749
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiEntryPreferenceTest

Change-Id: Ie3d3a649d3137dc705d7887c8e74592437d9ce61
2022-12-30 05:06:54 +08:00
Zoey Chen
88972a7fa5 [Settings] get wrong toggle when handle the WFC changed am: aee115ee3b am: d6bf9262b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20806352

Change-Id: If4ff3e6d5e7ef2b0a1f70a6aacb08a37433357fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-23 06:09:45 +00:00
Zoey Chen
d6bf9262b5 [Settings] get wrong toggle when handle the WFC changed am: aee115ee3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20806352

Change-Id: Icf924f45689bfa0906661be1bfee032520cafab8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-23 05:11:39 +00:00
Zoey Chen
aee115ee3b [Settings] get wrong toggle when handle the WFC changed
WFC toggle's state(EXTRA_TOGGLE_STATE) is set to the newValue after each notifyChange.
However, WFC slice gets the same newValue from EXTRA_TOGGLE_STATE when users change the toggle state
before the EXTRA_TOGGLE_STATE is updated.

Need to get the "correct" new value to set the WFC

Follow the original logic(ag/3820815), 1. don't turn on WFC and only can turn off WFC  if activationApp is not null. 2. turn on/off if  no activationApp.

Bug: 261922170
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=WifiCallingSliceHelperTest
Change-Id: I823f00029c24f1901f40757ba13e7c0f90d6c0bc
2022-12-22 11:13:54 +00:00
xinghailu
897fd74731 Cleanup some plurals in Settings
Change <one> to <1> in string res file, and update related java files.
Test: Update, existing test still pass.
bug: 199230342

Change-Id: Idd0ba3c6adc060da21574d98f8ed765fae00cef8
2022-12-22 16:05:13 +08:00
Weng Su
ae8389165a Create Helper Classes for WifiTrackerLib
- Create a WifiTrackerBase for the base worker thread

- Create a SavedWifiHelper for the saved Wi-Fi network tracker

Bug: 258542666
Test: manual test
atest -c WifiTrackerBaseTest \
         SavedWifiHelperTest

Change-Id: Ie6b2f5b348367376da96737acdf5b8e65ecaf067
2022-12-15 15:19:47 +00:00
Weng Su
941cae99a5 Merge "fix WifiUtils:isNetworkLockedDown() null pointer issue" am: 956f288d1d am: ee773103f8 am: cd486c06d0
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2334743

Change-Id: Icca73d74b5ee6c32607761c8f3c45ab565419604
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-12 14:07:17 +00:00
Weng Su
cd486c06d0 Merge "fix WifiUtils:isNetworkLockedDown() null pointer issue" am: 956f288d1d am: ee773103f8
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2334743

Change-Id: I3538fe496c4a5fd5e34d6cb066a8aaab132c2967
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-10 09:16:22 +00:00
Weng Su
956f288d1d Merge "fix WifiUtils:isNetworkLockedDown() null pointer issue" 2022-12-10 08:11:40 +00:00
TreeHugger Robot
2bd5b1c75f Merge "Check multiple security types for Wi-Fi NetworkRequest" into tm-qpr-dev am: 47d87cb48d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20666966

Change-Id: I745c07401d1130ad320c476928f21d68c388f600
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-09 05:55:31 +00:00
xuelin
688e61a4c6 fix WifiUtils:isNetworkLockedDown() null pointer issue
In the WifiUtils class, the isNetworkLockedDown() method does not
determine whether the context is empty, which will cause a null
pointer exception. This change adds a condition for judging the
input context as empty.

Bug:261812909
Test:make RunSettingsRoboTests
Change-Id: Ie0f17179c25a7e9d4b2f652a5667eef3cc577c7b
Signed-off-by: xuelin <xuelin@xiaomi.corp-partner.google.com>
2022-12-08 16:02:31 +08:00
Weng Su
c4d0597373 Check multiple security types for Wi-Fi NetworkRequest
- The WifiEntry already support multiple security types simultaneously from framework

- For backward compatibility, WifiEntry supports both getSecurity and getSecurityTypes methods

- However, the getSecurity method can only return one type of security, causing NetworkRequest to fail to match another type of security
  - WifiEntry:      getSecurity:WPA2   // getSecurityTypes:{WPA2, WPA3}
  - ReqeustNetwork: getSecurity:WPA3

- Need to use getSecurityTypes to check for matching WifiEntry

Bug: 205943818
Bug: 249713442
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=NetworkRequestDialogFragmentTest

Merged-In: I8848ccd1cb0589284a48ddaa77591f5bf3b41932
Change-Id: I8848ccd1cb0589284a48ddaa77591f5bf3b41932
(cherry picked from commit a88c064842)
2022-12-07 18:15:44 +00:00
Weng Su
a88c064842 Check multiple security types for Wi-Fi NetworkRequest
- The WifiEntry already support multiple security types simultaneously from framework

- For backward compatibility, WifiEntry supports both getSecurity and getSecurityTypes methods

- However, the getSecurity method can only return one type of security, causing NetworkRequest to fail to match another type of security
  - WifiEntry:      getSecurity:WPA2   // getSecurityTypes:{WPA2, WPA3}
  - ReqeustNetwork: getSecurity:WPA3

- Need to use getSecurityTypes to check for matching WifiEntry

Bug: 205943818
Bug: 249713442
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=NetworkRequestDialogFragmentTest

Change-Id: I8848ccd1cb0589284a48ddaa77591f5bf3b41932
2022-12-07 20:09:28 +08:00
Weng Su
c5ec83f1bd Add minimum TLS version for Wi-Fi EAP network
- Remove "TLS v1.3" if device does not support it

Bug: 258372351
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test

Change-Id: If7e41e8c404b4fbf92268afddd92bc6553e60576
2022-12-02 07:06:20 +08:00
Treehugger Robot
a7efff1ddb Merge "Only one channel is reserved for WifiP2pSettings" am: 4444a35bcf am: 71a123db03
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2309227

Change-Id: I5483d044093d711f6f521fc9cdd738dc9638c0fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 00:38:11 +00:00
Treehugger Robot
71a123db03 Merge "Only one channel is reserved for WifiP2pSettings" am: 4444a35bcf
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2309227

Change-Id: Ib9f5b095b2a69139ace91d319e9e649ac8948ed0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 00:09:36 +00:00
DingFei Song
42ee738f1b Only one channel is reserved for WifiP2pSettings
Every time we enter WifiP2pSettings, a channel will be created,
but we should keep only one channel if p2p connected.

Bug: 259364357

Change-Id: Ie3c1b1281d74332cd5df720fb13476097f3f5df9
Merged-In: I999b108bc3e3c22519398a55b503078c1069cef1
Signed-off-by: DingFei Song <v-dingfeisong@xiaomi.corp-partner.google.com>
2022-11-28 18:29:00 +00:00
Quang Luong
b6c2ed6759 Make P2P Settings channel static
P2P Settings creates a P2P channel but does not close the channel if
there is a P2P connection. This causes multiple channels to accumulate
if P2P Settings is repeatedly opened and closed. Making the channel
static will ensure that each time a new P2P Settings activity is
created, the existing open channel will be used.

Bug: 259364357
Test: build
Change-Id: I999b108bc3e3c22519398a55b503078c1069cef1
2022-11-23 17:57:58 +00:00
Chaohui Wang
125baab6ec Merge "Remove lifecycle-extensions from Settings" 2022-11-17 07:15:00 +00:00
Treehugger Robot
dd5e46746c Merge "Make p2p start searching after turning off airplane mode." am: adb5c5025a am: 425521478a am: 1b70bcbdc4
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2267183

Change-Id: I23c0fa56c122e7406229fc80bbe49fcba7160861
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 19:59:31 +00:00
Chaohui Wang
f55f9932d9 Remove lifecycle-extensions from Settings
Bug: 259352947
Test: Make Settings
Change-Id: Ide9749494ae89ca401120eb5ffee9c0d87043c48
2022-11-16 18:56:05 +08:00
Treehugger Robot
1b70bcbdc4 Merge "Make p2p start searching after turning off airplane mode." am: adb5c5025a am: 425521478a
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2267183

Change-Id: I84c783493a82247653fdc60932a0383d0c74d61f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 09:40:56 +00:00
Treehugger Robot
425521478a Merge "Make p2p start searching after turning off airplane mode." am: adb5c5025a
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2267183

Change-Id: Idb18ef0319f4a36e49cc01f9d9fced1918d12096
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 09:08:59 +00:00
Yu
0aed038b0a Make p2p start searching after turning off airplane mode.
In the P2P page, p2p stops searching when airplane mode is turned on, and should start searching when airplane mode is turned off.

Bug: 255249207
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiP2pSettingsTest

Signed-off-by: Yu <zhangyu34@xiaomi.com>
Change-Id: I71d5eb6c3d8533417e8ae9ac09e7fac73983644e
2022-11-16 12:19:23 +08:00