summaryrefslogtreecommitdiff
path: root/core/java/android/preference/Preference.java
Commit message (Collapse)AuthorAgeFilesLines
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Deprecates framework Preference classesLouis Pullen-Freilich2018-11-191-0/+28
| | | | | | | | | The AndroidX Preference Library is the recommended way to build settings screens moving forward. Bug: b/114357488 Test: n/a Change-Id: I3b3bff2daf43d8239d8bf247a9c2acebbc6374eb
* Move some members to the "Q blacklist".Mathew Inwood2018-09-141-1/+2
| | | | | | | | | | | | | | Based on some analysis, these fields/methods are likely false positives. Set maxTargetSdk=P so that any apps using them are required to migrate off them in future. See the bug for more details. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-171-0/+9
| | | | | | | | | | | | | | | | For packages: android.preference This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I31a80552a66554d876edd01950df368c31239c2b
* Fix issue for Preference.setSingleLineTitle() has no effect.Doris Ling2017-06-231-0/+1
| | | | | | | | | | | | The flag to check whether the single line title attribute is initialized only when we processed the layout attributes. When the attribute is not set in the layout, but set through the setter method, the flag is not being updated properly, and hence the title view is not set correctly. Need to update the flag as well when the setter method is called. Bug: 62947301 Test: manual Change-Id: If843663165a0f3348048aaf1d920f3b740af5bc3
* Set icon frame to invisible when iconSpaceReserved is set.Fan Zhang2017-04-241-3/+7
| | | | | | Bug: 37572025 Test: manual Change-Id: I843bbf329a04964ddeccd17ed71e02f2264a5068
* Check if singleLineTitle attribute is set for the preference.Doris Ling2017-04-141-1/+5
| | | | | | | | | Only call setSingleLine() on the preference title if the attribute is set. Bug: 37328004 Test: manual Change-Id: Ia95230cd08feaf8213cb5917c105d070eb30c11c
* Reserve space for preference icon.Doris Ling2017-03-281-2/+31
| | | | | | | | | Add an attribute to Preference to specify whether the space of the icon view should be reserved when no preference icon is provided. Bug: 36448695 Test: manual Change-Id: I03b49fe93d54bb9106cf167a677a9ea544a3e3a1
* Allow multi line preference title.Doris Ling2017-03-211-0/+28
| | | | | | | | | Add an attribute to Preference to specify whether single line is to be used for the preference Change-Id: I578b496cdc4c5b0e3b3146183c6c30c4dee02eab Fix: 36389770 Test: manual
* Merge "Small cleanup or DataStore API javadoc."TreeHugger Robot2017-03-141-24/+24
|\
| * Small cleanup or DataStore API javadoc.Filip Pavlis2017-03-141-24/+24
| | | | | | | | | | | | | | | | | | | | | | There is also change in PreferenceManager.getSharedPreferences. The original was not always returning null in case mPreferenceDataStore is not null. That was contradictory with the java doc and conufing during the runtime. Added tests for it. Test: Separate CTS (2) being submitted along this one, see the topic. Bug: b/34322039 Change-Id: I78a6758a674c3c8139bbe66ec17f2e29ca847828
* | Enable recycling of third party preference widgetsFilip Pavlis2017-03-101-62/+80
|/ | | | | | | | | | | | | | | | Until now we have been recycling only framework preference widgets since there were no guarantees for third party preferences to support recycling. This let to broken animations for preference widgets that are outside of the framework. This change makes recycling to be used always and in case the developers need to turn it off they can explicitely use a new attribute that is being added to the Preference called "recycleEnabled" and set it to false. Bug: b/34334451 Test: Test are part of the same topic. Change-Id: I324087841e1edddbf0d3eaad00b5895a196acff6
* Improve preferences for PreferenceDataStore.Filip Pavlis2017-03-031-30/+42
| | | | | | | | | | | | | | | | | | | I have done some important cleanup of java docs where it wasn't clear enough that there is a PreferenceDataStore option. I have fixed incorrect behavior when setting default value while data store is assigned. Previsouly we looked into SharedPreferences which is incorrect. I have also changed behavior of methods getSharedPreferences and getEditor. These methods now return null when custom data store is assigned. The reason is that we definetly don't want to use SharedPreferences if data store is assigned. So the original behavior was a bit ambiguous. Also if we didn't enforce it, we would have troubles to change that in the future. Test: Tests are under the same topic. Change-Id: Ib7303bae13648767c519edba74ef9a7143e703df
* JavaDoc improvements as suggested by API council.Filip Pavlis2017-03-021-8/+16
| | | | | | Bug: b/35813554 Test: Not needed. Change-Id: I009497bab66c9cc624f434f6d2dde0d80381d961
* Add getParent() on Preference.Filip Pavlis2017-01-121-0/+23
| | | | | | | | | | | 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
* Adds data store to provide data abstracion layer for Preferences.Filip Pavlis2016-11-291-95/+181
| | | | | | | | | 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
* Allow styled text in pref titles and summariesTony Mantler2016-09-141-212/+212
| | | | | | | | Also tidy whitespace b/31372605 Change-Id: I4640c370bc7eb2c33deb2e76b152784505007216
* Ensure preference icon is returned when inflated from XML even if it has not ↵Michael Kwan2016-09-071-0/+3
| | | | | | | been displayed yet. Bug: 31343032 Change-Id: Ifa2c84b3091c2cfc5b98da6f30bb1ba060cd26e7
* Revert "Add Preference#onDetachedFromActivity"Jason Monk2016-04-051-14/+3
| | | | | | | | This reverts commit e18dc50c63110a57cfc29ec9bd21bf3f59abb6b4. Fixes: 27807793 Change-Id: Ib0384e3deb8d6376265e8e60f14490de128c9b68 (cherry picked from commit eff3ca5480789c51768a3a1697503fbbdadc1bd6)
* Un-hide string set persistence methods in PreferenceAdam Powell2016-02-231-7/+3
| | | | | | | | 6 years is enough time for API approval. Bug 27324328 Change-Id: I5d5af0fc291250cd9ea5b50cd5031378475eacec
* Add Preference#onDetachedFromActivityJason Monk2015-08-121-3/+14
| | | | Change-Id: I7c78f96d41b33b902e54fe1c0b7246d555aab0ed
* am 3fa46a0f: am d7fb6d26: am a01250c7: Merge "Frameworks/base: Change String ↵Andreas Gampe2015-03-281-1/+1
|\ | | | | | | | | | | | | == to equals in Preference" * commit '3fa46a0f79f35ca32ce102d4bbb1138c517ee754': Frameworks/base: Change String == to equals in Preference
| * Frameworks/base: Change String == to equals in PreferenceAndreas Gampe2015-03-181-1/+1
| | | | | | | | | | Bug: 19797138 Change-Id: I496b12c425da45ee098db12e72ad843c22444ba3
* | First implementation of the grant/revoke UISvet Ganov2015-03-241-2/+4
| | | | | | | | Change-Id: Icdb7c822881552b30850697dba709671bf27baa5
* | Annotate methods to be called from overrides with @CallSuperTor Norbye2015-03-071-0/+4
| | | | | | | | Change-Id: Ibc587c2aaee9f3e7f448079f72a75459fe4e15e7
* | Add @ResourceInt annotations on APIsTor Norbye2015-02-181-5/+11
|/ | | | Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
* Add preferences rendering.Deepanshu Gupta2014-12-231-1/+1
| | | | | NO_SQ: Depends on updating layoutlib-api-prebuilt.jar Change-Id: Iae93ab74c478e6f2158e1528467bec9ee2d7ee9b
* Update list item text appearanceAlan Viverette2014-04-091-3/+7
| | | | | | | | Adds a new attribute for secondary list item text and points the Gingerbread and Holo themes to use TextAppearance.Small for compatibility's sake. Change-Id: I8e78a908b699baae6d1f5b3623fd7b5648b99b77
* Add APIs for obtaining themed Drawable from Theme, ContextAlan Viverette2014-02-031-2/+2
| | | | | BUG: 12611005 Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
* am fa0d9c2f: am 02b77575: am 1cdbbb1e: Merge "Changes to support new screen ↵Jeff Brown2013-11-111-3/+3
|\ | | | | | | | | | | | | cast settings screen." into klp-dev * commit 'fa0d9c2fa8e5c2c73bd36688784f1e44eb08635b': Changes to support new screen cast settings screen.
| * Changes to support new screen cast settings screen.Jeff Brown2013-11-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the Preference ordering code to consider the case where two preferences might have the same order. In that case, it falls back on the title to disambiguate. Previous behavior was undefined (and technically not stable). Expose the wifi display device address. Perform wifi display scans every 10 seconds instead of every 15 to improve reponsiveness. Make sure to define routes for wifi displays that we are connecting to even if they are not yet paired. Simplified the logic for adding and removing these routes to avoid possibly getting out of sync and leaving stale routes behind. Fix wifi display notification icon. Bug: 11257292 Change-Id: I8ac15fb17d83758c0bdce80399e12723c367b83c
* | Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-18/+45
|/ | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* Merge "Allow recycling of Preferences in com.android.* packages" into klp-devAlan Viverette2013-08-211-9/+10
|\
| * Allow recycling of Preferences in com.android.* packagesAlan Viverette2013-08-201-9/+10
| | | | | | | | | | | | | | | | Refactors hasSpecifiedLayout to canRecycleLayout for readability's sake. All boolean references to the method have been inverted. BUG: 10079104 Change-Id: Ie6beda9f0b837f889a6cc6a80377349e98cc4883
* | Add implicit parent dependency for PreferencesAlan Viverette2013-08-191-3/+21
|/ | | | | | | Also removes unused dependency change listener interface. BUG: 10117838 Change-Id: I03f0eb37e7ba69942f7997a8b32adb38a3dee0bd
* Avoid IllegalArgumentException in Preference.java compareTo()Carsten Hauge2013-04-291-0/+3
| | | | | | | | | | | | In some situations the collection.sort() algoritm fails in compareTo() with a: java.lang.IllegalArgumentException: Comparison method violates its general contract!, due to a more strict validation of the compare contract. This strict validation was introduced in java 1.7. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6804124 This fix should prevent the sorting from crashing. Change-Id: I64230e7f62f83c99d7a6274964bb2988ae843826
* Expose PreferenceManager constructor / Preference#performClickJustin Koh2012-10-251-1/+2
| | | | | | | | Expose PreferenceManager constructor and Preference#performClick so they can be used by other UIs beyond the standard PreferenceActivity. Marked @hide so public API is not affected. Change-Id: Ieb4aecba5f86e40ff70f2b252458602e6b9ad1ee
* docs: add links to new Settings dev guideScott Main2012-07-261-0/+7
| | | | Change-Id: I04444ec0c4c1c278569b64f15cbbc7e8c1c623cd
* Hide Preference title when empty.Jeff Sharkey2012-04-031-15/+18
| | | | Change-Id: I1c1d73f5a4647657c7da65c72192fbac061fe259
* Inline SeekBarPreferenceJohn Reck2011-06-161-0/+12
| | | | | | | Dialog-based SeekBarPreference renamed to SeekBarDialogPreference New inline SeekBarPreference added Change-Id: I7a5d8f7aa554c4af4086a9bcc74cf07879c8523c
* Manual merge. Preference activity changes to work on smaller tablet screens ↵Amith Yamasani2011-05-261-10/+19
| | | | | | | | | and phones. Padding around fragments and to the left of preference items adjusted for different display sizes. Change-Id: I2d29e5525c381092a3f1d2fb1265ce07db893d78
* More work on making prefs work well on small screens.Dianne Hackborn2011-03-181-0/+15
| | | | | | | Tweak padding so layouts now look decent, a few extensions so that the correct title can be shown. Change-Id: Ieace16bf4962d66564c6e2f67fb588e582943850
* Add back legacy layout for preference framework for compatibility.Amith Yamasani2011-01-161-1/+1
| | | | | | | | | | Bug: 3184831 Copied holo layouts to *_holo.xml and restored the old layouts for non-holo (pre-honeycomb) apps to use so that their layout assumptions aren't messed up. Change-Id: If4dcef16191a47a4b101da6bfb0c2df1757d1ae4
* Adjust preference activity margins and move the widget back to the right side.Amith Yamasani2010-11-171-1/+58
| | | | | | Add a new "icon" field to Preference for adding icons to the left of the preference title. Several screens such as BluetoothSettings and Accounts have added their own custom preferences just to add an icon to the left. This makes it simpler going forward.
* am ca1db5ae: am dd644c17: Fallback to SharedPreferences.commit() when no ↵Brad Fitzpatrick2010-10-111-1/+8
|\ | | | | | | | | | | | | | | | | apply() exists. Merge commit 'ca1db5ae68971779fd8af83c908128849f470ae0' * commit 'ca1db5ae68971779fd8af83c908128849f470ae0': Fallback to SharedPreferences$Editor.commit() when no apply() exists.
| * Fallback to SharedPreferences$Editor.commit() when no apply() exists.Brad Fitzpatrick2010-10-101-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Gingerbread widened the SharedPreferences.Editor interface, adding an apply() method. Most people don't implement this interface themselves, but a couple apps do. A few spots in the core framework take a SharedPreferences[.Editor] from apps, which might be a pre-Gingerbread implementation without an apply() method. This patch makes sure we never depend on the presence of an apply() method, falling back to commit() if apply() isn't available. Change-Id: I32693ac9227a60b694526a26a30234fb17a40581
* | am 734d2707: am bb660d7e: Merge "Renaming SharedPreferences.startCommit to ↵Brad Fitzpatrick2010-08-301-1/+1
|\| | | | | | | | | | | | | | | | | apply" into gingerbread Merge commit '734d270769c609c7d3a1f2ec46e1d329d9682ab4' * commit '734d270769c609c7d3a1f2ec46e1d329d9682ab4': Renaming SharedPreferences$Editor.startCommit to apply
| * Renaming SharedPreferences$Editor.startCommit to applyBrad Fitzpatrick2010-08-301-1/+1
| | | | | | | | | | | | | | | | Also removes the artifical restriction that only one apply() can be in flight at once. That was old from when I thought it'd end up being required, but wasn't. Change-Id: I3540ea8be6e0760d6a51d218186f71655c2f3f55
* | resolved conflicts for merge of 28130bae to masterBrad Fitzpatrick2010-08-271-1/+1
|\| | | | | | | Change-Id: I13df8dc12092c3d2536e12216df9130d5914380a