Commit Graph

168 Commits

Author SHA1 Message Date
Fan Zhang
9ce35ad023 Revert "Expand all preferences when launch from search."
This reverts commit 6589a07d59.
Bug: 68988454
Fixes: 69242304

Change-Id: Iec29dbe302064a6209fbb0a8e7901c9a0f8744c0
2017-11-13 18:57:46 +00:00
Doris Ling
6589a07d59 Expand all preferences when launch from search.
- when the fragment is created, checks the argument to see if the extra
fragment arg key is set. If so, do not hide the preferences in the
advanced button.

Change-Id: Id662ae1cec77edad7fcd5d6daa71929a8cb1402c
Fixes: 68988454
Test: make RunSettingsRoboTests
2017-11-09 15:18:09 -08:00
Fan Zhang
896f1b363c Reduce jank around loading view when opening data usage UI
Change-Id: I3d23d8160b046de8fe125ba0697b7b3d7786453c
Fix: 28181319
Test: robotests
2017-06-26 15:15:30 -07:00
Juan Lang
4482812cb1 Use SettingsLib's versions of Custom* classes.
Test: make RunSettingsRoboTests
Change-Id: I2584e820b72bb4672c53fd1a9f63c7f1662e0809
2017-06-21 12:07:50 -07:00
Matthew Fritze
824f25320a Merge "Search results always highlight proper results" into oc-dev
am: 2a32cb6a33

Change-Id: I1bc6297cc75aa833184a00598f5930aa3ca114dc
2017-06-09 01:23:39 +00:00
Matthew Fritze
33f3e3f4f7 Search results always highlight proper results
In fragments where preferences were being injected after
the super#onResume, the incorrect preference was
being highlighted as the selected result.

This is because the index of the preference is calculated
in SettingsPreferenceFragment#onResume, but the index is
not checked again before the item is highlighted.

Instead, we calculate index right before we highlight.

Change-Id: Idaa655f682a1a6186c1996fb51d352589bbeda0f
Fixes: 62179739
Test: runtest --path packages/apps/Settings/tests/app/src/com/android/settings/SettingsPreferenceFragmentTest.java
2017-06-08 16:25:52 -07:00
jackqdyulei
2b2abac714 Update updateEmptyView
Also consider the visiblity of list container, when list container
is invisible, we should show the empty view.

Bug: 62062415
Test: RunSettingsRoboTests
Change-Id: I065e70386242c425ef3cbfb2b703a5433dbe40c1
2017-05-26 10:53:53 -07:00
Fan Zhang
b84b9cc8e7 Merge "Recursively remove preference from screen." into oc-dev am: 7731b4244e
am: 4472d8af83

Change-Id: Ie8835c9789d959ce3d75b84b05d711f976bab56e
2017-05-25 03:28:15 +00:00
Fan Zhang
e84407f5c3 Recursively remove preference from screen.
The preference framework does not remove pref recursively. So when a
preference is nested in preference hierarchy, it's not safe to simply
call screen.removePreference(). We need to first find its parent and
remove pref from its parent.

Change-Id: Ic7fefa498ed71a8877d862845ddcc2d6d6034a55
Fix: 38507066
Test: make RunSettingsRoboTests
2017-05-24 21:21:00 +00:00
Juan Lang
777ed2535a Depend on SettingsLib's version of lifecycle and FooterMixin.
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.

Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
     && make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
2017-05-12 11:10:46 -07:00
Daniel Nishi
e6740f740e Fix a bug where options menu was not showing.
There were two issues that stopped the options menu from
showing properly. First, the SettingsPreferenceFragment did
not call its super class, causing the Lifecycle methods to
never be called. Second, the options menu was not being
invalidated which also stopped the Lifecycle methods from
being called.

Change-Id: I29f2fc105c7ecae7adaccb2e4643e48646398d8d
Fixes: 37255835
Test: Robotest
2017-04-14 14:25:37 -07:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08:00
Fan Zhang
35692cf439 Full screen default app fragment
Fix: 34280137
Test: make RunSettingsRoboTests
Change-Id: Ib44e39589781d68c7952a2c16a44682791a422f1
2017-01-23 16:08:42 -08:00
Fan Zhang
d5b48454a3 Build a new FooterPreference UI.
- Create a new layout for footer prefs.
- Create a new FooterPreference type to use the layout
- Create a Mixin to create and add the pref to screen
- Create a new lifecycle observer type to invoke mixin at right time
- Switch SettingsPreferenceFragment to use footer mixin.
- Switch FingerprintSettings to use the new footer pref.

Bug: 33579394
Test: RunSettingsRoboTests
Change-Id: I548ac39a0d120196a7ffed09b4f98bd9a80bae90
2016-12-14 16:41:49 -08:00
Fan Zhang
2d0b344736 Add InstrumentFragment for non-PreferenceFragment types.
This allows app fragment use a less heavyweight fragment as super class
if they don't need PreferenceFragment. Using this class as base is
generally easier to set up robolectric tests too.

Bug: 33354536
Test: RunSettingsRoboTests
Change-Id: I91c4d242ea0333c76c8767c03c3f18dee6b6e104
2016-12-05 17:13:33 -08:00
Qi Ding
55cdee2738 Merge "Fix searched item isn't highlighted" am: 363c529dc6 am: 1d07de566d am: 85768b3723
am: 051c1b298d

Change-Id: Ib75d421f6b4a4ee97006a3427bb4b1111c5ece2f
2016-10-13 01:40:53 +00:00
Qi Ding
051c1b298d Merge "Fix searched item isn't highlighted" am: 363c529dc6 am: 1d07de566d
am: 85768b3723

Change-Id: I7bb1c3b3a5dbb1ee4e6d8934a7be542076d1e863
2016-10-13 01:34:08 +00:00
Qi Ding
c4772636db Fix searched item isn't highlighted
The searched item isn't highlighted.
To fix this issue, the highlight process should be posted
as Runnable object.

Bug: 31983855
Test: manual - search a item in Settings app

Change-Id: I0dcc5bb52b2faa0a23991459885d8dfcaed0f226
2016-10-06 09:22:00 +00: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
Tony Mantler
0b825f5db0 Catch all data set changes
Test: Toggle wifi in settings
b/31649262

Change-Id: I303206f3b977707528e98dfe227b49835edc78f2
2016-09-27 14:48:50 -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
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
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
Fan Zhang
bf4be77f7e Merge InstrumentedFragment & InstrumentedPerferenceFragment
Bug: 30642749

The 2 classes are almost identical so I'd like to just merge them if
there is no specific reason for keeping both.

Change-Id: I46af41388e25abf79066ff25bfb793cdef2e06ea
2016-08-10 12:59:24 -07:00
Jason Monk
6263c2f6d4 Merge \\"Fix crash from dismissing after pause\\" into nyc-mr1-dev am: 8cb8dd05a2
am: 44c13b223f

Change-Id: I155ca86eb959fe9b5553be59842e15639c19d4a2
2016-07-19 14:35:53 +00:00
Jason Monk
8cb8dd05a2 Merge "Fix crash from dismissing after pause" into nyc-mr1-dev 2016-07-19 14:28:50 +00:00
Jason Monk
4c5f408e26 Merge \\"Make sure to clear out preference cache when done\\" into nyc-mr1-dev am: 9b0931e986
am: d1a54dc62a

Change-Id: I07e1c9725cd6880d7b974e318959cb746ab014b4
2016-07-15 17:55:57 +00:00
Jason Monk
8a7d0744be Fix crash from dismissing after pause
Change-Id: Ic9f655bff5aec5678d975389bc1f391b8d608099
Fixes: 29977187
2016-07-15 13:18:48 -04:00
Jason Monk
db7868ef25 Make sure to clear out preference cache when done
Change-Id: I05b420dcab67622782b3c1a3971c1a5a0b74ad56
Fixes: 29314480
2016-07-01 09:23:27 -04:00
Jason Monk
2f40b22d41 Merge \\\"Fix crash in finish from onCreate.\\\" into nyc-dev am: 1a1f6b0b1b am: 0fa8dc1b55
am: 4d86173586

Change-Id: I342042c107ea6cf8dcdcefd9d31b53232a8440ff
2016-06-10 15:17:20 +00:00
Jason Monk
656bc6004f Fix crash in finish from onCreate.
Change-Id: Ia4937fecdc93e30a468b8fefd2f8776186c8e151
Fixes: 29245324
2016-06-10 09:49:12 -04:00
Jason Monk
4a8b16323b resolve merge conflicts of 167f6cc to nyc-mr1-dev-plus-aosp
am: 84f544a2ae

Change-Id: I73d7ff76eae3871659063eb58d4efc849f261ac8
2016-06-08 19:34:31 +00:00
Jason Monk
b7e4380cd2 Remove PreferenceActivity
Its broken and isn't worth maintaining, instead port the few things
using it over to SettingsPreferenceActivity with wrapping blank
Activities like the rest of Settings.

Change-Id: Ic82f0dcb63ed9b4078f7da6a79c0c52f0130e8d1
Fixes: 28779941
2016-06-08 09:48:58 -04:00
Andrew Sapperstein
4ab0558972 Delete a bunch of dead code and resources.
Deleted a bunch of unused colors. Also deleted the FAB
since it's never actually used, The one xml location sets the visibility
to gone and it is never changed.

Change-Id: I9424d581960ef879f6742bf8f06ac8932224c7cc
2016-05-23 18:50:05 +00:00
Jason Monk
a627844fed Fix only one battery stat showing sometimes.
Take into account the prefs we are currently caching within the
group when counting how many prefs have been added.

Change-Id: I962acd41592c1a9366882711d3f4944bffb54d22
Fixes: 27931457
2016-04-21 10:12:30 -04:00
Johan Redestig
76218e54ae Fix back button on fragments without help uris
This is a follow up to 0708d9e119. The setHasOptionsMenu has
to be set for the back button to work and this needs to happen
regardles if the fragment has an help uri or not.

Bug: 28237921
Change-Id: Icec7a94312bdab5470efa0893a339d753c995eb1
2016-04-19 10:26:04 -07:00
Suprabh Shukla
b84720c075 Moving HelpUtils to SettingsLib
Moved HelpUtils to SettingsLib in frameworks/base so it can be shared by
packageinstaller as well.

Bug: b/22096093
Change-Id: I8d620abcde8279a3b4d11bbcff8ae9b6f46a1895
2016-04-05 14:37:33 -07:00
Jason Monk
1cb12bbd60 Fix crash when clearing preference screen
Bug: 27892359
Change-Id: I96cd167e8173bf0345c3e186fa11c2e613b63e6f
2016-03-29 13:21:48 -04:00
Jason Monk
f38fb38f26 Switch to whitelist for animations
Disable animations for all SettingsPreferenceFragments, unless they
explicitly ask for them before creating their preference screens.

Turn it on for all fragments using the cached removal currently.

Bug: 27713314
Change-Id: I1bc14e7aeb3ee5b8ddb4f3547f472305cd312edf
2016-03-18 15:16:12 -04:00
Jason Monk
2071eda150 Workarounds to avoid removing all prefs
Removing all prefs causes ugly animations, so avoid it at all cost
and cache all the prefs (while still added) as long as possible.

Bug: 26271353
Change-Id: I33b84d751938b460f4b66c0158057407dd45d974
2016-02-26 11:00:01 -05:00
Jason Monk
91e2f89b0f Rearrange configure/default apps
Bug: 27276982
Bug: 27279305
Change-Id: I443e9d2bc0c3fd9bcc13ee86716c14fbb55af0ba
2016-02-24 08:55:01 -05:00
Udam Saini
d553abcb4c Moves the encryption interstitial to use the list layout
bug:27206957
Change-Id: Ib577440a2696539f44021bb4ba0100e9f1699c6c
2016-02-19 16:28:34 -08:00
Anna Galusza
384fa2e342 Add Screen Zoom preview screen with settings page, launch Talkback tutorial
whenever the Talkback setting in SUW is pressed, and remove check for parent
Activity from SettingsPreferenceFragment.
Bug: 26734639

Change-Id: I5671735437844ac54ea68322838d9b6b5c81957f
2016-02-18 01:36:34 +00:00
Udam Saini
6a8b99dabe Fixes stack overflow on some settings preferences
bug:27130222
Change-Id: If273720591ca9a4d10143b36b63eb839e4fa0a4a
2016-02-10 16:35:15 -08:00
Jason Monk
30e9fc870f Fix activity weirdness by doing the right thing
Bug: 27091837
Change-Id: I983bcae15871b184e670a6baa819263e0ad58973
2016-02-10 12:55:37 -05:00
Anna Galusza
4a05b2906f Merge "UI fixes (back arrow, blue switch bar, append whether Talkback is on to summary), Talkback no longer disabled when preference is tapped, fixes SettingsPreferenceFragment to not check parent class to determine whether to show options menu." 2016-02-03 21:40:08 +00:00
Anna Galusza
0285c80664 UI fixes (back arrow, blue switch bar, append whether Talkback is on to
summary), Talkback no longer disabled when preference is tapped, fixes
SettingsPreferenceFragment to not check parent class to determine whether to
show options menu.

Change-Id: I3345e1a878f51b4387ca1bfe89855339617a94d6
2016-02-02 14:48:28 -08:00
Jason Monk
77467e04d4 Fix dream settings initial state.
The empty view wasn't being updated initially by the fragment
so it was being left in an empty state since no preferences are
added after the fact.

Bug: 25609200
Change-Id: Ib9aa02ba94bf7077d01892d96d79d39203047f4d
2016-01-30 12:15:11 -05:00
Sudheer Shanka
a78572cf39 Merge "Update the text shown when admin disabled fingerprint as unlock option." 2016-01-26 22:36:06 +00:00
Sudheer Shanka
550d068abd Add restricted padlock support for listpreference.
Change-Id: I1f3284a474d225df803abd57dd71382cb1dfa659
2016-01-26 21:40:49 +00:00