Commit Graph

64 Commits

Author SHA1 Message Date
Anton Philippov
66084a5368 Hide "Factory reset" item for secondary users
Bug: 35415714
Test: make RunSettingsRoboTests
Change-Id: I48d6d094476c5fc83dbc17906d84cc848e499624
2017-03-07 16:37:36 +00:00
Fan Zhang
b00811da64 Let fragment and indexProvider share prefControllers
Bug: 35812240
Test: make RunSettingsRoboTests
Change-Id: Ifd96f935836a52e0a56f170f3cdf9b9ddf7c499a
2017-03-01 12:56:58 -08:00
Fan Zhang
7520e81ab5 Update top level menu items summary text.
- Use static summary for most items
- Move summary for user setting to user&account setting

Bug: 34975053
Test: RunSettingsRoboTests
Change-Id: I9bf87267778dc5933f97f5d3b9ae0f4f0b8da1a8
2017-02-09 15:22:47 -08:00
Fan Zhang
7e6df837ee Remove getCategoryKey() from DashboardFragment children.
Use the centralized registry to look up category key instead.

Bug: 32936784
Test: make RunSettingsRoboTests -j40
Change-Id: I0b8c72d70f93e4b5c58871ac90de41f69ad15653
2017-01-24 14:51:15 -08:00
Fan Zhang
8f057ca3d4 Use MetricsEvent to log page views for new IA pages.
Bug: 33812754
Test: RunSettingsRoboTests
Change-Id: Ib49daa1078df44f50ecfa351c061d36849708fd7
2016-12-21 12:12:32 -08:00
Fan Zhang
e0c253fccb Add summary provider for system tile.
Refactored getLocaleNames() into a FeatureProvider interface so it's
reusable and testable.

Bug: 31801428
Test: RunSettingsRoboTests
Change-Id: I2d31a66a4b32cfa7a364a4cfef1f6eea87084577
2016-10-14 11:08:51 -07:00
Fan Zhang
66b573ad5a Add display settings dashboard to new IA.
- Added a activity-alias pointing to displaySettings as top level
  setting item.
- Refactored all preference logic in DisplaySettings into
  PreferenceControllers. During fragment onAttach it installs all
  controllers, and during onResume it updates preference state. Each
  controller listens to its own preference change event.

Bug: 31800242
Test: RunSettingsRoboTests
Change-Id: Ibc9bf200c5acce7c4ae9292340822afee27a3a28
2016-10-10 18:26:29 -07:00
Fan Zhang
fabbfb435e Refactor SummaryLoader to set summary on subsetting pages.
- Make a SummaryConsumer interface. Things that needs latest summary
  should implement this interface (DashboardAdapter for homepage,
  DashboardFragment for subsettings). This also decouples SummaryLoader
  from relying on SettingsDrawerActivity.
- Make DashboardFeatureProvider more generic to load DashboardCategory
  by key.

Bug: 31781480
Test: RunSettingsRoboTests
Change-Id: I9c65456fb433a74c352498251e0ccf65da0be1f0
2016-10-07 14:52:06 -07:00
Fan Zhang
36924659f5 Refactor DashboardFragment.
Merged refreshAllPreferences into DashboardFragment. This hopefully
makes it more modular to manage preference display logic in each
dashboardFragment, and makes it more efficient to monitor category
changes.

Now subclasses needs to implement 2 methods:
- displayResourceTiles(): for 'static' preferences from xml
- getDashboardTiles(): returns a list of dashboard tiles and superclass
  will wire it up to preference screen.

If getDashboardTiles() return null (aka no dashboardCategory available),
the fragment will not attempt to monitor category change. The edge case
is that if a package starts to provide a tile for this category, we will
not be notified. I have not seen this case coming up. If we indeed need
to handle this case, the category listener needs to have a way to
monitor specific category rather than globally.

Bug: 31781480
Test: make RunSettingsRoboTests -j40
Change-Id: Ia9f9541b95816214df0d0bb27e3e41078c36c5ca
2016-10-07 11:55:43 -07:00
Fan Zhang
bb6d2608e9 Add storage dashborad page.
Refactor shared dashboard page display logic between storage and
system page.

Bug: 31800690
Test: RunSettingsRoboTests

Change-Id: I7eb86f590b79ab871bdb383fb2f5326790beb193
2016-10-04 14:06:57 -07:00
Fan Zhang
c6540cfb57 Add search provider for system dashboard fragment.
Bug: 31801428
Test: manual
Test:make RunSettingsRoboTests
Change-Id: I6a80d64ed9755f4ddcfde33a82be04cfcbf0495b
2016-10-04 11:10:36 -07:00
Fan Zhang
81adfcfcca Listen to category changes in preference fragment.
Bug: 31781480
Test: make RunSettingsRoboTests
Change-Id: I702e524eb3a9e40b653e112dba80d620be3bc9bb
2016-10-03 16:38:02 -07:00
Fan Zhang
9c1fcf9916 Move system update preference from device_info to system.
In order to move the preference and its logic cleanly, created a
controller object that encapsulates the preference/click handler.

Bug: 31801428
Test: RunSettingsRoboTests
Change-Id: I332384e20fbf0e21d2f3becb531d97b20f7f7ef1
2016-10-03 13:53:45 -07:00
Fan Zhang
cc335d9509 Rearrange a few settings into System category page.
- Use activity-alias to define which activity shows up in what category.
  We choose activity-alias because it creates a reference to UI we need
  without having to define a new set of intent-filter and/or category
  keys. This reduces maintainence in the long run. We should merge
  metadata from activity-alias into targetActivity when cleaning up.

- Created new System dashboard activity that hosts all system category
  tiles dynamically, and a static tile for checking system update.

Bug: 31781480
Test: manual
Test: make RunSettingsRoboTests -j40
Change-Id: Ia2d762e3e1aebd17423a395c5e6c286dc3326492
2016-09-30 16:03:46 -07:00