Commit Graph

27 Commits

Author SHA1 Message Date
pastychang
38c857bd60 Fixed WiFi dialog force closed when physical window size is changed.
When window size is changed, dialog should not be dismissed on the destroy. It will cause dialog to be shown from on create and then dismissed from on the destroy right away.

Bug: 190573335
Test: manual
Change-Id: I995c3cbf90a9ec3c5305ef57e655b0b0eb7cf5cc
2021-09-01 06:52:44 +00:00
Weng Su
199528d460 Add SafetyNet logging
- Add SafetyNet log if the calling package is no the permission for
result

Test: checked eventlog in the bugreport
Bug: 185126813
Change-Id: I1535f6f2ded2445702df0d723518b773cd094164
2021-07-05 16:02:40 +08:00
Weng Su
71e728e934 Add permission checking to WifiDialogActivity
- Use getCallingPackage() to get calling package.

- Check if the calling package has ACCESS_COARSE_LOCATION or
ACCESS_COARSE_LOCATION permission.

- Only set result data to permission granted callers

Bug: 185126813
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiDialogActivityTest

Change-Id: If7ca069c842ed2bd1aed23f9d4041473c68a4dad
2021-07-02 23:10:11 +08:00
Janis Danisevskis
5cef487b4b resolve merge conflicts of d42d9a41f6 to sc-dev
Change-Id: Ifa6a4af09d7cd45773a8c057416ab90fac23061e
2021-03-17 19:09:29 +00:00
Bonian Chen
203f0fe89d [Settings] Code refactor - remove unused import lines
Remove some unused import lines within source code based on
https://source.android.com/setup/contribute/code-style

Bug: 182867979
Test: build pass
Change-Id: I76dbcfa9e5b435b2838401dfee15b12f472d07d0
2021-03-16 10:24:24 +00:00
Steven Liu
c1477650c9 Introduce a WifiTrackerLibProvider.
This make the WifiTrackerLib can be customized.

Bug: 149540986
Test: manual test wifi picker, and atest com.android.settings
Change-Id: I1418ae39c895ce2ff87f18005a226a4835f9e083
2021-01-06 08:44:34 -08:00
pihuei
55fb2b745d Use system day/night to switch theme instead of from intent extra.
Use value-night to give theme instead of directly from intent extra when Setup day/nNight mode enabled and in Setup flow

Before:
<vision settings>
https://hsv.googleplex.com/4837266235064320
<wifi dialog>
https://hsv.googleplex.com/5687053981319168
<lock screen with disabling button>
https://hsv.googleplex.com/4843506419892224
<lock screen with enabling button>
https://hsv.googleplex.com/5650348922372096
<fingerprint intro>
https://hsv.googleplex.com/5133769046491136
<fingerprint touch>
https://hsv.googleplex.com/5681937198874624
<fingerprint left touch>
https://hsv.googleplex.com/5767441676238848
<squeeze release>
https://hsv.googleplex.com/6632476812247040

After:
<vision settings>
https://hsv.googleplex.com/6213298875793408
<wifi dialog>
https://hsv.googleplex.com/6025790804197376
<lock screen with disabling button>
https://hsv.googleplex.com/5747461219942400
<lock screen with enabling button>
https://hsv.googleplex.com/5766700781797376
<fingerprint intro>
https://hsv.googleplex.com/6751334529236992
<fingerprint touch>
https://hsv.googleplex.com/5625963293442048
<fingerprint left touch>
https://hsv.googleplex.com/4518139360444416
<squeeze release>
https://hsv.googleplex.com/5220720579706880

Bug: 169734655
Test: robo test
Change-Id: I4aab843e28a932c7b823f36f1d8df1e5b2341f4e
2020-11-05 05:09:14 +00:00
Arc Wang
e57ead9a75 [Wi-Fi] Support WifiTrackerLib in WifiDialogActivity
After this change, WifiDialogactivity supports both WifiTrackerLib and
SettingsLib because this is an exported UI component, some other APPs
(e.g., SetupWizard) still use SettingsLib.

Bug: 152571756
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi.WifiDialogActivityTest
      manual
      In Wi-Fi Settings, manually add a Wi-Fi network.
      In SetupWizard, manually add a Wi-Fi network.
Change-Id: I87f477d905cc6ea34ef1afbfade3773920dad6eb
2020-07-22 15:50:42 +08:00
Greg Kaiser
9e9255fb2a Revert "[Wi-Fi] Apply WifiTrackerLib objects in Wi-Fi Slice"
This reverts commit 7b1aded2a6.

Reason for revert: Settings is crashing for WiFi selection in SetupWizard on wembley

Bug: 161434533
Change-Id: I1d90e9bae1b31862fba674db0d7497e43f987a7f
Test: Locally reverted, reflashed, and was able to select WiFi without Settings crashing.
Exempt-From-Owner-Approval: Revert to clear up P0 while all owners are outside of work hours
2020-07-16 14:47:31 +00:00
Arc Wang
7b1aded2a6 [Wi-Fi] Apply WifiTrackerLib objects in Wi-Fi Slice
This change uses WifiTrackerLib's WifiPickerTracker & WifiEntry
to replace SettingLib's WifiTracker & AccessPoint.

This change includes

1. WifiScanWorker has the callbacks similar to a lifecycle component
   but it's not a lifecycle component. Let WifiScanWorker implements
   LifecycleOwner and provides #getLifecycle() for WifiPickerTracker.

2. Remove captive portal related code because WifiEntry#connect will
   handle captive portal login if it's necessary.

3. Create WifiSliceItem to wrap WifiEntry because WifiEntry is an
   abstract object and it does not provide copy constructor.
   Without copy construcor, Wi-Fi Slice may show unexpected information
   when a WifiEntry is updated.

4. Use WifiTrackerLib's NetworkDetailsTracker & WifiEntry in
   WifiDialogActivity because it gets a WifiEntry key from Wi-Fi Slice.
   NetworkDetailsTracker can get the WifiEntry of th key.

Bug: 155613549
Bug: 152571756
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi.slice
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I0718f4647cea007a9b701922f3121a388dd43918
2020-07-16 15:56:42 +08:00
pastychang
ec0a30a8b9 Set QR scan activity to light theme in setup flow
Test: atest
Bug: 131029518
Change-Id: Ibec28e78fcf17390cd3844ead4a88a4e6bff6094
2019-04-23 13:38:39 +00:00
pastychang
1d2b51aeb0 Set WifiDialog to light theme in setup flow
Screenshot: https://screenshot.googleplex.com/X6tkxihEWFY

Test: Manual
Bug: 130507879
Change-Id: Icca6b827cdb62387fde4c91435d4df10e2ff4d04
2019-04-15 05:49:51 +00:00
Arc Wang
13f37337ed Improve UX of Wi-Fi QR code scanner enrollee flow
1. Do not start WifiSettings after enrollee success
2. Return WifiConfiguration to the calling object after enrollee success
3. In WifiDialog, do not show scan button if Save button is not visible to users
4. Fix scanner button may not respond problem by setting listener for scanner
   button of ssid field and password field
5. If SSID is assigned, only allow to enrollee for the network of assigned SSID

Bug: 124416152
Test: manual test
Change-Id: Ic5241c4767eaa8ea01782817d8302d8b0572ab36
2019-02-23 11:59:53 +08:00
Fan Zhang
0db4ead2b3 Hide wifi card sometimes.
When there is a connected wifi, we now hide the wifi slice card.

However, if we initially shows this card but later wifi is connected
while the card is visible, we keep showing this card to avoid janky
animation. The card will be gone if user nagivates to a different UI and
comes back.

- Create a new slice ContextualWifiSlice for homepage use case, all
  special logic for homepage are added here.
- Change reference for WIFI_SLICE to CONTEXTUAL_WIFI_SLICE where make
  sense.

Change-Id: Ibd87f88058f357aabef0f7d68a5bf48350d75b06
Fixes: 121040746
Test: robotests
2018-12-18 10:18:08 -08:00
Pasty Chang
c1f8600d9f Change to use setupcompat and setupdesign for suw pages
1. remove the dependence of setupwizardlib.
2. add to use setupcompat and setupdesign.
3. modify new footer button in following up cl.

Bug: 120805516
Bug: 120872944
Test: RunSettingsRoboTests
Change-Id: I463dd35b799d4250b2aabce0cb0b8102cf9dd7d6
2018-12-12 03:16:29 +00:00
Jason Chiu
f17233ba7d Slice background worker with Wi-Fi Slice
Test: manual

Change-Id: Ic4fdc5713f511ff80f03728c99c68fda3d0cab02
2018-10-18 18:00:11 +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
tmfang
656e94cc06 Fix leaked windows exception in WifiDialogActivity
WifiDialog was created by WifiDialogActivity.
If activity was destroyed suddenly, WifiDialog can't dismiss itself.

So, we need to dismiss dialog, when activity was destroyed.

Test: robo and manual test
Bug: 111841375
Change-Id: I8aaf1c78e72144bf7c9cbc2392bce30e715d86e9
2018-07-30 18:52:02 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Maurice Lam
44ce407d00 Add flag to not connect in WifiDialogActivity
Add flag connect_for_caller, which if false will not connect to the
Wi-Fi network on behalf of the caller.

Test: cd tests/robotests && mma
Bug: 34951731
Change-Id: Ie24a8ed1891aea1caec75a2de9a3d2bdb3dad8a7
2017-11-02 10:50:38 -07:00
Eric Schwarzenbach
bc1cf7e260 Make only the "Add Network" WifiDialog fullscreen.
Fixes an issue where other instances of WifiDialog were being launched
fullscreen. Creates static methods for creating fullscreen and modal
WifiDialogs to make the style more explicit.

Bug: 63889135
Test: make -j40 RunSettingsRoboTests
Change-Id: I2200b5d7f817b9f69a6abb73bf2c04ea24556d19
2017-07-26 17:04:42 -07:00
Maurice Lam
00d82f054c [WifiDialog] Suppress activity transition
Suppress the activity transition when finishing so that only the
dialog's animation will be played.

Bug: 25796672
Change-Id: I0c472313608aa46f780ce2fdb79224c0ad3a4dad
2015-12-22 15:26:12 -08:00
Maurice Lam
dd3e2434ee [WifiDialog] Theme for setup wizard
Use setup wizard themes so that dialogs are shown in the correct
accent colors and dark/light themes.

Bug: 25515641
Change-Id: I87a0a01001944b50e48ec812f071a988f37ed8db
2015-11-06 12:07:32 -08:00
Maurice Lam
30b3287eb5 [WifiDialog] "Add network" return WifiConfig
When adding a network by manually entering SSID, return the wifi
configuration to the caller.

Change-Id: If490a341fe95b9c63f43d3bb30a2114bfcd45082
2015-10-22 16:57:50 -07:00
Maurice Lam
34e5a0c308 [WifiDialog] Allow adding unspecified AP
In WifiDialogActivity, handle the case where the given
accessPointState is null, and show the Wi-Fi dialog allowing users
to enter the SSID and other credentials. This will be used by setup
wizard when user selected "Add new network" item.

Bug: 23392285
Change-Id: Ica2650d9e829d73281bc9c504c3005d9c5750d31
2015-10-22 11:39:26 -07:00
Maurice Lam
771fac591f [WifiSettings] Add Wi-Fi dialog activity
Add a Wi-Fi dialog activity that can be started by setup wizard to
connect to a Wi-Fi access point.

Also refactored mEdit and mModify in WifiConfigController into an
int-enum mMode, with modes view, connect and modify. This is how the
new modes maps to the old flags:

MODE_VIEW     --  mEdit = false, mModify = *
MODE_CONNECT  --  mEdit = true, mModify = false
MODE_MODIFY   --  mEdit = true, mModify = true

Bug: 23426311
Change-Id: I8e2221fd3c42577068e07686dab245dd5888e0ae
2015-09-17 16:03:49 -07:00