Commit Graph

19146 Commits

Author SHA1 Message Date
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
Stephen Chen
e9a91a9ab3 Merge "Fix cancel button behavior when setting data limit." 2016-09-27 23:02:00 +00:00
Steven Ng
d654c889b8 Merge "Provide fingerprint options for SET_NEW_PASSWORD intent" 2016-09-27 21:04:21 +00:00
Stephen Chen
a88733aed8 Fix cancel button behavior when setting data limit.
Bug: 28563526
Change-Id: I574c4051bb19710409ca4cf4eeffef7be1a7d0ec
Fixes: 28563526
Test: make RunSettingsRoboTests
2016-09-27 13:11:46 -07:00
Fan Zhang
081b549768 Fix robolectric tests
Fix: 31751980
Test: make RunSettingsRoboTests
Change-Id: Id787665d7cb44ee8a0c6ff52927394de1c3e9efc
2016-09-27 12:28:13 -07:00
TreeHugger Robot
8c46585218 Merge "Avoid over logging preference changes." 2016-09-27 18:24:29 +00:00
Steven Ng
4fdcec71dc Provide fingerprint options for SET_NEW_PASSWORD intent
1) Added a trampoline activity to display SET_NEW_PASSWORD intent.
2) On devices that have fingerprint sensor and have no enrolled fingerprint,
   ChooseLockGeneric handles the SET_NEW_PASSWORD intent by providing
   fingerprint + {PIN/PATTERN/PASSWORD} and skip fingerprint options.

Test: See below
1) Auto
   make RunSettingsRoboTests
2) Manual
   a) Fingerprint + pattern
      i) $ adb shell am start -a android.app.action.SET_NEW_PASSWORD
      ii) Click Pixel Imprint + Pattern.
      iii) Set a pattern lock.
      iv) Can enroll a fingerprint.
   b) Pattern
      i) $ adb shell am start -a android.app.action.SET_NEW_PASSWORD
      ii) Click Continue without Pixel Imprint
      iii) A list of unlock options, without fingerprint option, is shown.
      vi) Select and enroll a pattern lock
   c) Has an existing password
      i) $ adb shell am start -a android.app.action.SET_NEW_PASSWORD
      ii) Setting app asks for password input.
      iii) Enter password and click "Continue without Pixel imprint".
      vi) No password is asked. A list of unlock options, without fingerprint option, is shown.
      v) Select and enroll a pattern lock
   d) Work profile
      i) Create a work profile
      ii) adb shell am start --user x -a android.app.action.SET_NEW_PASSWORD. X is the work profile user id.
      iii) Click Pixel Imprint + Pattern.
      iv) Set a pattern lock.
      v) Can enroll a fingerprint.

Bug: 23017051
Change-Id: I6384bbffb72a5d3a83972da7474532746e4d06b9
2016-09-26 22:13:08 +01:00
jackqdyulei
0162daa651 Disable the control of draw over permission for SystemUI
Bug: 31077838
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: I760590f5558f2d686ffbfe78234a8b08e13883fd
2016-09-26 13:22:04 -07:00
Fan Zhang
ad7023a406 Merge "Fix crash when changing data restriction for non-app UID." 2016-09-26 16:01:31 +00:00
Fan Zhang
2d6bf057f8 Avoid over logging preference changes.
When preference screen is created all prefence goes through
SharedPreferenceLogger once. We don't want to log it as preference
change because it's just initial display. Subsequent preference logger
calls should result in logging.

Bug: 30914916
Test: make RunSettingsRoboTests
Change-Id: Icaee9137c55555f4db7839ff0381a13ccd420190
2016-09-23 18:01:13 -07:00
Doris Ling
430025c4d6 Split Ambient Display settings. am: 1ad58d0abf am: f89766dbab
am: 0dfe46fe58

Change-Id: I33ffaa71c09cff7a4df496c42371519367e1772c
2016-09-24 00:35:24 +00:00
Doris Ling
0dfe46fe58 Split Ambient Display settings. am: 1ad58d0abf
am: f89766dbab

Change-Id: If17ab5951a9b8a2a5b68a1fcc2492de8a72f0c08
2016-09-24 00:07:17 +00:00
Doris Ling
f89766dbab Split Ambient Display settings.
am: 1ad58d0abf

Change-Id: Ie47c7504728bb225214ee8c348af8a154cb5a1f2
2016-09-24 00:05:17 +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
Doris Ling
1ad58d0abf Split Ambient Display settings.
1. Reverting the changes for Display->Ambient Display; this setting
   will control incoming notification pulse.
2. Added 2 separate entries in gestures settings to control pick up
   and double tap gestures-triggered pulsing for Ambient Display.
3. Added automated tests to verify the preference initializes to the
   correct default value, and also verify that toggling the preference
   updates the corresponding settings correctly.

Test: make SettingsTests

Bug: 30595437
Change-Id: I125bf75fc4ccfea126a00ffae4207fcb789f487a
2016-09-23 15:33:37 -07:00
Fan Zhang
13566f29a5 Fix crash when changing data restriction for non-app UID.
Change-Id: Ie622e8e22bade33050865fe4135534b27995d523
Fixes: 31708057
Test: make RunSettingsRoboTests
2016-09-23 15:14:18 -07:00
Fan Zhang
aa71afe597 Use MetricsFeatureProvider for logging in Settings.
Bug: 31664539
Test: make RunSettingsRoboTests for regression
Test: adb logcat -b events | egrep "(sysui_|notification_)" for
      verifying log

Change-Id: Id944be7c4ff9911aebee481c2df485542f1318f0
2016-09-23 08:37:37 -07:00
TreeHugger Robot
c8a0395766 Merge "Use MetricsFeatureProvider for condition/suggestion/search." 2016-09-22 23:56:28 +00:00
Stephen Chen
2b98ffaab8 Change Display summary to sleep timeout description.
Bug: 29579542
Fixes: 29579542
Change-Id: I4e122bd6972fde933229768cba86302eb4d3f7c6
Test: Added Robo test, manually tested
2016-09-22 13:55:32 -07:00
Fan Zhang
c93d18e29c Use MetricsFeatureProvider for condition/suggestion/search.
Bug: 31664539
Test: make RunSettingsRoboTests

This allows different metric clients to listen to these events.

Change-Id: Ib19c8099b16ff78d9aa4901278e0ff33eeefd4a8
2016-09-22 13:22:26 -07:00
Fan Zhang
f3b06ef8a0 Fix compile error when robotests references R.* in Settings
Test: make SettingsRoboTests
Change-Id: I85c8bb1b83fa9d1f487658b1bc5dc080f70efa2f
2016-09-22 10:54:15 -07:00
Fan Zhang
d65184faef Log visibility change for DialogCreatable in Settings.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Test: make RunSettingsRoboTests
Change-Id: I51754d258ba1ddfae24323681f21cd02de4dbb4e
2016-09-21 16:30:32 -07:00
Matthew Fritze
00368c3779 Merge "Update Robolectric tests to use google truth" 2016-09-21 16:12:20 +00:00