Commit Graph

262 Commits

Author SHA1 Message Date
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
Michael Kwan
908523014e Allow preference theming to remove divider.
Bug: 27962897
Change-Id: I6632f2a3c3d1290c472594f127ad33c9b85023f1
2016-07-02 19:31:32 -07: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
c9a40cd844 Add methods to probe current storage state.
Bug: 27811575
Change-Id: I2586fe3ec4d5c98c5b956f4b4a4cec425c81b0b1
2016-03-27 12:10:38 -06: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
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
33194351fe Fix a race condition in SeekBarVolumizer.
Bug: 27355876
Bug: 27355810
Bug: 27355145
Change-Id: Ie33bf6aa92834076e3b8cf394c4d86400fb67592
2016-03-17 12:09:09 -07: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
Andreas Gampe
822b403b68 am 3fa46a0f: am d7fb6d26: am a01250c7: Merge "Frameworks/base: Change String == to equals in Preference"
* commit '3fa46a0f79f35ca32ce102d4bbb1138c517ee754':
  Frameworks/base: Change String == to equals in Preference
2015-03-28 05:18:14 +00:00
Svet Ganov
3695b8a148 First implementation of the grant/revoke UI
Change-Id: Icdb7c822881552b30850697dba709671bf27baa5
2015-03-24 20:15:43 -07:00
Andreas Gampe
c3e1c21482 Frameworks/base: Change String == to equals in Preference
Bug: 19797138
Change-Id: I496b12c425da45ee098db12e72ad843c22444ba3
2015-03-18 17:18:13 -07:00
Tor Norbye
417ee5ba89 Add resource type annotations to some APIs
Change-Id: I37c8afdaea455aa92bc8270bb2dfd60616c5f9bc
2015-03-13 11:20:45 -07:00
Tor Norbye
c615c6fc9c Annotate methods to be called from overrides with @CallSuper
Change-Id: Ibc587c2aaee9f3e7f448079f72a75459fe4e15e7
2015-03-07 20:49:18 -08:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Scott Kennedy
3c32b62044 Add some more @Nullable annotations
Change-Id: I586d542e087eafa8355f0eaa606d66876c0f5a56
2015-02-22 20:43:56 -08:00
John Spurlock
0a7269bbaf Merge "AudioAttributes: introduce new flags to bypass audio restrictions." 2015-02-19 18:24:24 +00:00
John Spurlock
bbfd31a5d4 AudioAttributes: introduce new flags to bypass audio restrictions.
- New @hidden @SystemApi FLAG_BYPASS_INTERRUPTION_POLICY, request
   to ignore any current audio restrictions, such as zen mode
   content-based notification filtering.
 - Wire up FLAG_BYPASS_INTERRUPTION_POLICY to the existing
   audio restriction checks in the framework.

 - New @hidden @SystemApi FLAG_BYPASS_MUTE, request to play
   audibly, even if the underlying stream is muted.
 - Wiring up to audio framework TBD.

 - Use both of these new flags on the inline volume slider
   controls used in Settings, ensuring playback is heard
   regardless of the current device filter state.

Bug: 19407114
Change-Id: I3d44394931592ccbc1b61ddd9a4d1cc984da17cc
2015-02-18 20:48:26 -05:00
Tor Norbye
7b9c912f53 Add @ResourceInt annotations on APIs
Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
2015-02-18 07:49:03 -08:00
Deepanshu Gupta
2bd01ebfa9 am 7ed14549: am 7081a114: Merge "Add preferences rendering." into lmp-dev
* commit '7ed145493d3f5bea32c567980f77cc42f613197e':
  Add preferences rendering.
2015-01-06 22:22:36 +00:00
Deepanshu Gupta
10bb1371dc Add preferences rendering.
NO_SQ: Depends on updating layoutlib-api-prebuilt.jar
Change-Id: Iae93ab74c478e6f2158e1528467bec9ee2d7ee9b
2014-12-23 12:04:30 -08:00
Daniel 2 Olofsson
6689c901cb IndexOutOfBoundsException on addPreference in PreferenceGroup
IndexOutOfBoundsException thrown when attempting to add preference
to PreferenceGroup and at same time removing all preferences in list.
Issue is caused by a race condition in addPreference that retrieves
index of where to add Preference from binary search of mPreferenceList
outside of synchronized lock. If list is cleared after this point but
prior to adding preference on index returned from binarySearch
exception is thrown.

Solved by moving binarySearch to inside synchronized block. This will
allow thread safety while not impacting behavior as result from search
is only ever used from within synchronized block.

Change-Id: Ic1e7954cf977b1ddd6ddba98d4cf771f21fb4d57
2014-12-08 19:19:31 +00:00
John Spurlock
bcc1087af4 Volume: Improve inline volume controls used in settings.
- Make the system internal ringer mode change signal available to
   other system components via a standard intent, instead of a
   volume-controller-only binder call.
 - Update sysui to use new intent for icon policy.
 - Add proper muting state to the volumizer, to look more like
   the associated volume panel slider.
 - Add basic ringer mode state tracking for the notification-ring
   slider setting.

Bug: 17899613
Change-Id: Ie2df52edb070055ef59c74039162a0e785d2fdbb
2014-11-28 15:29:21 -05:00
Alan Viverette
13e13ddd4e Format ListPreference summary with empty string if entry is null
Adding serif-monospace and sans-serif-monospace font families bumped
out the previous monospace, which left the summary as %s. Returning
an unformatted summary is never correct, and we should simply return
a summary populated with an empty string.

BUG: 17666124
Change-Id: Ic22dc5dc87d9ba3ad6f6b92ee059f5c98cbf103a
2014-10-21 17:05:07 -07:00
John Spurlock
735f9ebc18 Settings: Make SeekBarVolumizer more null-resilient.
Now that the instances are reusable, ensure all "post" methods
do a handler check, and ensure they are all internal.

Bug: 18063070
Change-Id: Idc478c636686f666f5656f3d07bf2738ba3e9a5a
2014-10-21 14:23:24 -04:00
John Spurlock
0e588ea8e1 Make SeekBarVolumizer restartable.
Decouple start from constructor, making it possible to restart
once stopped.

Bug:17898190
Change-Id: I2f860864161f818d5a62a28331ef1c47051fb39f
2014-10-13 20:46:36 +00:00
Fabrice Di Meglio
b22be6fcf2 Fix bug #17521147 Settings activity looks terrible on Volantis
- update layouts for PreferenceActivity and its headers
in two panes mode (per UX request)
- add theming where it was missing

Change-Id: I0c478c1a66b6de7e122b7ee73da24f3dd5a7bc28
2014-09-26 13:38:12 -07:00
Alan Viverette
996a63859f Fix accessibility events emitted from TwoStatePreference
Removes redundant and conflicting events emitted from check and switch
preferences. Sends VIEW_CLICKED accessibility events from AdapterView
rows after calling their on click listeners, which ensures data is
consistent.

BUG: 16961152
Change-Id: I4b57bceec6830d775c2da57226b8ee482242caf7
2014-09-02 16:35:45 -07:00
Fabrice Di Meglio
b1a50f2dff Fix bug #16957601 Stability: ISE in Settings: Observer com.android.settings.
SettingsPreferenceFragment$1@273c8fdb was not registered

- add onUnbindPreferences() call to match onBindPreferences()
- this new method is @hide so it does not impact the APIs

Change-Id: Iee0ab8a4ecc2046f89fb96cc52af150e835f658c
2014-08-14 18:00:11 +00:00
John Spurlock
351346092a Volume: Show safe media warning in settings.
If the safe media warning is enabled, make sure
we display it from the new inline slider preference in
Settings (without showing the volume dialog itself).

Also:
 - Update the warning dialog to the new sysui theme.
 - Separate the warning sentences with an additional line.
 - Fix the auto-dismiss timeout.
 - Add a system property to additionally enable the safe
   media warning for testing
 - Add more information to audio service dumpsys.

Bug:15434662
Change-Id: I95fec12c9049bbfdb7ebdf246160e4b12c0c5be3
2014-07-25 11:27:51 -04:00
Alan Viverette
4d065a04ce Remove old listener when rebinding SwitchPreference
Also fixes switch animation during scrolling, unnecessary call to
requestLayout() on drawable invalidate, and potential NPE.

BUG: 16225972
BUG: 4312303
Change-Id: I015d1f03206dd2c812592b0abfa4214a3de73d3f
2014-07-11 23:03:52 +00:00