Commit Graph

2866 Commits

Author SHA1 Message Date
Weng Su
9ed56d081c Merge "Settings: Fix NPE FC when access saved wifi p2p device after screen rotation" am: c68e241fa6 am: ec1b6c308a am: c422d95147
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1989236

Change-Id: I71a0799dd5561b069d587491f78957e48fa87541
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 09:06:51 +00:00
Weng Su
c422d95147 Merge "Settings: Fix NPE FC when access saved wifi p2p device after screen rotation" am: c68e241fa6 am: ec1b6c308a
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1989236

Change-Id: I7ba4a451a493b9d4df278f7aee6bfbacc9bf2322
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 08:47:33 +00:00
Weng Su
c68e241fa6 Merge "Settings: Fix NPE FC when access saved wifi p2p device after screen rotation" 2022-04-01 08:08:51 +00:00
Treehugger Robot
4440e7a067 Merge "Settings: Fix WifiSettings FC when rotating screen" am: f558fc27d9 am: 3531a34760 am: caa0bbd931
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1975409

Change-Id: I56e489c2867242dfc425aba6dea8896d903ab4c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 02:16:00 +00:00
Treehugger Robot
caa0bbd931 Merge "Settings: Fix WifiSettings FC when rotating screen" am: f558fc27d9 am: 3531a34760
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1975409

Change-Id: Iffb14760e676a66d061f500a1e9fc383c2a317e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 02:01:14 +00:00
Treehugger Robot
f558fc27d9 Merge "Settings: Fix WifiSettings FC when rotating screen" 2022-04-01 01:23:47 +00:00
Weng Su
2088b4985d WiFi restricted connection when scan QR code
- Use WifiEntry#canConnect() to determine if the network can be
  connected.

- Add WiFi network but don't connect if WiFi restricted connection.

- See the result screenshot in b/203168943#comment16

Bug: 203168938
Bug: 203168943
Test: manual test
make RunSettingsRoboTests \
  ROBOTEST_FILTER=WifiDppQrCodeScannerFragmentTest

Change-Id: I06d1e832176e540ddd1adce8da46ef8659534ab7
2022-04-01 06:04:34 +08:00
Quang Luong
6ca8dd1b1a Do update signal icon for -1 level in AddAppNetworksFragment am: baf2ef0be6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17511482

Change-Id: I50e3649c21bb83ee9130fa98a71560fe261198a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 17:45:25 +00:00
hoffc
0991b39ed3 Settings: Fix NPE FC when access saved wifi p2p device after screen rotation
Rotating screen, wifi p2p setting fragement will be re-created and the selected wifi p2p device will be saved in onSaveInstanceState. However, now this saved wifi p2p device is restored in onActivityCreated, this is too late. So when getting this saved wifi p2p device return NULL in onCreateDialog and leads to NPE force close.

Restore the saved wifi p2p device in onCreateView instead of onActivityCreated.

Bug: 220025725
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiP2pSettingsTest

Change-Id: I9b746e21f7f3651c69b1445f2389c089ec19319c
2022-03-31 06:52:37 +00:00
hoffc
f3fe5cf197 Settings: Fix WifiSettings FC when rotating screen
Rotating screen will trigger wifisettings re-creation. Force close occurs If receiving wifi picker tracker callback during activity finishing.

Bug: 218411211
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiSettingsTest

Change-Id: I06d251a8a12d3f8785db24ead0abe31c0f34cc9b
2022-03-31 04:00:52 +00:00
Quang Luong
baf2ef0be6 Do update signal icon for -1 level in AddAppNetworksFragment
The level of a WifiEntry may be -1 (WIFI_LEVEL_UNREACHABLE) due to race
conditions. Thus, only update the signal icon if the level is a valid
value [0, 4]

Bug: 201488249
Test: m
Change-Id: I87f1c108d262bb5a7575c9ad434d2cfb953134af
(cherry picked from commit 9d66b22ee0)
2022-03-30 21:48:31 +00:00
TreeHugger Robot
670016a2ee Merge "[LeAudio] Remove the QrCamera and decorateView in Settings" into tm-dev 2022-03-29 06:33:46 +00:00
TreeHugger Robot
5fd1f8fe4e Merge "Restrict secondary users to share Wi-Fi network" into tm-dev 2022-03-28 08:43:23 +00:00
Quang Luong
8a5e6be37a Merge "Increase WifiEntryPreference summary max lines for verbose logging" into tm-dev 2022-03-25 15:50:04 +00:00
Weng Su
876f691377 Restrict secondary users to share Wi-Fi network
- Remove "Share" and "Forget" options from the long press menu

- Rollback the Wi-Fi details restriction for admin user only

- Add SafetyNet Logging for security report

Bug: 206986392
Test: manual test
make RunSettingsRoboTests \
  ROBOTEST_FILTER=NetworkProviderSettingsTest
make RunSettingsRoboTests \
  ROBOTEST_FILTER=WifiNetworkDetailsFragmentTest

Change-Id: Ic434f0583cba557228c72508a501347ffa3141e1
2022-03-25 13:49:43 +00:00
TreeHugger Robot
727583b75f Merge "Fix Wi-Fi hotspot switch UI issue" into tm-dev 2022-03-25 08:40:57 +00:00
Quang Luong
8cf82f41d5 Increase WifiEntryPreference summary max lines for verbose logging
If Wifi verbose logging is on, increase the max lines for
WifiEntryPreference's summary to 100 in order to fit the extra verbose
logging information.

Bug: 222337006
Test: manually build and verify verbose summary fits
Change-Id: I919ae1bcfb26ea8c2548ebdcd3387c90e1d17ea9
2022-03-24 16:17:23 -07:00
Zoey Chen
bf99e37329 [LeAudio] Remove the QrCamera and decorateView in Settings
Bug: 214340362
Test: Manual test
Change-Id: Ibc29f0e90af28e14a11164fa8940920745545c7e
2022-03-24 21:19:18 +08:00
Weng Su
b844a7a920 Fix Wi-Fi hotspot switch UI issue
- The Wi-Fi hotspot switch only handles the click event from the UI.

- Use the onSwitchChanged callback to handle click and swipe events.

Bug: 218891956
Test: manual test
make RunSettingsRoboTests \
  ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest

Change-Id: Ie4136443845489be295a8ee0f3058f493a3b5829
2022-03-24 20:09:29 +08:00
Betty Chang
0ef919db7e Merge "Move the QrCodeGenerator from Settings to SettingsLib for Wifi and BT" into tm-dev 2022-03-24 08:21:16 +00:00
changbetty
dacce1fae3 Move the QrCodeGenerator from Settings to SettingsLib for Wifi and BT
Bug: 214338905
Test: Manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=QrCameraTest
Change-Id: I1ca3e9e0b2cdc9fd3f32da8c5329c0e887ee3427
2022-03-23 13:38:46 +00:00
TreeHugger Robot
a12da0a8e8 Merge "Fix adding wifi configuration issue" into tm-dev 2022-03-23 08:27:47 +00:00
Weng Su
f5cd7140f4 Fix adding wifi configuration issue
- The Wi-Fi Enterprise Restrictions add a new
  UserManager.DISALLOW_ADD_WIFI_CONFIG restriction from T.

- When a user requests to add Wi-Fi configuration, Settings will
  reject the request if the user is not allowed.

- The above restriction need to be retrieved in advance so that the
  user's request will not be rejected.

- See the result screenshot in b/224459753#comment8

Bug: 224459753
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=AddAppNetworksActivity

Change-Id: I2dfb6b9946dd9dbd4eb8bf0f6549ac5cb4466f17
2022-03-23 06:18:55 +08:00
Weng Su
98d30c880d Fix ConnectivityManager.requestNetwork crash issue when try again
- When the user requests "try again", the Network-Request-Dialog will be
  recreated. If the Wi-Fi framework sends the callback result at this
  time, the Network-Request-Dialog may not be ready at the moment,
  causing the NPE to crash.

- Add NPE checks to avoid crash issues.

Bug: 220679437
Test: manual test
make RunSettingsRoboTests \
  ROBOTEST_FILTER=NetworkRequestDialogActivityTest

Change-Id: I8e48a29649e72d9f8c67c4ac24f0eb27ba600dae
2022-03-22 18:14:22 +00:00
Treehugger Robot
4463829319 Merge "Add null check for mChannel object in WifiP2Settings" am: 2f4962c862 am: 0b28adfd8e am: bbb9db4149
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2030626

Change-Id: Ibe6ef9677e7892448000bb2d83501258dacd57d9
2022-03-18 23:24:19 +00:00
Yibo Wang
e20ddfa5f4 Add null check for mChannel object in WifiP2Settings
When user switch between settings of hotspot(Enable hotspot),
Internet(Enable Wifi) and Wifi-Direct(establish, disconnect and
forgot P2P connection).

mChannel becomes null during WiFi P2P user scenarios resulting
in Settings(com.android.settings) crash on enable Wifi.

This commit fixes mChannel IllegalArgumentException: Channel
needs to be initialized.

Test: manual test
Bug: 218608961
Change-Id: I72c67bcd1086afe2aa8d2c5521107e2d38e5b0bb
2022-03-18 15:08:51 +01:00
Treehugger Robot
64e4a57fa3 Merge "Crash when scanning WiFi QR code" am: 6c31283455 am: 7950a0acaf am: 7ada247bac
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2020675

Change-Id: I02f6d022aff0740281e53d208809ca9a3b10860c
2022-03-16 17:03:37 +00:00
David Magno
351af8ebd1 Crash when scanning WiFi QR code
Fix two crashes when scanning a WiFi QR code.
The crashes are due to the asynchronous nature of the scan/decode
process, where the result is delivered after the activity has been
destroyed.

Bug: 223640678
Test: manual, Settings -> Network & internet -> Internet
      Press the 'Scan QR code' icon
      Start to scan a WiFi QR code
      Just before then scan/decode completes, press Back
Change-Id: Ic19ca08590ed76ca9be46eabe3e0b17419fb0b44
2022-03-16 08:53:37 +00:00
Les Lee
4801983e1f Merge "wifi setting: Add psk length check" into tm-dev 2022-03-10 11:28:43 +00:00
Les Lee
3bb2a81042 wifi setting: Add psk length check
Frameworks move psk ascii password length check from API level to
framework internal. Add the check code in Setting side to avoid breaking
the unit test.

Bug: 223513510
Test: atest -c WifiUtilsTest
Change-Id: I7c78eb367fdcbbc11bbb7169ba8f2edc720ad071
2022-03-09 16:28:30 +08:00
Weng Su
190d871520 Restrict WiFi network connection
- Use StandardWifiEntry#canConnect() to determine if the network should
  be disabled or not.

- Use StandardWifiEntry#getSummary() to retrieve the restriction message.

- Disabled WiFi network if it cannot connect.

- If WiFi network is connected or saved network, leave it enabled to
disconnect or configure.

- See the result screenshot in b/203168943#comment11

Bug: 203168938
Bug: 203168943
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=LongPressWifiEntryPreferenceTest
make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest

Merged-In: I04aafaa5b383598a0f87eea15d06b38bbc662b9e
Change-Id: I04aafaa5b383598a0f87eea15d06b38bbc662b9e
(cherry picked from commit f86bdc9c69)
2022-03-08 07:06:30 +00:00
TreeHugger Robot
8f8e9c98f4 Merge "p2p: Close the channel when onStop is called." into tm-dev 2022-03-07 06:40:05 +00:00
Jimmy Chen
78a0f6f98e p2p: Close the channel when onStop is called.
P2P dialog is moved to an indenpendent activity, it will push Settings
to background and trigger onPause(). As P2P dialog is a Dialog Activity,
it won't trigger onStop, but SoftAp and NAN activity will. Moving
channel closing to onStop to adapt to new P2P dialog design.

Bug: 219406778
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiP2pSettingsTest
      create a p2p connection between 2 devices with this build.
Change-Id: I2fab5aa1021ec1a993f811c7310079db9d7f03c0
2022-03-07 10:44:04 +08:00
cnchen
3aff4b1513 Add dynamic color support
(before)https://hsv.googleplex.com/6220707954425856
(after)https://hsv.googleplex.com/6270261408038912

Bug: 209889556
Test: see the hsv above
Change-Id: Ifee0392c189dbe7210ba2561355e2c275e7cb7fe
2022-03-04 11:58:26 +08:00
Weng Su
e4b9fb2f80 Allow new users to configure WiFi details
- Remove the limitation of the Settings UI for Admin user only.

- See b/206986392#comment32 for a screenshot.

Bug: 206986392
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiNetworkDetailsFragmentTest

Change-Id: I31971d644cd475123255ffb6c93c16ff171f77ad
2022-02-14 17:08:37 +08:00
Weng Su
0b82d67a04 wifi data usage: Query wifi usage per configuration
- Updated to use the AllNetworkKeys set instead of NetworkId.

- Fix crash issue when mDataUsageController is not created.

- See b/126299427#comment37 for a screenshot.

Bug: 126299427
Test: manual test
make RunSettingsRoboTests
ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiDetailPreferenceController2Test
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiDataUsageSummaryPreferenceControllerTest

Change-Id: I26289fde1f18d97631448edc71e034d33b865cc4
2022-02-11 06:32:04 +08:00
Quang Luong
9d66b22ee0 Do update signal icon for -1 level in AddAppNetworksFragment
The level of a WifiEntry may be -1 (WIFI_LEVEL_UNREACHABLE) due to race
conditions. Thus, only update the signal icon if the level is a valid
value [0, 4]

Bug: 213477566
Test: m
Change-Id: I87f1c108d262bb5a7575c9ad434d2cfb953134af
2022-01-21 14:56:07 -08:00
TreeHugger Robot
423ea1825f Merge "Refine the plural strings design in Settings" 2022-01-18 19:46:49 +00:00
Weng Su
cfe2804647 Merge "Enable Carrier-Config cache for Settings" 2022-01-17 14:24:50 +00:00
Weng Su
072755ef02 Refine the plural strings design in Settings
- Use MessageFormat instead of getQuantityString().

Bug: 199229953
Test: manual test
See b/199229953#comment2 for a screenshot result.

Change-Id: I4fc9cecc83f503203ec5dbc1af638036d7026e07
2022-01-16 22:33:12 +08:00
Weng Su
7822750c31 Enable Carrier-Config cache for Settings
- Since the "Mobile-Data Details Settings" (NETWORK_OPERATOR_SETTINGS) will query Carrier-Config around 70 times during launching, use the Carrier-Config cache to reduce 69 times to speed up the launching time.

- It takes about 3ms to query a Carrier-Config each time.

- Create a singleton class to share the Carrier-Config for all
sub-settings.

Bug: 204135235
Test: manual test
atest -c ApnPreferenceControllerTest \
         AutoSelectPreferenceControllerTest \
         BackupCallingPreferenceControllerTest \
         CarrierConfigCacheTest \
         CarrierPreferenceControllerTest \
         CarrierSettingsVersionPreferenceControllerTest \
         DataServiceSetupPreferenceControllerTest \
         Enable2gPreferenceControllerTest \
         EnabledNetworkModePreferenceControllerTest \
         Enhanced4gBasePreferenceControllerTest \
         MobileNetworkUtilsTest \
         NetworkProviderBackupCallingGroupTest \
         NrAdvancedCallingPreferenceControllerTest \
         PreferredNetworkModePreferenceControllerTest \
         TelephonyTogglePreferenceControllerTest \
         WifiPickerTrackerHelperTest
make RunSettingsRoboTests \
     ROBOTEST_FILTER=ContactDiscoveryPreferenceControllerTest
make RunSettingsRoboTests \
     ROBOTEST_FILTER=VideoCallingPreferenceControllerTest

Change-Id: I26f9ac115a754910b5d59e820703f1a0e701bb7f
2022-01-14 23:28:50 +08:00
Jimmy Chen
d0e27f8dbd Merge "wifi: add Trust-On-First-Use option for CA" 2022-01-13 15:42:46 +00:00
Betty Chang
277976811d Merge "Add WiFi Enterprise restrictions check for WiFi Configuration Addition" 2022-01-12 02:04:17 +00:00
Treehugger Robot
61e1a07529 Merge "[MS50] Remove NetworkTemplate#buildTemplate* usages" am: 0ccb8750b9 am: 039cdfd764 am: 5ea82e5955 am: b21993b793
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1943134

Change-Id: I4fe5dfdfc66aaad72a31de1761c28c6245db5bd6
2022-01-11 10:51:15 +00:00
Treehugger Robot
b21993b793 Merge "[MS50] Remove NetworkTemplate#buildTemplate* usages" am: 0ccb8750b9 am: 039cdfd764 am: 5ea82e5955
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1943134

Change-Id: I21f0e516ec82f875638eabcd700fdead02048d7c
2022-01-11 10:03:53 +00:00
Jimmy Chen
bde88c4b8d wifi: add Trust-On-First-Use option for CA
Bug: 196180536
Test: * connect to a EAP-TLS network with TOFU option
      * make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test
Change-Id: I30b55d835bd073d604bddd235f2425bdc8b647af
2022-01-11 17:17:47 +08:00
Junyu Lai
123f2e1581 [MS50] Remove NetworkTemplate#buildTemplate* usages
This is a no-op refactoring.
These functions are deprecated and replaced by
NetworkTemplate#Builder, use public API instead.

Test: make RunSettingsLibRoboTests
Bug: 204830222
Change-Id: Idc2a09d8e3789ca2c7a97691cfad4b2e2b417f0d
2022-01-11 02:53:03 +00:00
changbetty
06df9c9fc0 Add WiFi Enterprise restrictions check for WiFi Configuration Addition
When UserManager.DISALLOW_ADD_WIFI_CONFIG is set to true.
  - Disable the "Add network" item in the Internet settings.

  - Activity action API for ACTION_WIFI_ADD_NETWORKS should not be
    permitted and the user shouldn’t see a prompt for approval

Bug: 203169077
Test: make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AddAppNetworksActivityTest
Change-Id: I18d7703b5972bfbc12dca10b6432d756813abace
2022-01-10 16:06:20 +00:00
Weng Su
9bd8f046a9 Fix WifiDialogActivityTest broken
- The ShadowWifiManager class is not working as expected

- Use Mockito class instead of Shadow class

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

Change-Id: Idbc851c4d9702be23561c2c48c9d7d077e5f452e
2022-01-06 08:45:40 +00:00
Michael Groover
d1f76eea72 Merge "Add unaudited exported flag to exposed runtime receivers" 2022-01-03 17:35:02 +00:00