Commit Graph

60 Commits

Author SHA1 Message Date
ykhung
4645fef6ca Add searchable keywords for new usage and adaptive preferences screen
Bug: 185432878
Bug: 185433678
Bug: 185855057
Test: make SettingsRoboTests
Change-Id: Ibca47e7732f72cba03fbfae10075ac83f1938b43
2021-05-10 15:40:14 +00:00
Wesley.CW Wang
6adeed1a2c Update batter saver page footer (1/2)
- Remove iconSpaceReserved since settings theme already handle it
 - Add underline

Bug: 183689347
Test: make SettingsRoboTests
Change-Id: Ib52cfb48453d49b1ead3bf19183449cc18018dd3
2021-04-29 11:12:50 +00:00
Wesley.CW Wang
756028aadd Support help message when battery is unavailable(1/2)
- Present help preference when battery is unavailable

Bug: 179237551
Test: make SettingsRoboTests
Change-Id: If6e82210d831123cb1169d53a18d24cb2c576b10
2021-04-09 11:24:51 +08:00
Wesley.CW Wang
2d578bef5e Reindexing Settings Battery main page(1/2)
- Reorder index and remove footer's divider
 Screenshots"
   https://screenshot.googleplex.com/643w3WEWJfe7uV2.png
   https://screenshot.googleplex.com/6DYSf28VCo4nBZ8.png

Bug: 177407113
Test: make RunSettingsRoboTests -j40
Change-Id: I7e5f2c04d75d0fe24cfd719611043e23675c4dfe
2021-03-19 18:04:57 +08:00
Wesley.CW Wang
280e3639cd Update Battery Settings main page (1/2)
- Rollback ag/13413813 to meet the design change
 - Regrouping the index
 Screenshots:
   https://screenshot.googleplex.com/85aPq9ArJMWjJV2.png
   https://screenshot.googleplex.com/8uiZ9KLKAHoJyrP.png

Bug: 177407113
Test: make RunSettingsRoboTests -j40
Change-Id: Ic3c16d985b7c5e98e6d1bbe4481c48eadd3e4078
2021-03-05 06:03:42 +00:00
Wesley.CW Wang
f4bc35333b Update battery percentage column to UsageProgressBarPref (1/2)
- Change battery percentage column to new design
 - Remove debug info case
 Screenshots:
   https://screenshot.googleplex.com/9rvRfK3wBtpnarZ.png
   https://screenshot.googleplex.com/5iAjNXTptDechAm.png

Bug: 177407113
Test: make RunSettingsRoboTests -j40
Change-Id: I5d046be29a036910036e72edb677b69bc2c0a03f
2021-02-19 10:23:53 +00:00
Wesley.CW Wang
8cd4fd329e Remove battery usage column icon (1/2)
Bug: 179236309
Test: make RunSettingsRoboTests -j40
Change-Id: I89b741e4cd5c8c53e3c67f4702eff0d95200731f
2021-02-04 09:12:53 +00:00
Wesley.CW Wang
8d9fe815b0 Update battery saver column to PrimarySwitchPreference (1/2)
- Change battery saver entry column to new design
 Screenshot: https://screenshot.googleplex.com/9a9Gxm3McJVmLkD.png

Bug: 177407113
Test: make RunSettingsRoboTests -j40
Change-Id: I513bc4371518645f4e725df27f2cb978cec284e8
2021-02-02 06:13:08 +00:00
Wesley.CW Wang
0457af5347 Reorder Settings Battery main page index (1/2)
- Reorder battery page index
 - Remove option menu
 - Add battery usage preference
 - Remove last full charge and screen usage preference
 Screenshots:
 https://screenshot.googleplex.com/7VMeSVKHGViZyRv.png
 https://screenshot.googleplex.com/7v6wNL4qamfMAgM.png

Bug: 177407113
Test: make SettingsGoogleRoboTests -j40
Change-Id: I8a1fb30cdd3774840bf28d9c84017d946a4244df
2021-01-26 14:01:29 +00:00
Edgar Wang
77de405a5d Make TopLevelSettings un-searchable and direct result to relevant page.
Fixes: 149372187
Test: manual & robotest
Change-Id: I9daca03d1c11a262f8e3b55bb46aabbc035ece96
2020-02-14 17:58:38 +08:00
Edgar Wang
0934babbfc Make the fragment title can’t searchable
we shouldn't take users so deep into the settings IA because it's easy
to feel lost in settings after clicking on a result without additional
context.

Bug: 143055215
Test: robotest & manual
Change-Id: I337cb5ead31e1e4e7bf9be78132e90630f83ee43
2020-02-06 19:07:11 +08:00
Sunny Shao
a3961cd6d7 Use FooterPreference in xml explicitly
Removed the FooterPreferenceMixin from the PowerUsageSummary page.

Fixes: 139515012
Test: manual test
Change-Id: I29af8ad4df303edeeb511057d53d38c847f0ff21
2019-08-16 16:49:59 +08:00
Fan Zhang
ec81d6121e Override 2 getSliceUri() instance to return platform slice
Bug: 126222433
Test: robotest
Change-Id: I3f9c8202d9b75b24b80ebcf385abc95f8df851e2
2019-05-30 16:50:43 -07:00
Yanting Yang
69b6e0af77 Remove additional divider from Battery settings
Fixes: 129351013
Test: visual
Change-Id: I586ecdfeb82104ea35842bb12a2c90c29cca70ae
2019-03-28 14:29:56 +08:00
Salvador Martinez
4faacea809 Revert battery info string to be about percentage
This was originally going to do something new, but we decided
it should just control percentage in the status bar after all.

Test: robotests pass
Bug: 127518748
Change-Id: I073a19c27de43cba35031f073c2e606b483a69fd
2019-03-12 14:43:26 -07:00
jackqdyulei
b52ed906cc Add divider line in battery page
Change-Id: Ib5b1d7980cb6c453bb656a36ff6f1bb62bffc803
Fixes: 119618813
Test: Manual
2019-02-08 13:25:31 -08:00
jackqdyulei
56726ca04c Remove divider line for battery card preference
Use CardPreference directly here instead of preference category
Also clean up code and test a little bit.

Bug: 119618813
Test: RunSettingsRoboTests
Change-Id: I3ee2313c10e6e2e34609137f3dcb0391104377d5
2019-01-11 15:55:33 -08:00
tmfang
dce94bb237 Use SettingsLib's LayoutPreference
- Remove LayoutPreference in Settings source code.
- Remove unused style, layout
- Replace old imports to com.android.settingslib.widget.LayoutPreference
- Replace old XML tag to com.android.settingslib.widget.LayoutPreference

Test: robotest, manual test
Bug: 120005054
Change-Id: I9ae1ae14a16f443e11ac5d75b6038c7c5e253844
2018-11-27 13:12:53 +08:00
Salvador Martinez
7b38d57080 Update battery percentage preference strings
This changes the preference to be "Battery Info" and
updates the summary text to mention time remaning in addition to
percentage.

Test: None, String only change
Change-Id: Id9a8132051455842a76104ed0f2abfca3b589011
Fixes: 119828170
2018-11-26 13:37:17 -08:00
jackqdyulei
076b674764 PowerUsageSummary: move controllers to xml
Also change the following controllers to have standard constructor
1. BatteryHeaderPreferenceController
2. BatteryTipPreferenceController

Change-Id: I2e68082295eb8ef18de9fef9483a10b070c77a47
Fixes: 111131567
Test: robotest
2018-07-26 11:40:28 -07:00
Fan Zhang
209d9ff496 Clean up: remove preference_category_no_title.
We already have a custom category layout that does the same thing.

Test: visual
Change-Id: Ice6daea8b2d9a14e9b013cf4175ce00f5ab1cc8d
2018-07-11 11:46:35 -07:00
Fan Zhang
6c5af54af9 Get rid of extra whitespace under divider lines
Change-Id: Iad5ec5771a61c6e12aaefbe5fe41d17f7f09de73
Fixes: 76116029
Test: visual
2018-03-22 15:04:01 -07:00
TreeHugger Robot
f663d78436 Merge "Index SliceType and Official Platform flag" into pi-dev 2018-03-20 23:31:03 +00:00
TreeHugger Robot
83c8451266 Merge "Remove battery saver toggle from the Battery screen" into pi-dev 2018-03-20 23:21:17 +00:00
Makoto Onuki
f310f7e300 Remove battery saver toggle from the Battery screen
- Also fix bug where the summary doesn't show up until the battery saver state
changes.

Bug: 74120126
Fix: 74400918
Test: manual
Test: b ROBOTEST_FILTER=BatterySaverControllerTest RunSettingsRoboTests
Change-Id: I03ceb8ee2a8d8c33da7ad220148ecc9553911661
2018-03-20 14:33:32 -07:00
Lei Yu
6c16840ff5 Add summary for battery manager preference
Show different summary based on whether it is on and there is restricted
apps.

Also move method to get restricted app list to BatteryTipUtils since it
is used in 2 places.

Bug: 73018395
Test: RunSettingsRoboTests
Change-Id: Ib2306e0fd1f520fde6d1403ce9c527c241d36005
2018-03-19 19:27:36 -07:00
Matthew Fritze
79c6395295 Index SliceType and Official Platform flag
Extend slices_index.db to include SliceType and platform flag.
This will be used when we generate a list of all available slices
for different authorities & separated intent/action paths.

Bug: 62807132
Test: robotests
Change-Id: I1cce49d077c02ab79153db9bfdfc894dbab5e16a
2018-03-19 14:51:31 -07:00
jackqdyulei
31a5960424 Create new PowerUsageAdvanced page
This page contains the graph at the top and app list at the bottom

In this cl, we reused some part of the code in PowerUsageAdvancedLegacy
to construct the graph, and also used controller to construct the app
list(So glad that we extracted it to controller before..)

Bug: 73300636
Test: RunSettingsRoboTests
Change-Id: I30afbc0327a5186f8280f5e3678330b363e2dc0d
Merged-In: I30afbc0327a5186f8280f5e3678330b363e2dc0d
2018-03-06 16:10:30 -08:00
Matthew Fritze
e8854ec33d Add BatterySaver as SettingSlice
Convert BatterySaverController to TogglePrefController.
This was the first MasterSwitchController, so we needed
to add the preference case to updateState.

Test: Robotests
Change-Id: I32f3dee0b183807c66c19513b8b064af8f369c2a
Fixes: 67996992
2018-02-21 11:27:09 -08:00
TreeHugger Robot
a331bbd576 Merge "Remove the click action for battery header" 2018-02-07 04:26:54 +00:00
jackqdyulei
e5a4276912 Remove the click action for battery header
Also remove the ripple effect

Change-Id: I28c3dc928816f07a18591c0777b5b2f275715ca2
Fixes: 73018312
Test: Build
2018-02-06 18:24:38 -08:00
jackqdyulei
7e999df6d9 Revamp the battery saver page
1. Make BatterySaverSettings extend from DashboardFragment
2. Add new layout
3. Add battery saver controller

Future cl will add controllers for seekbar and button

Bug: 72228477
Test: RunSettingsRoboTests
Change-Id: I21fb62aef874c04eca2988271f2fd9d7aacb0c6c
2018-02-05 13:32:48 -08:00
jackqdyulei
131d3b3c2f Add smart battery page for battery settings
This page contains prefs for smart battery and app restriction.

Bug: 71502850
Test: RunSettingsRoboTests

Change-Id: I194af30cbc7b2496b10098fcb67f1116e0722310
2018-01-09 12:05:36 -08:00
jackqdyulei
5c56588d59 Remove toggles in battery settings.
In Android P, we only show "Battery saver" and "Power management"
in battery settings. So we need to remove other preferences.

Keep "Battery percentage" toggle for now because it is not
cross-listed in other places.

Bug: 71502850
Test: Screenshot
Change-Id: Ia3c919f61239ff71f9343f2bce961aa4b89533c0
2018-01-04 19:54:06 -08:00
jackqdyulei
fde63fc351 Add infra for battery tip
This cl adds the basic structure for battery tip:
1. BaseBatteryTip: Model class to represent the tip and build
preference and dialog
2. SummaryTip: Display a general battery summary(i.e. your battery
is good..)
3. BatteryTipLoader: AsyncLoader to load the battery tips.
4. BatteryTipPreferenceController: preference controller for
preference group to display battery tips

This cl also:
1. Remove the anomaly code in PowerUsageSummary and we will add it
to app restriction in future.
2. Add preference_category_no_title.xml to avoid the extra 32dp
blank at the top.

Bug: 70570352
Test: RunSettingsRoboTests
Change-Id: If91a553888e2eb91d55fb1d0d7bbea69652f144c
2017-12-19 13:27:33 -08:00
Fan Zhang
74c61d1fef Use res-auto as app xml namespace instead of settings.
This is necessary for SettingsIntelligence to parse settings:keywords
when indexing search stuff.

Bug: 64938328
Test: rerun tests
Change-Id: I0d8885c854852020dfa0b9faa3044d4a1b82f8f2
2017-11-17 16:49:54 -08:00
Fan Zhang
823dde54c7 Misc clean up in search
- Remove updateFromClassNameResource() because it's just a no-op method.
- Simplify SearchIndexResources
- Update some pref pages to have unique keys.

Change-Id: I51e542d9947aafd046861ce7be0b4c7213fcd01d
Fixes: 64951285
Test: UniquePreferenceKeyTest
Test: robotest
Bug: 67852637
2017-10-26 17:54:45 -07:00
Andrew Sapperstein
fedae393ef Duplicate ambient display setting in battery settings.
Also fixed a bug where ambient display was duplicated
in search results.

Change-Id: Iacdb53c70e90f8240da1ed9acec7e382ed1df5de
Fixes: 62298578
Test: robotests
2017-07-07 13:07:54 -07:00
jackqdyulei
5dd9ad97d2 Add icon for anomaly preference
Bug: 36924669
Test: Screenshot
Change-Id: Ie0925504a36ec3778e793c1f2d9bc00f1163cf34
2017-05-03 15:57:51 -07:00
jackqdyulei
59bc0cc7e7 Add title and summary for "High usage" pref.
The logic for this pref lives in AnomalyPreferenceController.

Bug: 36924669
Test: RunSettingsRoboTest
Change-Id: Ib88d8e76e1af8a2270fcb671baf55e9f6564b96e
2017-05-03 10:48:13 -07:00
jackqdyulei
df6dd14799 Framework for the anomaly detection.
This cl adds the following components for anomaly dection:
1. AnomalyLoader: run all the anomaly checks in the background
2. Anomaly: Data class to represent what anomaly it is
3. Detector: Different kinds of anomaly detector with common interface
4. Action:  Suggestions when facing anomaly(Force stop, uninstall)
5. AnomalyDialogFragment: show the confirm dialog for action
6. AnomalyPreferenceController: handle update and click for
anomalyPreference, since it will be used in multiple fragments.
7. AnomalyUtils: utility class for anomaly

This cl also adds skeleton for the wakelock check and action. Following
cls will add real implementation about it.

Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: I89fc4b6963757869b93791b4275ca53c04ab9604
2017-05-01 16:03:09 -07:00
Matthew Fritze
c6f2638009 Remove duplicates between battery and display settings
Change preference keys of duplicate settings between
display and battery to avoid duplication in search.

Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I56c82e9e7f163d345065ca478849de9b14c173fe
2017-04-19 14:34:13 -07:00
jackqdyulei
fefdd5d47f Fix crash when clicking item in Battery screen
"last full charge/Screen usage since full charge" goes crash when
clicking on it. This is because The default behaviour for
PowerGaugePreference is to start detail page and the above two items
are PowerGaugePreference.

This cl set these two items as non-selectable.

Bug: 37080048
Test: make -j40 SettingsTest
Change-Id: Ide4e151dcd0b44fb795a5753c91f2197b2a24a56
2017-04-06 12:52:50 -07:00
jackqdyulei
273ad50a3a Ui changes in battery main page
1. Refine the battery header view
2. Move stats section to the place above power management
3. Add last full charge battery stat
4. Add the disclaimer as a footer

Also update the method name in test file, and this ui changes
also fix the header flash problem.

Bug: 36576021
Bug: 36494178
Test: RunSettingsRoboTests
Change-Id: I9784dbbbe16e61da7287f300183347dd4eee6a2b
(cherry picked from commit edfd09d590)
2017-04-04 10:06:35 -07:00
Daniel Nishi
d6f5956ccd Standardize MasterSwitchPreference attr order.
Test: Manual
Change-Id: Ib1072af6246696ed9f67922b2114a83ddea7015e
2017-03-21 13:51:00 -07:00
Evan Laird
3822f122a7 Add battery percentage switch to display settings
Test: mmma packages/apps/Settings/tests/robotests
Bug:32539932
Change-Id: I08c1d0f3b6cb8be7d1456268498356f7ed833e5c
2017-03-10 14:35:40 -05:00
jackqdyulei
3934722439 Add battery stats perference in battery settings page.
Add a preferenceGroup at the bottom of the page, which contains
Screen and Cell usage data.

Bug: 35305983
Test: RunSettingsRoboTests & Screenshot
Change-Id: Ida6e92ddbd7155ec974a2f04c6d6d02ab9dab210
2017-02-21 20:47:40 -08:00
jackqdyulei
51967c0e6a Add BatteryMeterView in Settings
1. Show gauge icon at the top of battery main page instead of
battery usage graph.
2. Move the click action from battery usage graph to gauge icon.

Bug: 34387464
Test: RunSettingsRoboTest

Change-Id: Ib182619d6805b401cde03a50e2ae907cf4df7b94
2017-02-13 11:03:07 -08:00
jackqdyulei
66cce1f9e9 Making "Battery Saver" use MasterSwitchPreference.
By using MasterSwitchPreference, we make "battery saver" to have
two parts: left part is the clickable summary jumping to other
fragment while right part is a switch toggle.

Also remove the previous battery saver preference.

Bug: 34279051
Test: RunSettingsRoboTests

Change-Id: If36fa9741e413a9bbdd57fa67a2c15b6e457afd7
2017-01-24 17:34:14 -08:00
jackqdyulei
722fc818c7 Add power management settings into Settings->Battery
The items been added to group are: Adaptive brightness, Sleep.
Battery saver has been moved into this group as well.

Also refactor the code a little bit to make it fit the
preferenceController. Whole refactor of PowerUsageSummary and
PowerUsageDetail will be tracked in b/34386721

Bug: 34279051
Test: runSettingsRoboTests & Screenshot
Change-Id: I702d8479d1b80f7e9cf1a46752c75bf5d189e0f6
2017-01-23 10:20:07 -08:00