Commit Graph

469 Commits

Author SHA1 Message Date
Paul Stewart
31b0da66a6 Merge "Don't display an invalid Wi-Fi MAC address" am: 917b7b863c am: 27c5edb968 am: dab924f04d
am: 09797c330c

Change-Id: I12cc021a1abead960ec28354e9d6e94ea8090c88
2016-10-28 21:20:19 +00:00
Paul Stewart
27c5edb968 Merge "Don't display an invalid Wi-Fi MAC address"
am: 917b7b863c

Change-Id: I61b50ff7a50551e12a218d73bcf95f0c24e64430
2016-10-28 21:04:40 +00:00
Paul Stewart
1aeb383d73 Don't display an invalid Wi-Fi MAC address
Only display the WifiInfo MAC address if it is a valid address.
Otherwise, display "Unavailable".  The underlying WifiInfo class
now has a default value, and a method that can be used to test
whether or not the contained address is valid.  This change uses
this test and avoids having the confusing default address displayed.

Bug: 32478606
Test: Manual: Turn off WiFi and reboot -- make sure "Unavailable"
      is displayed as the Wi-Fi MAC Address as opposed to "02:00:00:00:00:00"

Change-Id: I912804eb65735375e0ca3c4618a6399543f33b57
2016-10-27 13:34:10 -07:00
Fan Zhang
9895344be6 Fix build
Bug: 24107771
Test: compiles
Change-Id: I287cbe05a86de24d0817bd84e7db5b1893ef7d9b
2016-10-26 10:02:48 -07:00
TreeHugger Robot
85edd578e2 Merge "Refactor Build number preference control into a controller." 2016-10-26 16:01:21 +00:00
Fan Zhang
242da31179 Fix logging spam in DashboardFragment.
When updating preferences managed through PreferenceController, the
fragment should skip prefs that are not available.

Bug: 32255863
Test: RunSettingsRoboTests
Change-Id: I2f9b6ddf8c78d40068dc18f07e60672dcba4474a
2016-10-25 17:14:47 -07:00
Fan Zhang
3aa68c8b80 Refactor Build number preference control into a controller.
- Use PreferenceController structure to make things more modular and
  testable
- Add tests
- Confirm password before enabling dev settings.

Bug: 24107771
Test: RunSettingsRoboTests
Change-Id: I791d9452fd461f570e70e7428f00a7258663de4b
2016-10-25 14:45:50 -07:00
Fan Zhang
db1112a221 Add progressive disclsoure
- Add a ProgressiveDisclosureMixin that contains all logic for collapse
  preference list when it's too long
- Refactored PreferenceController's updateState to take a preference
  instead of PreferenceScreen, because with progressive disclosure the
  preference can either be in screen or the mixin. DashboardFragment is
  responsible finding the preference before passing it to controller.

Bug: 32255863
Test: RunSettingsRoboTests

Change-Id: I6713abd61c954ce12732902e5b3ca4d4c0b1563e
2016-10-18 16:57:11 -07:00
Jerry Zhang
5d36a177d9 Refactor setCurrentFunction and setUsbDataUnlocked into one method
This allows us to get rid of an extraneous config switch and
simplify some code.

Test: Manually change usb configuration
Change-Id: Id78da530ff485ecd7a915056832eec1dd8c91954
2016-10-13 17:32:22 -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
Jeff Sharkey
049d2b88f6 Switch to static warning threshold when adopting. am: bd7adb9313
am: da414d0afe

Change-Id: I111c8b3ea63deb6e9797a520f1431d73adc16c99
2016-10-06 21:54:16 +00:00
Philip P. Moltmann
58154e8c27 USB restriction is similar to media restriction am: 13ee50be48
am: a78fced068

Change-Id: Icb1dbfba6cf3e1a5097cc32b33330b8025e6c46d
2016-10-06 20:07:13 +00:00
TreeHugger Robot
0cff709a0d Merge "Add search provider for storage dashboard." 2016-10-05 23:59:24 +00:00
TreeHugger Robot
7b1060022c Merge "Switch to static warning threshold when adopting." 2016-10-05 19:24:33 +00:00
Jeff Sharkey
bd7adb9313 Switch to static warning threshold when adopting.
See rationale and details in inline comment block.

Test: adopt slow and fast SD cards
Bug: 29990216
Change-Id: I927d683db5e43216ee0837290ee4ca23a55a5dbb
2016-10-05 17:58:54 +00:00
Jeff Sharkey
9157360179 Switch to static warning threshold when adopting.
See rationale and details in inline comment block.

Test: adopt slow and fast SD cards
Bug: 29990216
Change-Id: I927d683db5e43216ee0837290ee4ca23a55a5dbb
2016-10-05 11:47:36 -06:00
Fan Zhang
31a285387d Add search provider for storage dashboard.
Bug: 31800690
Test: manual
Change-Id: Icb906bf3b3698c1379e10cf6e346d489675ad940
2016-10-04 17:52:05 -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
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
Philip P. Moltmann
13ee50be48 USB restriction is similar to media restriction
Bug: 31472955
Change-Id: I3682ccd102565982c434d70fc0d907b1aa779689
(cherry picked from commit 58e2b50292)
2016-09-30 21:18:14 +00:00
Garfield Tan
dbd039a6de resolve merge conflicts of af840b5 to master
Change-Id: I8a31d08dae71d5cb71ae01c06ead4ebf32f89121
2016-09-29 18:08:25 -07:00
Garfield Tan
af840b584d Launch other info in storage in correct user id. am: 493bf348b9
am: 1ab4f4b816

Change-Id: I93d5222647efd84eb6c1d159c053455fbb382c13
2016-09-29 23:29:21 +00:00
Garfield Tan
493bf348b9 Launch other info in storage in correct user id.
Bug: 31592290
Change-Id: I816668c7ff9d1b443d4b49e17bdcfa39ef335aee
2016-09-29 14:45:50 -07:00
Daniel Nishi
88110e21f6 Merge "Move private volume storage calculations into a shared lib." 2016-09-27 16:45:14 +00:00
Daniel Nishi
fee35492b8 Use a config flag instead of a RO flag for showing Manage Storage. am: c0b33f70ed
am: bfe5afc270

Change-Id: I159cb08e7ef25802562603d4f8e297ffdf8d0f30
2016-09-23 22:34:22 +00:00
Philip P. Moltmann
4b2406f3f3 Merge "USB restriction is similar to media restriction" 2016-09-21 18:14:22 +00:00
TreeHugger Robot
295f5a03bc Merge "Add visibility metrics to dialogs." 2016-09-20 15:55:41 +00:00
Fan Zhang
1e516287bd Add visibility metrics to dialogs.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Change-Id: I199d2e1b2cb8588a562b46bb8128d8ece24952f0
2016-09-19 17:34:12 -07:00
Daniel Nishi
c0b33f70ed Use a config flag instead of a RO flag for showing Manage Storage.
Bug: 30455784
Test: make SettingsTests; run the instrumentation.
Change-Id: I860192c1c20fcaec2a5cbcdc085ff01dafa7351a
(cherry picked from commit 7f075a3c41)
2016-09-19 20:39:33 +00:00
Daniel Nishi
355390da93 Move private volume storage calculations into a shared lib.
Bug: 30895163
Test: m RunStorageManagerRoboTests
Change-Id: I3e464c8b721373ebc1527eb5411622c69bf587d1
2016-09-19 12:16:21 -07:00
Daniel Nishi
7f075a3c41 Use a config flag instead of a RO flag for showing Manage Storage.
Bug: 30455784
Test: make SettingsTests; run the instrumentation.
Change-Id: I860192c1c20fcaec2a5cbcdc085ff01dafa7351a
2016-09-16 15:56:47 -07:00
Philip P. Moltmann
58e2b50292 USB restriction is similar to media restriction
Bug: 31472955
Change-Id: I3682ccd102565982c434d70fc0d907b1aa779689
2016-09-14 13:31:29 -07:00
Felipe Leme
3b0a9cb54f Improved storage accounting: am: 7358b7802f am: 49260969b7
am: 1469dde1a0

Change-Id: I2cb0e03aab3c79bde080ea3b73a1ad31c72d5cfa
2016-09-13 21:35:33 +00:00
Felipe Leme
1469dde1a0 Improved storage accounting: am: 7358b7802f
am: 49260969b7

Change-Id: If4dc3b03fe521d91002a00beb9230caef1100a46
2016-09-13 19:47:55 +00:00
Felipe Leme
7358b7802f Improved storage accounting:
- Removed duplicated entry for DIRECTORY_MOVIES.
- Added DIRECTORY_DOWNLOADS to Other.
- Added unaccounted data to Other.
- Changed Other description so it mention non-visible items.

Often sub-directories of /data are populated with data that Settings
doesn't have control of (for example, on /data/ramdump), so they're more
suitable to be displayed in the "Other" section.

BUG: 31091863
Fixes: 30952263

Change-Id: Ibf54f9dd96456575109e2e281f3780da84f70d92
2016-09-13 10:49:34 -07:00
Felipe Leme
b152113898 Only display System section for current user. am: ce37ef51aa am: 0547440ad7
am: 3d9cb084e9

Change-Id: I5b210e644b2fcdeaa7611a373ab2dbed5db89cd2
2016-08-31 01:19:28 +00:00
Felipe Leme
3d9cb084e9 Only display System section for current user. am: ce37ef51aa
am: 0547440ad7

Change-Id: Ibff762a11759d8b15e5df7208636af5305ac6999
2016-08-30 22:33:49 +00:00
Felipe Leme
ce37ef51aa Only display System section for current user.
Otherwise it will be displayed twice on work profiles.

Change-Id: Ic7d21a57f72b9f4a254d574adce90afd7cd27b90
Test: manual verification
Fixes: 31108318
2016-08-30 12:00:27 -07:00
Felipe Leme
654312fa6a Fixed storage calculation when SD card is adopted as internal storage. am: 454d7fcca8
am: 15ebe1fcc3

Change-Id: I67c38af3e0759501cf71e431375417388b9a2474
2016-08-19 23:25:19 +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
454d7fcca8 Fixed storage calculation when SD card is adopted as internal storage.
A SD Card can be set as internal storage, in which case its total must
be added to the total internal storage size.

Prior to this change, the total internal storage size was hardcoded as
the value returned by Storage Manager.

Also fixed the storage summary total to exclude portable devices.

** Cherrypick of c53410c411 **

Fixes: 30689428
BUG: 30742322

Change-Id: I1e33038eeebc91f3c525a387a97987391c10f2f9
2016-08-15 23:35:53 +00:00
Felipe Leme
c53410c411 Fixed storage calculation when SD card is adopted as internal storage.
A SD Card can be set as internal storage, in which case its total must
be added to the total internal storage size.

Prior to this change, the total internal storage size was hardcoded as
the value returned by Storage Manager.

Also fixed the storage summary total to exclude portable devices.

Fixes: 30689428
BUG: 30742322

Change-Id: I1e33038eeebc91f3c525a387a97987391c10f2f9
2016-08-15 16:32:54 -07:00
Vineeta Srivastava
e8c50127db Show IMEI SV when phone has LTE_ON_CDMA_TRUE am: d153a18a27
am: a8cbfb5b56

Change-Id: I89281bf00bb7ba51a02a6578c59a5bdb8efebfd9
2016-07-29 01:53:33 +00:00
Vineeta Srivastava
d153a18a27 Show IMEI SV when phone has LTE_ON_CDMA_TRUE
Bug: 30463148
Change-Id: I518278725d0980b9a98ddf0cf01d65eab3dbb74d
2016-07-28 17:02:44 -07:00
Salvador Martinez
0c86e04516 Force talkback to read imei # digit by digit am: cf21d91b76
am: 72e264b1be

Change-Id: I5d34152d7e3fb758a38b095d8e7b98a575f9c269
2016-07-28 03:08:42 +00:00
Salvador Martinez
72e264b1be Force talkback to read imei # digit by digit
am: cf21d91b76

Change-Id: I1770ddd0f320240417a2deb8a7b3f515ad598a6e
2016-07-28 03:04:43 +00:00
TreeHugger Robot
591e891149 Merge "Force talkback to read imei # digit by digit" into nyc-mr1-dev 2016-07-28 02:57:24 +00:00
Fan Zhang
0a7d1f1f65 Display storage summary with correct used/total size. am: 7dfc8dfc2f
am: 7fda7fb51a

Change-Id: I3da86d55e0f47028b5ae4d3be64188621a528861
2016-07-28 02:04:17 +00:00