Commit Graph

36 Commits

Author SHA1 Message Date
Bonian Chen
c9cca5940b [Settings] Re-enable previous work on data saver
Previous work on data saver performance got disabled, this is a change to re-enable it.

Bug: 249502488
Test: build pass

Change-Id: I7264b1e8c21a789db358e0aae70a2cf0ce09ebba
(cherry picked from commit 2115d0e495)
2023-02-24 06:27:18 +00:00
xinghailu
b5293a2d1c Cleanup plurals in Settings, change <one> to <1> in string res file.
"One" and "1" are not same, such as "1st place" vs "a
place". Also in many languages, plurals expression is different with English, for more detail please check: go/android-i18n-plurals.
So in string res file, replace "one" with excat value "1" is a more
proper way.

Test: Existing unit tests still pass.
Bug: 199230342
Change-Id: I832abc38afc5d8816fa803865c25e6017cffa2c6
2022-12-13 18:31:08 +08:00
Bonian Chen
af614b823a [Settings] enhancing data saver config control
Enhancing the control of R.bool.config_show_data_saver when false, which including:
1. Initial presentation is invisible
2. Leaving UI when triggered
3. Avoid from getting searched
4. Robolectric test case support

Bug: 243877672
Test: test cases and local testing
Change-Id: I909522c0244ebb012a27d6aff34120a4f90128c6
2022-11-07 10:11:17 +00:00
Weng Su
039ef374ab Reduce Data Saver Settings launch time
- The Unrestricted data need to take a long time to load from ApplicationsState.loader (more then 256ms)

- Load Unrestricted data after Settings launched

Bug: 227863469
Test: manual test, analyze results with perfetto UI.
Change-Id: I5e49a2b0f2b563b426354f4d2e6e650dcc02c98b
2022-09-07 04:09:53 +08:00
Mill Chen
fdbf748dc0 Ensure loading all apps once in ManageApplications
Some pages that extend ManageApplications always display a loading
spinner when entering them. This is caused by that it takes over
100 ms to load all apps and to sort the apps. In addition, the task of
loading all apps might be invoked twice, which caused loading time
increasing.

This CL is to make sure the task of loading all apps execute only once
in those pages that extend ManageApplications.

Bug: 222985623
Test: manual test
Change-Id: I3b15bf2eee2a4c220f42da39a29f0014cc620898
2022-05-06 15:55:36 +08:00
Bonian Chen
16b298ef92 Revert "[Settings] Code refactor DataSaverSummary"
This reverts commit 0ea486d1e5.

Reason for revert: build breakage

Change-Id: Id4c7689ae6f82ab05987365551a06debc1676aa5
2021-10-12 06:14:17 +00:00
Bonian Chen
0ea486d1e5 [Settings] Code refactor DataSaverSummary
Remove unused Callbacks.

Bug: 202792574
Test: local and presubmit
Change-Id: I185c083fd1621b0256e55339e9688d6b190dee32
2021-10-12 11:53:32 +08: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
Bonian Chen
a5f08854e3 [Settings] Inclusive language for Data Usage
Change wordings in data usage part into inclusive language.

Bug: 160707804
Test: make RunSettingsRoboTests
Change-Id: I713e52df8201413b884257a51bc1f71a0d43179d
2020-07-15 02:52:32 +00: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
Sunny Shao
a47e7ddcc3 Use FooterPreference in xml explicitly
Removed the FooterPreferenceMixin from the DataSaverSummary page.

Fixes: 139393749
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.datausage
Change-Id: Ie229acd903eb24e369beef8bbf5ff0bdd9ce50d1
2019-08-14 13:52:08 +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
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
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
4560ab7a35 Add a few pages to search index.
- Data saver
- A few special permission access pages
   - Picture-in-picture
   - Premium sms
   - do not disturb access
- And a unrelated cleanup: move EmptyTextFragment from
  notification/ to widget/

Bug: 70720645
Test: robotests
Change-Id: I6a87f712bf81f9fd32fa9a3826fba851ca748409
2018-07-10 17:02:09 -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
Andrew Chiang
f6c8a42d93 Update toggle text for Data Saver
Update Data Saver toggle to say "Use Data Saver" instead of "On"/"Off"

Bug: 75983536
Test: Robotest, manual test and atest DataSaverSummaryUITest
Change-Id: Icf690638570278fb869515931943ac486adbfc7c
2018-03-26 15:16:19 +08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Tony Mantler
76cbd4b3b2 Make ApplicationsState.Session lifecycle-aware
Bug: 66682989
Test: RunSettingsRoboTests
Change-Id: Idf56788fcae22639b7bf604a8c73cd5f0ff2da16
2017-09-22 11:23:17 -07:00
Fan Zhang
ac81f26e30 Align more prefs for icon space.
Bug: 33775510
Fixes: 33798492
Test: Visual
Test: RunSettingsRoboTests

Change-Id: I9b296e4148be8c1ae537b6418b4f384bbc63a8db
2016-12-21 11:20:24 -08:00
Fan Zhang
8af4c10476 Revert "Align more prefs for icon space."
Bug: 33798492
This reverts commit ded9fc9b07.

Change-Id: I9831858ffda263496617dff29249e243c007fa12
2016-12-21 17:03:00 +00:00
Fan Zhang
ded9fc9b07 Align more prefs for icon space.
- Extend preference_category to support summary text
- Removed work_profile_category, used by account list
- align prefs in storage settings
- Use Preference instead of PrefScreen in xmls
- Use proper footer preference in NightDisplaySettings, BatterySaver,
  DataSaver, AutomaticStorageManage
- Remove WallOfTextPreference

Bug: 33775510
Test: visual
Change-Id: I28156b857ff5acac8746c42384dc03d5997ebd9d
2016-12-20 13:24:31 -08:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Felipe Leme
484caa3035 Don't toggle Data Saver again until it receives a callback.
BUG: 29253107
Change-Id: I4371f947086a45be6709d2a560d27d1f5f0e79c4
2016-06-23 16:16:32 -07:00
Felipe Leme
cf2c0b1b97 Defined help page for Data Saver.
BUG: 28865521
Change-Id: I07930232312df2775ecee5beacee6921f7245847
2016-05-20 09:08:28 -07:00
Felipe Leme
85c63f348f Listen to INetworkPolicyManager events and update UI accordingly.
BUG: 27481520

Change-Id: I09c4c586188d754ddd3ac3dcb3903217842ea0a5
2016-04-20 09:17:14 -07:00
Felipe Leme
c2ef27faf4 Handle blacklisted apps on Data Saver whitelist.
When user blacklists an app for background data access, the
"Unrestricted data access" list should not display the whitelist toggle
option, but rather explain background access is turned off and offer the
option to open the app's data usage screen to turn it back on.

It still does not handle changed received by DataSaverBackend, so the UI
will be stale when the user removes a blacklist and navigates back to
the list.

BUG: 27481520

Change-Id: I9d0fa9f0180a69ce9bd1417921bf89ec3ba31f01
2016-04-18 13:14:01 -07:00
Jason Monk
9d0542a314 Protect against monkey crash
Change-Id: If1fd7dd51247bf29e86db16d4a01b2a45fac791e
Fixes: 27678593
2016-04-13 12:34:37 -04:00
Jason Monk
3e19fc5600 Move temporary metrics constants to proto
Change-Id: I8fb3ac22df7bdc52039dd640f7696ebd32281f0b
2016-03-08 14:18:30 -05:00
Jason Monk
1636fedebe Actually listen to data saver state
Bug: 27445032
Change-Id: Idb9646af9cd82e19b3d4a6add52d349be8015caa
2016-03-02 15:42:36 -05:00
Jason Monk
a8b0366a02 Data saver fixes
- Correct summary for number of apps with unrestricted
 - Show system option on unrestricted access page
 - general betterness

Bug: 26796370
Bug: 27378294
Bug: 27122309
Change-Id: Ia57b56a25175182cb1a5a1231c20dc3c71cc3427
2016-03-01 10:44:16 -05:00
Jason Monk
764f45db91 Add data saver to settings
Bug: 22817899

Change-Id: Ic3055aa6a5baae1653db350313366f180c049cc7
2016-01-25 15:24:29 -05:00