Commit Graph

27 Commits

Author SHA1 Message Date
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
bec3144c11 [Provider Model] Bring back the "turn on Wi-Fi automatically" option
- Screenshot:
  https://screenshot.googleplex.com/92uXX6KQCqWxvub

Bug: 182620666
Test: manual test
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest

Change-Id: Ic0ce47a6d9a374fce9752d67a9c2d083486b9083
2021-03-22 22:28:55 +08: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
Roshan Pius
a7e96dd80e Settings: Use new API for setting wifi scan always on
Bug: 148514485
Test: Manually verified the toggle from Settings
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: I0a55b7212c97c11d50b0a05eec743e8ebe9ea6d8
2020-02-18 12:53:49 -08:00
Roshan Pius
65291297a9 Settings: Use new API for wifi wakeup feature toggle
Bug: 148514485
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.wifi
Test: Verified wifi wakeup feature toggle in wifi settings.
Change-Id: I1e7c0b3ca053a9b7d6105cad16362df38517b51e
2020-02-07 12:33:18 -08:00
Arc Wang
30c1767c0a [Wi-Fi] Fix robolectric test broken
1. WifiConfigController#setSelection triggers onItemSelect, it uses
   mEapUserCertSpinner without adapter.
2. refreshSummary should use parameter preference instead of mPreference.

Bug: 140771897
Test: WifiConfigControllerTest
      WifiWakeupPreferenceControllerTest

Change-Id: I963260bd82e7387052cacae89bdbe46da841e341
2019-09-10 11:41:35 +08:00
Sunny Shao
0521385003 Handle subtext display problem in WifiWakeupPreferenceController
WifiWakeupPreferenceController subtext can't display location info subtext
when the "Use location" turn off. Now override the updateState and add the
refreshSummary in this api to fix the problem.

Bug: 132391311
Test: manual view
Change-Id: I5e85c1ae9b9393ee06f16a61d4be4a149adfdede
2019-09-09 11:00:41 +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
Arc Wang
454553ed52 Fix "Turn on Wi-Fi scanning?" does not pop up when clicking "Turn on Wi-Fi automatically"
We should make sure both 'Use location' & 'Wi-Fi scanning' are enabled
before calling setWifiWakeupEnabled.

Bug: 131777439
Test: manual
Change-Id: I602917cfa7c5581ecb414e8c44b4e20c8f9ea78d
2019-05-10 14:13:07 +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
7db118e367 Mass clean up: don't cast class when not needed.
Bug: none
Test: rebuild
Change-Id: Ie3f58a3d5ae99ade28a33dcac80c18de90d4d5b2
2019-02-14 12:26:09 -08:00
Fan Zhang
cdf284b732 Make Settings robotest work with tot Robolectric
Bug: 116278591
Test: make -j RunSettingsRoboTests
Change-Id: I32cb2fcf6094675f79d2fc24702ef6298a9691e4
2018-10-31 17:59:17 -07: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
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07: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
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
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
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
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
Juan Lang
777ed2535a Depend on SettingsLib's version of lifecycle and FooterMixin.
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.

Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
     && make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
2017-05-12 11:10:46 -07:00
Stephen Chen
a99b86c56a Update Wi-Fi Wakeup setting to check whether the feature is available.
Bug: 38037361
Test: make ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest
RunSettingsRoboTests -j40

Change-Id: I1c1b930546cc090d72f3047058a428acd1b2883a
2017-05-10 11:06:05 -07:00
Sarah Fortune
15d1e2676c Disable the wifi wakeup preference when wifi scanning is disabled
Bug: 36033488
Test: Manual testing on the device, make RunSettingsRoboTests
Change-Id: I0abfe69a8a84dc9c5e78f1debce7748c92b47e04
2017-04-17 11:35:21 -07:00
Amin Shaikh
5e096a3969 Add Settings toggle for Wi-Fi Wakeup.
- Added switch toggle to Configure Wi-Fi Settings for Wi-Fi Wakeup
- Disable Wi-Fi Open Networks Notifications and Wi-Fi Wakeup toggles
  if NETWORK_RECOMMENDATIONS_ENABLED is disabled

Test: make -j40 RunSettingsRoboTests
Bug: 33224845
Change-Id: I2a52c5d1e60f618aefa125c7806fa95ca19a0ca9
2017-01-11 15:11:55 -08:00