Commit Graph

10668 Commits

Author SHA1 Message Date
TreeHugger Robot
6e3b964cf4 Merge "UI Refresh: a new app info header for app/notification." 2016-10-27 22:43:52 +00:00
Fan Zhang
c9536b8e41 UI Refresh: a new app info header for app/notification.
- moved force stop and uninstall button to bottom of page (as footer)
- Forked appheader layout file, and created AppHeaderController to
  contain all binding logic for header.

Bug: 32442716
Test: RunSettingsRoboTests
Change-Id: Id4eb365ca25e035c043c068867f5cbc3a202b201
2016-10-27 13:48:13 -07:00
Lei Yu
8b3159f064 Merge "Remove animateChange in ConditionAdapterUtils" 2016-10-26 23:30:25 +00:00
jackqdyulei
8e5f66ce39 Remove animateChange in ConditionAdapterUtils
Bug: 30319913
Test: make RunSettingsRoboTests

Change-Id: Iea3fa574c4f0f80e70a6360b5b4a5f748a80a899
2016-10-26 13:09:38 -07:00
Fan Zhang
301fe80fa7 Add location to security settings.
Bug: 32437756
Test: RunSettingsRoboTests
Change-Id: I999669963801684eb2399f5e642159970727b3c4
2016-10-26 11:23:20 -07:00
TreeHugger Robot
85edd578e2 Merge "Refactor Build number preference control into a controller." 2016-10-26 16:01:21 +00:00
TreeHugger Robot
a2c7f4277b Merge "Modified settings tests to use custom test runner" 2016-10-26 03:12:08 +00:00
TreeHugger Robot
d847d424b4 Merge "Fix logging spam in DashboardFragment." 2016-10-26 01:46:27 +00:00
Salvador Martinez
f86905ed50 Modified settings tests to use custom test runner
The custom test runner lets us use resources from
multiple projects which resolves many ResourceNotFound
errors that would come up when people who made changes
wrote tests.

Test: make RunSettingsRoboTests
Bug: 32180625
Change-Id: I71f30eecc1164b117351a74b3ea0533625feae5b
2016-10-25 17:20:20 -07:00
Salvador Martinez
f492c28cc1 Robotests for BluetoothPairingDialog
Created some tests to protect some basic bluetooth
pairing dialogs features from regressing. Most of the
tests in this CL ensure that the view is properly
created and that it is properly updating the
associated controller when a relevant action occurs.

Test: make RunSettingsRoboTests
Bug: 32180625
Change-Id: I2f4103a39ffced52353712f952e8ff3d26590169
2016-10-25 17:18:53 -07: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
jackqdyulei
e091cef862 Show "uninstall for all users" when >1 users installed it.
Bug: 32167081
Test: make SettingsTests

Change-Id: I407549838d40c160a84a36f2d9ebaa8dc73d6008
2016-10-25 15:57:31 -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
Lei Yu
7ac8a8f5bd Merge "Store Tile in view tag, not position" 2016-10-25 00:28:57 +00:00
Fan Zhang
5b6478a349 Add swipe to see notification to "Notification preferences"
Bug: 31799948
Test: RunSettingsRoboTests
Change-Id: Ib892ca4d5596c1c89e1efaf636a3eefd7cee371a
2016-10-24 15:33:12 -07:00
jackqdyulei
a44fdda438 Store Tile in view tag, not position
The position(used to find the tile) is not up-to-date when recyclerview
changes, so store tile instead.

Bug: 32370624
Test: make -j40 SettingsTests
Change-Id: I10d29b3137ecb1c37b6a8468c6f2709b8497caa6
2016-10-24 14:44:37 -07:00
Fan Zhang
f83ce92aaf Update Notification preferences UI in new IA.
- Refactored ConfigureNotificationSettings to be more modular
- And tests

Bug: 31799948
Test: RunSettingsRoboTests
Change-Id: I2ecd8930a6aa501c1e625cab6ed25a46f3437e85
2016-10-24 13:33:14 -07:00
Fan Zhang
4136d902bf Add app default UI to App & Notifications.
Bug: 31799948
Test: RunSettingsRoboTests
Change-Id: Icca4954f82af38316cc232b8879c0f7e7869ecb3
2016-10-21 19:59:24 -07:00
TreeHugger Robot
e5f6fdba05 Merge "Fix App name and icon in Settings Battery details." 2016-10-22 02:14:17 +00:00
TreeHugger Robot
7fa8b4373b Merge "Add user and account dashboard category for new IA." 2016-10-22 02:00:26 +00:00
Maurice Lam
e9b7ec8f57 Merge "[Fingerprint] Make enroll progress bar scalable" 2016-10-22 00:18:00 +00:00
Sundeep Ghuman
39f552eb91 Fix App name and icon in Settings Battery details.
Set correct defaultPackageName and Label for Apps in BatteryEntry.java
so PowerUsageDetails will show the correct information.

Bug: 24187923
Fixes: 24187923
Test: Open Settings, click on Apps, select any app. Note the name and
icon on the Header. Click the Battery item. The app name and icon should
match that of the previous name, as opposed to showing the package name
and default Android icon.
Change-Id: I7b6c3b404fcd298c6670cceecd29915abd325d1f
2016-10-21 16:29:29 -07:00
Doris Ling
d7aae18f8b Add user and account dashboard category for new IA.
Add the initial version for the User & accounts category and set the
tile's intent if it contains metadata but fragment is null.

Test: RunSettingsRoboTests
Bug: 31801423
Change-Id: Ic63bf8aeaf47f68a184af73c9a8a72b89b597a17
2016-10-21 16:07:39 -07:00
Lei Yu
751e0b0f20 Merge "Elicit ItemsData class and add DiffUtil.Callback" 2016-10-21 20:52:18 +00:00
jackqdyulei
0b818b79db Elicit ItemsData class and add DiffUtil.Callback
In the previous version, when there is a minor change in data, we
will refresh the whole screen(and data) by invoking "recountItems"
and "notifyDataSetChanged", which did lots of unnecessary works.

In this new cl, I elicit ItemsData class, which encapsulates the list
data used in adapter. When data changed, I build another ItemsData and
use the DiffUtil.Callback to calculate diffs between ItemsDatas. In
this way we can only refresh the items that changed in adapter.

Since I cannot find usage of see_all.xml anymore, I delete the relevant
code as well as the resource files.

Bug: 30319913
Test: make RunSettingsRoboTests
Change-Id: I4f753a26f624affea6c6c35d49cfb9c43fb74fe6
2016-10-21 11:02:29 -07:00
Maurice Lam
67df126291 [Fingerprint] Make enroll progress bar scalable
Make the fingerprint enroll progress bar scalable by moving it to a
single FingerprintProgressBar view and make it fill the remaining
space.

- The background fingerprint icon was changed to include the padding
internally so it can be added as the background directly onto the
progress bar view.
- The icon in landscape mode is also fixed to use the fingerprint
icon rather than the lock icon.

Test: cd tests/robotests && mm
Bug: 32123370
Change-Id: Ia5cf37d92f0af7c1cf39287f5070c44f51d44878
2016-10-20 17:20:56 -07:00
Lei Yu
2aeb28c020 Merge "Set stay awake while wireless charging." 2016-10-20 23:33:11 +00:00
TreeHugger Robot
1ec79681de Merge "Make dashboard tile refresh more effcient." 2016-10-20 19:03:28 +00:00
Fan Zhang
a1a84e6530 Make dashboard tile refresh more effcient.
Instead of removing and re-adding all dashboard tiles, figure out a diff
and rebind/add/remove as necessary.

Bug: 32255863
Test: RunSettingsRoboTests
Change-Id: I9d87ba30ab746257d0ea71282951348ebc4e8965
2016-10-20 09:52:01 -07:00
Jaewoong Jung
35d94ff9cc Merge "Fixes how we read the current WiFi network IP address." 2016-10-19 21:21:59 +00:00
Fan Zhang
8b5bca5937 Move add/remove/findPref to ProgressiveDisclosureMixin.
This makes ProgressiveDisclosureMixin the authority for adding/removing
preferences so caller doesn't need to figure out if a preference is on
screen or collapsed.

Bug: 32255863
Test: make RunSettingsRoboTests -j40
Change-Id: I9bd69661b78efd4bb4913665f6ea09f6bdc231f5
2016-10-19 12:19:46 -07:00
Jaewoong Jung
c260e6dc87 Fixes how we read the current WiFi network IP address.
The old logic could read the current IP address only when the network has the
Internet access.

Bug: 31934577
Test: Manual inspection
Test: make RunSettingsRoboTests -j40

Change-Id: I46fe6f6fb4322e8245d3ac66ac6530228c226d16
2016-10-19 12:08:54 -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
Fan Zhang
be2ac27b67 Draw preference divider based on preference group.
Bug: 32179750
Test: RunSettingsRoboTests
Change-Id: I3ea1cd662c5baec825fae615883b94b26e648409
2016-10-17 10:16:04 -07:00
jackqdyulei
b182ef3c77 Set stay awake while wireless charging.
Now if you select "stay awake" in Developer options, the screen
will keep on when wireless charging.

Bug:31696030
Test: make SettingsTests
Change-Id: If88bf559519c19654822c70d7684be583d907e00
2016-10-14 15:50:42 -07:00
TreeHugger Robot
542fe0c0c3 Merge "Add summary provider for system tile." 2016-10-14 19:56:35 +00: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
f1acdd3a51 Add more preference controllers to network page.
- To support Mobile plan preference controller, extended
  LifecycleObserver pattern to also observe onCreate and onSaveInstance.

Bug: 31799836
Test: RunSettingsRoboTests
Change-Id: Ie98db7efa91f0a8b4c8a06a784d3351237e59fe0
2016-10-13 15:01:18 -07:00
Doris Ling
b2c8c9cc9c Add connected devices dashboard category for new IA.
Add the initial version for the connected devices category.

Test: RunSettingsRoboTests
Bug: 31800290

Change-Id: Ibacef7d5ceaae5e71ff5e5b1c35dafa7738e4f75
2016-10-12 15:27:19 -07:00
Fan Zhang
bb93dc0242 Add a new empty dashboard for Network & Internet.
Bug: 31799836
Test: RunSettingsRoboTests
Change-Id: Ide0c07839332e615f6ba86fb87a1eb04cce2fae7
2016-10-12 10:24:42 -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
e6c60c24a8 Add test for new DashboardFragment and PreferenceController
Also added a FakeFeatureFactory to make it easier to mock different
FeatureProviders.

Bug: 31781480
Test: make RunSettingsRoboTests
Change-Id: Ie45db601e0bec951d7ef983ec2e3ca747ec1c3af
2016-10-06 10:33:01 -07:00
Fan Zhang
a3e77342d9 Merge "Move system update preference from device_info to system." 2016-10-03 23:44:58 +00: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
4fe7c0859f Fix a NPE when rotating dialog created by DialogCreatable.
Bug: 30088727
Test: make RunSettingsRoboTests
Change-Id: I775899809dfe920daa294f70d646b141da7c0706
2016-10-03 13:50:59 -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
jackqdyulei
0bfee2799d Add classloader for RtlCompatibleViewPager
To avoid BadParcelableException when reload the activity after it
is killed by OS.

Bug: 31707097
Test: make SettingsTests && adb install -r \
${OUT}/data/app/SettingsTests/SettingsTests.apk && \
adb shell am instrument -w \
'com.android.settings.tests/android.support.test.runner.AndroidJUnitRunner'

Change-Id: Ic8f20d9e2d236f0bea96071a88fbc6e7ba856f54
2016-09-28 17:56:04 -07:00
TreeHugger Robot
eaec1622f5 Merge "Fix robolectric tests" 2016-09-27 23:25:33 +00:00