Commit Graph

284 Commits

Author SHA1 Message Date
Shigeki Yokomichi
df47bee061 Merge "Fix the "Alarm volume" icon is displayed incorrectly" am: e0ba81110a am: 657abc315d am: 4b06345751
am: bce364b776

Change-Id: Ia47be383cbc07818a7a51f85bfba4a30aedd3a5a
2017-02-16 13:23:02 +00:00
Treehugger Robot
e0ba81110a Merge "Fix the "Alarm volume" icon is displayed incorrectly" 2017-02-16 12:47:43 +00:00
Filip Pavlis
eadd5a9084 Fix incorrect header highlight when in single-pane.
Bug: 35216626
Test: Case will be covered in ag/1761868

Change-Id: I877823762a44d6545c80f4f59b29f190c389ba09
2017-02-10 18:00:43 +00:00
Filip Pavlis
8874d6efda Merge "Fix transitions between single and multi-pane." 2017-02-07 14:46:54 +00:00
Filip Pavlis
61fc0d47ff Fix transitions between single and multi-pane.
Transitions in and out of multi-window were causing navigation history
losses + incorrect views to be displayed. The history loss was caused by
the fact that single-pane mode was using Activities but multi-pane mode
was using Fragments. Translating history between those two would be
challenging. Because of that Fragment approach was also applied to
single-pane mode. That required some changes in back press handling and
initial logic when creating the PreferenceActivity.

Test: Separate CTS CL being submitted along this one, see the topic.
Bug: 32201932
Change-Id: I5e6a6a21c34e813d1c3522ae7f5e33f43887c602
2017-02-07 11:51:51 +00:00
Filip Pavlis
cba645896f Add getParent() on Preference.
Preference class now keeps track of its PreferenceGroup parent which
makes it easier to remove it from the preference hierarchy.

This required a new API method.

Test: Separate CTS CL being submitted along this one, see the topic.
BUG: 30599046
Change-Id: Ia9f274ef0315cb09a8c558e781b10f57efd28406
2017-01-12 16:03:11 +00:00
Filip Pavlis
0b0c6cbdaf Adds data store to provide data abstracion layer for Preferences.
Developers will be able to use PreferenceDataStore to replace default
SharedPreferences to store / retrieve the data.

Test: Separate CTS CL being submitted along this one, see the topic.

Change-Id: Ie46a876dcb14b46b8b2584735c106c25655ec6cf
2016-11-29 16:15:07 +00:00
Tony Mantler
18b7652db7 Merge "Allow styled text in pref titles and summaries" 2016-09-19 21:53:33 +00:00
Julia Reynolds
88dabdeeb2 Animate volume slider changes.
Change-Id: I03f83d25eeb2ef30346c377d6b4fcb8688faaffc
Fixes: 30670594
2016-09-15 18:47:21 +00:00
Tony Mantler
9a6b11b692 Allow styled text in pref titles and summaries
Also tidy whitespace

b/31372605

Change-Id: I4640c370bc7eb2c33deb2e76b152784505007216
2016-09-14 13:58:12 -07:00
Michael Kwan
09ba4a4b78 Ensure preference icon is returned when inflated from XML even if it has not been displayed yet.
am: f049e24c64

Change-Id: Iab0a315f916fe7da2b2a523f364be5a6842aadbd
2016-09-07 22:15:53 +00:00
Michael Kwan
f049e24c64 Ensure preference icon is returned when inflated from XML even if it has not been displayed yet.
Bug: 31343032
Change-Id: Ifa2c84b3091c2cfc5b98da6f30bb1ba060cd26e7
2016-09-07 13:15:55 -07:00
Michael Kwan
f704097df4 Add titles to PreferenceFragments and PreferenceScreens for watches.
am: 744be16ffa

Change-Id: I54847a5ef3ddb4e09cc835433d80e121cf32b725
2016-07-26 21:11:47 +00:00
Michael Kwan
744be16ffa Add titles to PreferenceFragments and PreferenceScreens for watches.
Preferences lack a title on watch type devices due to lack of ActionBar
support. A custom ListView was added to use a custom wrapper adapter to
add a persistent header view at the top of the ListView that developers
would not be able to remove via the ListView API.

Bug: 27962897
Change-Id: I6bccecf85592d9507e0c7a04c9a035617001e9ef
2016-07-26 10:57:56 -07:00
Shigeki Yokomichi
8eb355dff9 Fix the "Alarm volume" icon is displayed incorrectly
Symptom:
1. Set Alarm volume to 0 on Sound & notification screen, then tap
Back key and reopen the screen.
2. Set Alarm volume up to 1 or larger, then alarm icon changes to
unmute.
3. Set Alarm volume down to 0, then the icon doesn't change to
mute. There expected the icon should change to mute one.

Detail and sample:
SeekBarVolumizer manages a variable mLastAudibleStreamVolume.
This variable decides whether it executes mute procedure or not.
When this variable is 0, it will not execute mute procedure.
Because the condition to execute mute proceduce is below.
-  lastAudibleVolume * (mute ? -1 : 1) < 0
What original code will not update this variable from constructor
is one of problems. So once the icon changes to unmute one,
the icon will never change to mute one.

Solution:
Changed the condition as it doesn't depend on value of
lastAudibleVolume.

Bug: 30265487

Change-Id: I42165f39d1f344169674c09a045b6fb2bb25db4d
2016-07-21 11:47:40 +09:00
Michael Kwan
0353f42f06 Merge \"Allow preference theming to remove divider.\" into nyc-mr1-dev
am: 929c8f4a75

Change-Id: If6e8a902ef01378213990a171053788dcae568cc
2016-07-06 22:40:31 +00:00
Michael Kwan
908523014e Allow preference theming to remove divider.
Bug: 27962897
Change-Id: I6632f2a3c3d1290c472594f127ad33c9b85023f1
2016-07-02 19:31:32 -07:00
Jason Monk
d2ebee5e73 Revert "Add Preference#onDetachedFromActivity"
am: b65b710

* commit 'b65b7105cd5d20bf8a9f9c1b10afd6df968bc442':
  Revert "Add Preference#onDetachedFromActivity"

Change-Id: I78a6d99746507b6cde29f25bf161693c5ced4128
2016-04-05 14:13:32 +00:00
Jason Monk
b65b7105cd Revert "Add Preference#onDetachedFromActivity"
This reverts commit e18dc50c63.
Fixes: 27807793

Change-Id: Ib0384e3deb8d6376265e8e60f14490de128c9b68
(cherry picked from commit eff3ca5480)
2016-04-05 14:06:47 +00:00
Jeff Sharkey
cd3af14d2e Add methods to probe current storage state.
am: c9a40cd

* commit 'c9a40cd8448410316716e45ce051c9f1a3fc7054':
  Add methods to probe current storage state.
2016-03-27 19:24:07 +00:00
Jeff Sharkey
c9a40cd844 Add methods to probe current storage state.
Bug: 27811575
Change-Id: I2586fe3ec4d5c98c5b956f4b4a4cec425c81b0b1
2016-03-27 12:10:38 -06:00
Jeff Sharkey
a903fd7626 Merge "Update direct boot related documentation." into nyc-dev
am: 2a4e495

* commit '2a4e495448a048bef9d3b2a756816a622abd57b0':
  Update direct boot related documentation.
2016-03-18 16:35:03 +00:00
Jeff Sharkey
cf3f0a11a8 Update direct boot related documentation.
Also hide a few APIs as requested by council.  Add a method to
easily determine if a given File would already be encrypted at rest
by the OS.

Bug: 27531029
Change-Id: Icad5f1cd56411ad3ac707db85fd7449acdcc4b94
2016-03-17 19:58:05 -06:00
Jeff Sharkey
5a128c4f33 Merge "Refactoring FBE APIs based on council feedback." into nyc-dev
am: a0a58a2

* commit 'a0a58a2fd5cbc1bb8056227bb04f276b364c6e96':
  Refactoring FBE APIs based on council feedback.
2016-03-17 22:07:23 +00:00
Jeff Sharkey
a0a58a2fd5 Merge "Refactoring FBE APIs based on council feedback." into nyc-dev 2016-03-17 22:00:26 +00:00
Jeff Sharkey
8a372a0a28 Refactoring FBE APIs based on council feedback.
Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
2016-03-17 14:49:08 -06:00
Sudheer Shanka
422edce4ca Merge "Fix a race condition in SeekBarVolumizer." into nyc-dev
am: 54f4a63

* commit '54f4a630dcb66f0b6d5ae5b1028dc88d7971c99e':
  Fix a race condition in SeekBarVolumizer.
2016-03-17 20:09:39 +00:00
Sudheer Shanka
33194351fe Fix a race condition in SeekBarVolumizer.
Bug: 27355876
Bug: 27355810
Bug: 27355145
Change-Id: Ie33bf6aa92834076e3b8cf394c4d86400fb67592
2016-03-17 12:09:09 -07:00
Daniel Micay
b562aaaa4c Merge "fix SeekBarPreference support for summaries"
am: 06ce16a54c

* commit '06ce16a54c971e922d9e34cc5a57f012614db20f':
  fix SeekBarPreference support for summaries
2016-03-10 15:33:51 +00:00
Daniel Micay
084ee67b35 fix SeekBarPreference support for summaries
Overriding getSummary breaks support for summaries even though it's
supported in the layout for SeekBarPreference. If there's no summary the
return value is already null in the inherited implementation.

Change-Id: I2e72ea3c4a624acbf200e9617173eb072572fa57
2016-03-09 21:50:30 -05:00
mariagpuyol
3dc88c8f14 Fix bug in setText
Bug:27547655
Change-Id: Ia15facda59fab9a8fe9b30f74ddd085bc26871af
2016-03-08 11:45:39 -08:00
Adam Powell
5c2f839971 Un-hide string set persistence methods in Preference
6 years is enough time for API approval.

Bug 27324328

Change-Id: I5d5af0fc291250cd9ea5b50cd5031378475eacec
2016-02-23 16:28:07 -08:00
Jeff Sharkey
fd37abe9d5 Make PreferenceActivity/Fragment encryption ready.
Developers using these classes can getPreferenceManager() and
explicitly set the storage location for any SharedPreferences values
persisted through it.

Bug: 26747519
Change-Id: I133045df6a69aa99f33b6b6c447f52605468b927
2016-01-28 12:04:06 -07:00
Jeff Sharkey
6a6cdafaec APIs to obtain SharedPreferences paths.
Needed for apps that want to migrate SharedPreferences from CE to DE
storage.  Note that a device will only ever enter a CE mode with a
factory reset, so apps should only be using these APIs when they
want to migrate files to a consistent location on non-FBE devices
for simplicity.

Bug: 25503089
Change-Id: Ic846215da1617d116a048e036415ac7ad523b770
2015-12-07 19:25:25 -07:00
Jason Monk
7fc97c9134 Let support preferences use DeviceDefault themes
Change-Id: I5a0f074dfd1b948b1ced9195ae937e2ad80a5f28
2015-11-12 10:27:12 -05:00
Julia Reynolds
bd18c9fd0a am 3afdd417: am cad75a26: am 627bc805: am ae5a53d7: Merge "Update volume slider on device changed." into mnc-dr-dev
* commit '3afdd4177244423037a6c54650dd34ed2721aad8':
  Update volume slider on device changed.
2015-10-15 14:05:16 +00:00
Julia Reynolds
3afdd41772 am cad75a26: am 627bc805: am ae5a53d7: Merge "Update volume slider on device changed." into mnc-dr-dev
* commit 'cad75a2636ea53017686d6d565c60e92cdfac161':
  Update volume slider on device changed.
2015-10-15 13:59:47 +00:00
Julia Reynolds
3a10b10ee5 Update volume slider on device changed.
Bug: 24501085
Change-Id: I5bd0ac014eb291cafcf918e8a73a30e95245d533
2015-10-14 16:13:28 -04:00
Alan Viverette
fde4b0028f am b46886f4: am f518ad0a: Merge "IndexOutOfBoundsException on addPreference in PreferenceGroup"
* commit 'b46886f41d142cc63e054814caf76d15bf2f8cb6':
  IndexOutOfBoundsException on addPreference in PreferenceGroup
2015-10-07 17:01:53 +00:00
Alan Viverette
8c190029db am 2235ecd5: am f8ac5c34: Merge "Reset the setOnKeyListener callback when view is destroyed"
* commit '2235ecd5ec06e48bbcecb6f22a653e470d94dfef':
  Reset the setOnKeyListener callback when view is destroyed
2015-10-07 17:01:43 +00:00
Alan Viverette
f518ad0a49 Merge "IndexOutOfBoundsException on addPreference in PreferenceGroup" 2015-10-07 16:38:02 +00:00
Alan Viverette
f8ac5c3469 Merge "Reset the setOnKeyListener callback when view is destroyed" 2015-10-07 16:36:58 +00:00
Toni Barzic
e9889bf372 Forward SeekBarPreference key events to seekBar view
This is to ensure that seek bar progress gets properly updated,
and that progress changes reported by the seek bar are marked as
coming from user.

BUG=24416333
BUG=20049245

Change-Id: I0a48c8eae1528937024ca54720cac91c7d21b0b9
2015-09-30 10:22:06 -07:00
Jason Monk
e18dc50c63 Add Preference#onDetachedFromActivity
Change-Id: I7c78f96d41b33b902e54fe1c0b7246d555aab0ed
2015-08-12 15:27:51 -04:00
Mykola Kondratenko
5e18c40d28 Reset the setOnKeyListener callback when view is destroyed
NPE happened in mListOnKeyListener.onKey().

It looks like onKey in some cases is sent to a view while beeing
destroyed. When callback is received mList is referenced causing
the NPE.

Remove OnKeyListener first when destroying view so we can not get
any unwanted key callbacks.

Bug: 22333421

Change-Id: I94b198e31a2f9fbdd7fbadf4971be7720dcfad8d
2015-07-08 06:26:41 +00:00
John Spurlock
96d4a9ec39 Volume: Disable seekbar prefs when zen muted.
- And display the last audible value.

Bug: 21267436
Change-Id: I667d0680811b48a51eab22c837933e493f1d5c44
2015-06-10 19:04:40 -04:00
Alan Viverette
5c3188e75e Update seek bar dialog preference for Material
Bug: 21620889
Change-Id: Ie8e6f570a3be32722f4e49ccf81da263fda736fe
2015-06-08 15:59:32 -07:00
Jean-Michel Trivi
02fc19ecfc Ringtone picker is not affected by current sonification policy
Add the FLAG_BYPASS_INTERRUPTION_POLICY AudioAttributes flag when
  launching the ringtone picker so it is not affected by the
  current sonification policy, in order to ensure the audibility
  of the phone ringtone or default notification being previewed
  by the user.

Bug 19407114

Change-Id: Ibd24e3f14e56e67f9e37576a84c97a73f5494074
2015-05-21 11:52:41 -07:00
Alan Viverette
904de2ec93 Always force constructors accessible during inflation
We now correctly throw an IllegalAccessException for non-public accesses,
but we were relying on the old incorrect behavior during inflation. This
CL forces constructors to be accessible so that we emulate the old
behavior and don't crash.

Where we were already doing this, the CL moves the setAccessible() call
immediately after the getConstructor() call, since there's no point in
calling it multiple times.

Bug: 20810495
Change-Id: I63dfcb857e445f688080eea05e86ef22760ed49f
2015-05-04 10:32:57 -07:00
John Spurlock
721d457685 Volume: Automute in seek bar volumizer.
Never disable the slider, allow mutebusting and syncing mute to 0
value.

Also add new framework icon for media.

Bug: 20096341
Change-Id: I9db1671c3442365866a49c9d6f7becf0b2e05435
2015-04-16 11:01:15 -04:00