Commit Graph

77 Commits

Author SHA1 Message Date
Sunny Shao
076ed573eb Revert^2 "Nullability Annotations replacement"
This reverts commit 19d1d3d15d.

Reason for revert: revert it because this is not the root cause.

bug: 316867690
Change-Id: I0f168dbb64044aa720202af7b1040afd4f028c9c
2024-01-10 07:34:01 +00:00
Sunny Shao
19d1d3d15d Revert "Nullability Annotations replacement"
This reverts commit cf0501e4d7.

Reason for revert: b/317462033, it seems a flaky but revert it first.

Change-Id: Ie1d5e279cca6477fc17d8c27c1ecda8d7a6b2553
2023-12-29 02:28:24 +00:00
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Weng Su
1f0689f73c Restrict network preferences settings
- Show a restriction message if the malware enforces the network preference settings

- Remove settings search index if the network preference settings is restricted

Bug: 231987122
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=ConfigureWifiSettingsTest

Change-Id: I998aa084d47d556d1eeddcec8c6bb5f1d9a8f6e7
2022-06-02 04:50:33 +08:00
Zoey Chen
ad79a1819f [Provider Model] Internal cleanup - remove Provider Model flag and deprecated legacy UI part.4
Test: atest NetworkDashboardFragmentTest
Bug: 197066557
Change-Id: I9781af3a53fe7050b414f0574abb7618f8d71707
2021-12-15 10:19:49 +00:00
Zoey Chen
eb19d4ba59 [Foldable] Show full screen "Install Certificates" for large screen devices
Uses Intent.FLAG_ACTIVITY_NEW_TASK to start the Activity

Test: manual
Bug: 197701944
Change-Id: I6d52bae5ceb399c0869ef0c76d89f16867a83065
2021-10-18 07:21:06 +00:00
changbetty
de57c12412 Remove Connect to public network for Network Rating Provider
According we remove the Network Rating Provider in ag/14675092, and the
Connect to public network item is tied to the Network Rating Provider.
So need to remove together.

Bug: 187119482
Test: Manaul test
      make RunSettingsRoboTests ROBOTEST_FILTER=ConfigureWifiSettingsTest
Change-Id: Ie8a8d5c8d9f2c5db11d6c9e6f84af7864e78814f
2021-06-03 11:22:19 +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
eaa85b0b6c [Provider Model] Remove “Advanced” section
- Screenshot:
  https://screenshot.googleplex.com/bHB4RwhN9PBfWAF

Bug: 172788645
Test:
- manual test
- make RunSettingsRoboTests ROBOTEST_FILTER=ConfigureWifiSettingsTest

Change-Id: Id4c73911905830779004e407be9b01f4faac5268
2020-12-25 08:13:36 +00:00
Weng Su
6bf7b1a72f [Provider Model] Preferences Settings UI change
- Change the title from “Wi-Fi preference” to “Preferences”
- Change the summary from “Wi-Fi turns back on automatically” to
“Connect to public networks”
- Remove “Turn on Wi-Fi automatically” preference
- Screenshot:
  https://screenshot.googleplex.com/Areywyb46deK9VQ
  https://screenshot.googleplex.com/6H5Z4PxA5tWXZ6S

Bug: 172788645
Test: manual test
Change-Id: Ibce21f1d740a139b407a0a9a41f2cb4c4e34776c
2020-11-15 20:14:25 +00:00
govenliu
228cf200ae [Wi-Fi] Wrong MAC address shown in Settings.
The MAC addresses in "About phone" and "Saved networks" may be different
because of new Randomized MAC mechanism.

1.Add new UIs to guide users to saved network and use different titles to
show different conditions.
2.Remove MAC address and IP fields in WifiPreference by new design.

Bug: 133466540
Test: add test case to check if the title changed according to the
privacy level.

Change-Id: Idb5972dc2565f6fe58a83f6aa7124abbc035888f
2019-10-03 19:36:58 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +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
Arc Wang
535e72a45b Refactor NotifyOpenNetworksPreferenceControllerTest into TogglePreferenceController
NotifyOpenNetworksPreferenceControllerTest is essentially reimplementing TogglePreferenceController.

Add below 2 changes for test failure of CodeInspectionTest

1. Remove some arguments from constructor of the controller
2. Declare the controller in xml instead of in code

Bug: 132391311
Test: manual
      NotifyOpenNetworksPreferenceControllerTestTest

Change-Id: Icda870ef0b90aacbacfe588b23d1b28d2b60941c
2019-05-24 12:17:32 +08:00
Arc Wang
912f3558df Refactor UseOpenWifiPreferenceController into TogglePreferenceController
UseOpenWifiPreferenceController is essentially reimplementing TogglePreferenceController.

Add below 2 changes for test failure of CodeInspectionTest

1. Remove some arguments from constructor of the controller
2. Declare the controller in xml instead of in code

Bug: 132391311
Test: manual
      UseOpenWifiPreferenceControllerTest

Change-Id: Ie52e79fd0bc66a227bd46f09c74d1fbec614f636
2019-05-24 12:09:20 +08:00
Arc Wang
1ee4adf321 Refactor WifiWakeupPreferenceController into TogglePreferenceController
WifiWakeupPreferenceController is essentially reimplementing TogglePreferenceController.

Add below 2 changes for test failure of CodeInspectionTest

1. Remove some arguments from constructor of the controller
2. Declare the controller in xml instead of in code

Bug: 132391311
Test: manual
      WifiWakeupPreferenceControllerTest

Change-Id: I4aa607f78d5e7de70600a410dfc7267e6bd7d387
2019-05-24 12:05:37 +08:00
Salvador Martinez
d25ba81028 Update wifi p2p to direct user to enable location
Location is required for Wifi Direct so if it is not enabled
we disable the preference. Additionally, this fixes some minor
update issues in Wifi Wakeup that was also affecting wifi p2p.
Basically they weren't updating when location settings changed
until you left the screen and came back. Now they do.

Test: robotests, manual
Bug: 120552223
Change-Id: Ibd386fcfbef881cae3d871152675f1cab5e4a041
2019-04-04 23:45:04 +00: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
Stanley Wang
f301f8b216 Fix carrier-specific Wi-Fi settings appears in search - even on non-carrier phone
The preference should be removed from the search result when
the availability status is false.

Change-Id: I979bc70ec7672b137b96a7e02db2e9ba29fbb7a8
Fixes: 112550245
Test: manual and robotests
2018-12-10 15:14:23 +08: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
Salvador Martinez
052baf58a0 Merge "Fix mistake in onActivityResult for ConfigureWifiSettings" into pi-dev am: 1678488736
am: 230d6420b9

Change-Id: I5a05e1bf619b4999d3f329dcc6ce267dba95e598
2018-04-14 19:28:54 -07:00
Salvador Martinez
7486f1cf12 Fix mistake in onActivityResult for ConfigureWifiSettings
Accidently checked the result code instead of request code when
trying to route the callback to the correct controller. This
CL fixes that.

Test: robotests still pass
Bug: 77543817
Change-Id: Ice1dd799d3f06f86743940c5202d308c21e88cdf
2018-04-13 15:29:44 -07:00
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
Salvador Martinez
2f5292454b Update auto wi-fi to prompt user for permissions
This CL makes it so that auto wi-fi will correctly prompt users
to enable the correct permissions before allowing them to turn
on the setting. Additionally it provides users with important
information regarding each setting.

Bug: 67070896
Test: Robotests
Change-Id: Ieddfa421be6e45ce69f3d6048ae051a7e3ce4c76
2018-03-30 15:05:18 -07:00
Fan Zhang
368c81e97b Remove networkScorer wrapper
Also modified NetworkScorerPickerPreferenceController to register itself
in xml directily

Bug: 76167422
Test: robotests
Change-Id: I4a216b5e6845aecd6aaeed0ed9b3e06c9e0fc590
2018-03-30 11:06:30 -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
Fan Zhang
72456a9ea6 Fix search highlight
- Fragments should not have advanced button when coming from search.

Change-Id: I10a192216b7ff702e73b791acbcc1eb1d71cb407
Fixes: 73348428
Test: robotests
2018-02-20 13:19:26 -08:00
Andrew Sapperstein
26e35dac79 Delete WPS settings.
Removes the WPS PIN and Push button settings, all of
the strings, and related code.

Change-Id: I1c7a35ffc8491c57e07accba9b1b5f5407b01831
Fixes: 72421239
Test: deletes code, robotests
2018-02-07 13:57:57 -08:00
Joe LaPenna
3810036691 Always show wifi wake setting.
Remove WIFI_WAKEUP_AVAILABLE config setting its available by default.
Remove check for NETWORK_RECOMMENDATIONS_ENABLED, the feature no longer
uses the recommender.

Test: make RunSettingsRoboTests RunSettingsLibRoboTests;
Test: atest SettingsBackupTest; manual/exploratory
Bug: 69624403
Bug: 67952636
Change-Id: Ia65f7f9349e77a13ad4af1dbd992b28a5cb16368
2018-02-01 16:08:55 -08:00
Ben Lin
848f67d17a Add ability to show/hide Wi-Fi settings, and all related sub-settings.
This adds a new boolean flag, config_show_wifi_settings, which when set
to false will hide the "Wi-Fi" page in network & internet (there is no
key value associated with this preference page). It will also hide
nested pages from search results, such as Wi-Fi preferences.

Bug: 62379554
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=ConfigureWifiSettingsTest
and
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiSettingsTest
and
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiMasterSwitchPreferenceControllerTest
all pass.

Change-Id: Iedc6bc272e0cb2b561c6bf25968e70f355aaaa8e
2018-01-03 20:05:55 +00:00
jackqdyulei
4cd0b14e02 Remove wifi calling from Wifi settings
Also remove the preference controller since it is only used in
ConfigureWifiSettings. The mobile network page lives in
com.android.phone and it has its own way to handle the wifi calling.

Bug: 70798448
Test: RunSettingsRoboTests
Change-Id: I0ea923c0a1ba2b89fcf8939d70128e3f54c75558
2017-12-19 10:17:45 -08:00
Doris Ling
8b14a1a7a6 Change to use the expand button in support lib.
- functionality for hiding portions of the preferences in the preference
screen is added to the support lib. So, changing the settings
implementation to use the feature from the support lib instead.
- remove ProgressiveDisclosureMixin and the related code

Fixes: 63985174
Test: make RunSettingsRoboTests
Change-Id: Ib1d39b2db93d78a56c7adf90abcae5226f9564c2
2017-10-27 13:16:38 -07:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
TreeHugger Robot
6203bde8d3 Merge "Index the System status page" into oc-mr1-dev 2017-09-13 00:06:27 +00:00
Matthew Fritze
4b0677a2a4 Index the System status page
- Page is found in System > About Phone > Status
The page was simply never indexed.

- Remove the unavailable summary text.

- Suppress IP address because it appears in wifi
settings as well.

Test: make RunSettingsRoboTests
Change-Id: I0c5eb5222fc356dd3686fb84ca47da8e2d3274f5
Fixes: 65443327
2017-09-12 14:18:09 -07:00
Stephen Chen
8ffcbccbce Make auto Wi-Fi summary text consistent with feature availability.
"Turn Wi-Fi on automatically" feature is disabled when airplane mode or
battery saver mode is enabled, when Wi-Fi scanning is disabled, or when
network recommendations are disabled / scorer unset. This change
captures these negative cases in the summary text.

Bug: 65085700
Test: make ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest
RunSettingsRoboTests -j40
Change-Id: I2f2d22b5bef3ad03a28d34e79a27e6545cac557f
2017-09-05 13:51:58 -07:00
Stephen Chen
7e27006a7b Adjust UX for toggles when active scorer is not set.
This change fixes two issues: when wakeup is not available, update the
number of items to show above the fold in wifi preferences. When scorer
is not set, grey out wakeup toggle and set summary to reflect the
status.

Bug: 62410973
Bug: 62343859
Test: make RunSettingsRoboTests -j40

Change-Id: I5f4131c6a86eab6c0fb03ea2b5101ba107a9189f
2017-07-05 12:29:06 -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
Andrew Sapperstein
a2dd9978d4 Remove logic for adding a search icon to action bar.
No longer used given that we don't show the search icon on any page.
The main settings page now has the search bar.

Change-Id: I9535028298739467e7fa9c75d1a2fb2b2fa3251b
Fixes: 62230804
Bug: 37477506
Test: robotests
2017-06-25 13:51:08 -07:00
Pankaj Kanwar
9e8a182c31 Merge "Remove Sleep options from Advanced wifi." 2017-05-15 20:23:18 +00:00
pkanwar
2fca2ebddf Remove Sleep options from Advanced wifi.
Sleep options are not relevant any more. This CL removes them from the
settings code.

Bug: 35994481
Test: make RunSettingsRoboTests
Change-Id: Ibd0b33ded3aa2da3df73c519611c915deed6310f
2017-05-15 16:39:48 +00:00
Amin Shaikh
dfa9bb8914 Revert "Update "Open networks available" toggle to instead open notification channel preferences."
This reverts commit 2c4b42c0b7.

Reason for revert: Need to use Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON to toggle the feature because system NotificationChannels cannot be disabled.
Bug: 37794067
Test: m RunSettingsRoboTests

Change-Id: I6aaad78686f4fe929fd6bcd94897341fdaf6bd23
2017-05-09 13:56:51 -07:00
Stephen Chen
2c4b42c0b7 Update "Open networks available" toggle to instead open notification channel preferences.
Bug: 36526438
Test: make ROBOTEST_FILTER=NotifyOpenNetworkPreferenceControllerTest RunSettingsRoboTests -j40
Change-Id: Idde3949856d050e62abff2c75a7b7db475a94d99
2017-04-11 11:54:51 -07:00
Amin Shaikh
1cf25748d6 Add "Use open Wi-Fi automatically" setting.
- Add toggle to ConfigureWifiSettings for "Use open Wi-Fi automatically"
- Start ACTION_CUSTOM_ENABLE activity and handle result to set the
USE_OPEN_WIFI_PACKAGE setting.

Bug: 34773276
Test: make
Change-Id: I602e271d5113e415d290468548e35059bd45d8b8
2017-03-16 16:54:20 -07:00
Stephen Chen
53d0de2171 Merge "Show Search button in menu of Wifi Preferences page." 2017-03-08 22:24:52 +00:00
Stephen Chen
f580ccec19 Show Search button in menu of Wifi Preferences page.
Bug: 36066060
Change-Id: Ia40ca8750cfc5233926b6156bb9262b071bb3b85
Test: verify on device.
2017-03-08 12:40:18 -08:00
Stephen Chen
2d73008bae Create NetworkScorerPicker preference controller to set preference summary.
Bug: 35854552
Test: make ROBOTEST_FILTER=NetworkScorerPickerPreferenceControllerTest
RunSettingsRoboTests -j40

Change-Id: I6dbd18abd67613ed0f85a52f1a3e13fdab0dca6c
2017-03-07 18:52:01 -08:00
Stephen Chen
91acf78173 Hide "Use network recommendations" in Settings.
Bug: 35141347
Test: make -j40 RunSettingsRoboTests, manual inspection
Change-Id: I7661ef141aeb95d5ec707b8a066818892c3fa870
2017-02-08 13:42:19 -08:00