Commit Graph

47 Commits

Author SHA1 Message Date
Les Lee
03cb9dcb8a Merge "wifi: Handle wifi ap initial state before register intent" into tm-qpr-dev am: b75858bf82
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19491094

Change-Id: I65a54ab88204a4dfd484a8faf157d6b9db5b3f69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 02:02:41 +00:00
Les Lee
c6c6ef3a58 wifi: Handle wifi ap initial state before register intent
The intent WIFI_AP_STATE_CHANGED_ACTION is not sticky intent after
SC-V2, query wifi ap state and run intent handling after registering intent.

Bug: 231214355
Test: make RunSettingsRoboTests ROBOTEST_FILTER=Hotspot
Test: make RunSettingsRoboTests ROBOTEST_FILTER=Tether
Test: Manual test, the state shows correctly even if resume hotspot settings page from recent app.
Change-Id: Iab6b2b8628d725b003d5e5c4086420a329611745
2022-08-25 23:07:40 +08:00
Treehugger Robot
3682ed9fca Merge "Keep setting of "TurnOff hotspot automatically" when AP is changed" am: 79e1afbdfa am: bef728d2ff
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2123300

Change-Id: Iff5656052d729efb83a1947ecfd2393e87c9460a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 17:54:52 +00:00
Bruno Kremp
b16ac39ee1 Keep setting of "TurnOff hotspot automatically" when AP is changed
When AP config is changed, setting of "TurnOff hotspot automatically"
will be reset to default. Hence keep the setting when AP config changed.
Keep setting of whether auto shut down is enabled when AP
config changed.

Co-authored-by: Fangxiao Cao <fangxiao.x.cao@sony.com>

Test: manual test
Bug: 235370570
Change-Id: Ibd3d59b6a86edaf1253a2c9b035576e60a7beb96
2022-06-15 09:20:18 +02:00
Weng Su
e37a553e94 Show restricted message in Wi-Fi hotspot settings
- Remove Wi-Fi hotspot preferences in settings search if Wi-Fi hotspot is disallowed

- See the result screenshot in b/203168953#comment12

Bug: 203168953
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: Id4416fd0659b596e4e6f31890a139198219f4552
2022-05-03 13:58:54 +08:00
Weng Su
37edbd33b8 Remove redundant WiFi tethering listener
- WiFi tethering settings currently listeners two sets of WiFi tethering
  state from framework at the same time, There is a timing issue when
  the deprecated callback is sent earlier than the available callback,
  it will cause WiFi tethering settings to start tethering twice in a
  short period of time, causing the WiFi framework to respond with a
  startup error.

- Remove redundant obsolete WiFi tethering state listener to avoid
  WiFi tethering startup error.

Bug: 227719584
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: I59cb5222acb763f630fb621250d7740a240bbd92
2022-04-13 05:04:47 +08:00
Michael Groover
911f7e7aa9 Add unaudited exported flag to exposed runtime receivers
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting T or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the T release.

Bug: 161145287
Test: Build
Change-Id: Ie97372efebd8258d9a4c503771d55109a85e6ae9
2021-12-09 20:34:02 -08:00
changbetty
6ceab7b916 Remove the Advanced item when Security type is open
Bug: 202674761
Test: Manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest
Change-Id: Iaac76a5a1370d5f9fcea2e1aaa0f02310ed4a5a3
2021-10-21 05:51:20 +00:00
Weng Su
f53c4ca8ae [Provider Model] Remove "Advanced" from Wi-Fi hotspot settings
- Screenshot:
  https://screenshot.googleplex.com/B4vjvGdcQUL8YCR

Bug: 184907962
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: I934061c9129e77fc37381d1eba4a8107d40131eb
2021-04-12 11:22:48 +08:00
Bonian Chen
234b698fb2 Revert "[Settings] Support getSystemService(Class<T>)"
This reverts commit d5ccde31a8.

Reason for revert: failure on test cases

Change-Id: I0a179a6ebb5ef1dec566ce6e8facd5f3b82d7c8a
2021-03-30 00:51:15 +00:00
Bonian Chen
d5ccde31a8 [Settings] Support getSystemService(Class<T>)
Add getSystemService(Class<T>) to align the capability with framework
part.

This is a back port from aosp/1639943, aosp/1645152 and aosp/1648047

Bug: 179640862
Test: local
Change-Id: I035db55a71f94000ca35f8d71f03c19208423c73
2021-03-24 00:59:46 +08:00
Weng Su
68b0057f66 Smart Router settings UI changes
- Remove "AP band" preference

- Add "Maximize Compatibility" switch preference
  - Use bridged mode API for new devices (after P21)

- Screenshot:
  https://screenshot.googleplex.com/84X9Av8gVj3idjB

Bug: 168052744
Test: manual test
atest WifiTetherMaximizeCompatibilityPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: Ib74156c0fa6eccdd13239854047b1fb4e49a293c
2021-03-16 21:50:55 +08:00
paulhu
6151c227e0 Replace ConnectivityManager hidden symbols on Settings
Connectivity is becoming a mainline module in S, so
ConnectivityManager hidden symbols can not be used for outside
components. Besides, most Tethering relevant methods or variables
on CM are migrated to TetheringManager. So replace all these
methods or variables from ConnectivityManager to TetheringManager
on Settings.

Bug: 180693313
Test: make RunSettingsRoboTests ROBOTEST_FILTER=<Modified Test>
Change-Id: Iba4b121a4ddf3f04252aa0355e0e6494a593682a
2021-02-24 06:17:17 +00:00
Stanley Wang
b87ddba6cd Use SettingsLib's MainSwitchBar to replace SwitchBar in Settings.
To log Settings metrics, the MainSwitch extends MainSwitchBar and
replace the SwitchBar in SettingsActivity.

Bug: 175181773
Test: Run robotest and apply the widget in Settings and see the ui

Change-Id: I3add3702e9058ad9192b5172c7cf0e2ccfb55a70
2021-01-14 22:48:31 +08:00
Weng Su
b9c865b704 Add Hotspot WPA3 Settings
- Add WPA3 SAE security types
  - "WPA3-Personal"
  - "WPA2/WPA3-Personal"

- Verify valid WPA3 password

- Enable QR code scanner for Hotspot WPA3

- Avoid null point exception when settings keyword searching

- Screenshot
  https://screenshot.googleplex.com/B6u54wh8w35Xnyf
  https://screenshot.googleplex.com/8hWHHUTb6UaS9vB

Bug: 167968488
Test: manual test
- atest WifiTetherSecurityPreferenceControllerTest
- atest WifiUtilsTest

Change-Id: I2992040498f8add107a4cce70a92c1c6ee6ab805
2021-01-10 08:38:39 +00:00
bsears
598ab32345 Revert "Add Hotspot WPA3 Settings"
This reverts commit e0062af10c.

Reason for revert: Bug 176569060 - Droidfood blocking crash in Settings app.

Change-Id: Id50c96e8ce704b19e5ffb9b9a9fcbb0db2d81aee
2020-12-31 21:16:51 +00:00
Weng Su
e0062af10c Add Hotspot WPA3 Settings
- Add WPA3 SAE security types
  - "WPA3-Personal"
  - "WPA2/WPA3-Personal"

- Verify valid WPA3 password

- Enable QR code scanner for Hotspot WPA3

- Screenshot
  https://screenshot.googleplex.com/B6u54wh8w35Xnyf
  https://screenshot.googleplex.com/8hWHHUTb6UaS9vB

Bug: 167968488
Test:
- Manual Test
- atest WifiTetherSecurityPreferenceControllerTest
- atest WifiUtilsTest

Change-Id: I155ed0bfd187d27ba864f9fb1b78d08c437740f3
2020-12-29 08:04:10 +00:00
Weng Su
ae3ef639d9 Use new strings for Wi-Fi hotspot toggle specific scenario
- The SW (Swahili) language is used for a different noun class and is
inappropriate in the context.

- Need to separate different strings for specific situations.

- Use new strings from SettingsLib resource

Bug: 168801172
Bug: 168733667
Test: Manual test
Change-Id: I0e0a688f54ca2ee1b4cd5049c7e0f3ff3112b127
2020-11-03 09:26:40 +00:00
Arc Wang
b347128bbf [Wi-Fi] Expose AP Band outside of the Advanced section
Design change for UX improvement.

Bug: 156629343
Test: manual visual
Change-Id: I4ff89eec472de699d1fa723d8369ad99b78a83a3
2020-05-18 11:13:47 +08:00
Arc Wang
ac5e1acfba [Wi-Fi] Control Wi-Fi Hotspot Settings using onClick instead of onSwitchToggled
In the current Settings framework onSwitchToggled has been implemented
to monitor the change in Settings done by user but its getting called
even when Settings is changed using setChecked where under certain
condition like rotation during config changed,
Tether Settings is disabled and then enabled and later before Rotation
Settings remained false due to stop Tethering with Tether Enabled
After Rotation when settings is initialized it is set as disabled
and even after receiving the Tether Enabled it remains Off.
Hence used onClick to monitor user ON/OFF Settings

Bug: 142625203
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest.java
Test: Manual
1. Go to Wifi Hotspot Settings
2. Turn ON
3. Change SSID and save
4. Rotate screen soon after saving
Result: Hotspot does not turn ON, remains in OFF state.
Signed-off-by:JeiFeng Lee <linger.lee@mediatek.com>

Change-Id: Ibddacdf35eb3196f40cdb2c240efa902f9123646
2020-03-05 18:21:39 +08:00
Zhen Zhang
d2a7f9ae79 Use feature flag to show/hide AllInOneTetherSettings
This partially reverts commit 0ccc849de7
which added a config value. Instead, we will use feature flag to switch
between the fragments.

This CL also adds a postfix to keys in all_tether_prefs to
de-duplicate with keys in tether_prefs and wifi_tether_settings.

Bug: 148182953
Change-Id: I92832c786473990065a965409072e4117a7e75a8
Fix: 148618984
Test: make RunSettingsRoboTests
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
2020-01-30 16:01:42 -08:00
Zhen Zhang
0ccc849de7 Add config value to switch between Tether Settings UIs.
Adding this config value to make it easy to switch to developing
Tethering settings UI. Also, using this config value to make sure
that preferences from new AllInOneTetherSettings screen won't show up in
the search results.

Bug: 147915366
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TetherSettingsTest
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=TetehrPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: I8c88816a8f2b40fc219cae8d0d442454c5270b2b
2020-01-21 07:37:56 +00:00
lesl
24a505c4eb softap: Use set/getPassphrase to replace set/getWpa2Passphrase
Bug: 142752869
Test: Manual, on/off/setting change for hotspot function
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
Change-Id: I22c89f15a6ef1c5366394431cc5aa7031a573d45
2020-01-09 19:23:41 +08:00
lesl
ff012f03a8 Wifi Setting: Use SoftApConfiguration for Tether Setting
Bug: 145578449
Test: Manual
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
Change-Id: I02b4dcbb7b6e29b67ecc7356200f3fc3a1007562
2019-12-05 17:28:24 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Raff Tsai
1f30b1cd67 Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
2019-09-12 11:09:09 +08:00
govenliu
6ee894759a [Wi-Fi HotSpot] Improve Wi-Fi hotspot settings entries visibility problem
When the security type of hotspot changed, the hidden item will showed because of the Expanded child list is set as constant.

To improve it, dynamicall adjust the Expanded child count according to the security type.

Bug: 138594907
Test: Manually
      1. Enter Settings APP -> Network & internet -> Hotspot & tethering
      ->Wi-Fi hotspot
      2. Check if there are only two expanded items if the
      Security type is None, or three expaned items if the Security type
      is WPA2-personal
      3. Change the Security type and back to check item 2 match or not.

Change-Id: I84d1c5dca94d6a218cfc7ecd57e201e1cffdd878
2019-08-15 19:07:22 +08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
jackqdyulei
5ca4e06dfe Add lost prefController to WifiTetherSettings
One controller is lost during a refactor(ag/4774003), this CL adds
it back.

Change-Id: Ie50a3ac009f302d4fd7a179117fe026031cc1ae8
Fixes: 122235175
Test: RunSettingsRoboTests
2019-01-02 11:30:03 -08:00
Doris Ling
9f1c617016 Disable toggling wifi tethering in secondary user.
- in previous release, the shortcut widget was for the top level
Hotspot & Tethering settings page. The top level settings has logic to
check whether the page is restricted and remove all preferences and
show a message to tell the user that tethering settings are not
available, and the user will not be able to launch the wifi hotspot
settings page.
- the updated shortcut now launches the wifi hotspot page directly.
The settings does not check for restriction. Copy the logic from the top
level settings to check for restriction and remove all preferences
accordingly.

Change-Id: I76fb7838e2db379f6ffbce7bf14003bccc1b10d3
Fixes: 116642428
Test: make RunSettingsRoboTests
2018-11-16 15:05:22 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
jackqdyulei
f5aa59e99e Implement createPrefControllers for tether page
So tether preferences could show up in search

Change-Id: I234680aff878451df2a634cb58538bb2627d2eff
Fixes: 112599941
Test: Robotests
2018-08-15 13:15:04 -07:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Salvador Martinez
f3d532f43d Make user explicitly set security type for tether network
This was made implicit which is confusing for the user so this CL
adds a preference to make the user manually choose their security
type.

Test: robotests
Bug: 79435112
Change-Id: Ie78806e8952b52e1b7cd21f0b87c9d064acaff64
2018-05-18 15:21:07 -07:00
Chilun
d3358d8a6f Add index for Hotspot settings page into search
Added index provider into TetherSettings and WifiTetherSettings pages.
Added robotests to check the keys returned by getNonIndexableKeys.
Move repeated code into utility class.

Bug: 74777873
Test: make -j RunSettingsRoboTests
Test: atest UniquePreferenceTest
Change-Id: I6cb09d735afa4867d25a79de733ce8c59634e49b
2018-05-09 14:05:15 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Salvador Martinez
670a3e582f Make it possible to have open tether network
Previously people could have open tether networks but a restrction
was placed on this sometime in the past. However there is no migration
plan in place for people with open tether networks which will cause
problems when the new requirements are enforced. This CL makes it
so tether networks can be open once more.

Test: robotests
Bug: 65784990
Change-Id: I6e350dd53b9b9f987dd5a4cc317ba18d7f50df79
2018-04-09 11:30:37 -07:00
Fan Zhang
f7843adabd More renaming in DashboardFragment
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936

Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
2018-02-23 16:56:30 -08:00
jackqdyulei
c1cc490f74 Add toggle for enable/disable auto hotspot off
Bug: 69323125
Test: RunSettingsRoboTests
Change-Id: I18896401240f75bdf2bdf187c2c7a7b623b20c43
2017-12-20 14:09:16 -08:00
Fan Zhang
cb4fb095d7 Misc fixes
- align wifi connection dialog edittext to viewStart
- Generate a random password when wifi tether password is null

Change-Id: Ia5ca6098c9ef4641cb4f8b4e2b126da061e62830
Fixes: 67749595
Fixes: 64967301
Test: robotests
2017-11-14 16:53:28 -08:00
Fan Zhang
5a8b70d3da Refresh Wifi AP Config display when config changes
Change-Id: I6fe284355223cbcedd82f95d6415c4d6b660f39f
Fixes: 64757839
Test: robotests
Test: rerun ACTS WifiTetheringTest:test_change_wifi_hotspot_ssid_when_hotspot_enabled
2017-09-18 13:42:36 -07:00
TreeHugger Robot
d0b09f7868 Merge "Remove code for old wifi tether feature" 2017-08-10 00:08:03 +00:00
Fan Zhang
7686ef863c Misc tweak on wifi hotspot setting page
- Make hotspot password show in plain text
- Make main control into a master switch style

Change-Id: I8fdb293a617787f256fb663708cfc0e454f548d2
Fixes: 63865785
Test: robotests
2017-08-03 16:23:27 -07:00
Fan Zhang
defb1183ec Remove code for old wifi tether feature
Change-Id: If92798ddf075801e66cd97ecacff2f8df1e41985
Fix: 64032458
Test: rerun robotests
2017-08-01 16:18:24 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Fan Zhang
78d5efdfea Refactor hotspot into a full page
- Deprecated WifiAPEnabler, and copied most of its logic into various
  controllers and WifiTetherSettings.
- Added tests

Fix: 37253404
Fix: 36181835

Test: make RunSettingsRoboTests
Change-Id: Iad994d61b694ad7f1113d045a3e7500eeaec178b
2017-06-14 12:32:44 -07:00