summaryrefslogtreecommitdiff
path: root/core/java/android/preference/PreferenceActivity.java
Commit message (Collapse)AuthorAgeFilesLines
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+2
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+2
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* 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-27/+13
| | | | | | | | | The AndroidX Preference Library is the recommended way to build settings screens moving forward. Bug: b/114357488 Test: n/a Change-Id: I3b3bff2daf43d8239d8bf247a9c2acebbc6374eb
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-171-0/+6
| | | | | | | | | | | | | | | | 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
* docs: fixed typoJoshua Baxter2018-06-041-1/+1
| | | | | | | Test: make ds-docs Bug: 36944070 Change-Id: I47ee8cb59516495c9271308e1de84e0dc7265fb6
* Merge "Fix home/back buttons flow in PreferenceActivity."Filip Pavlis2017-03-071-6/+16
|\
| * Fix home/back buttons flow in PreferenceActivity.Filip Pavlis2017-03-071-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: b/35977048 Test: Done manually. Automated test will be added later. After recent changes in PreferenceActivity finishing the activity on pressing back is not correct anymore. Instead onBackButton method should be called to deal with it (we have fragments transactions for instance). There can be multiple buttons: 1. The native default one - calls onBackPressed by default so no extra work needed. 2. PreferenceActivity has buttons that can de displayed when settting EXTRA_PREFS_SHOW_BUTTON_BAR to true. But it is a private API and I didn't find any usage of it, so there is no need to change that. Also it looks like something very specific used in WiFi wizards. 3. Apps often use a toolbar that has a home button which essentialy emulates back button. The issue is that this Activity never had support for this. So apps had to override onOptionsItemSelected and some of those are unfortunately calling finish() which worked previously when PreferenceActivity wasn't using fragments in single pane. This CL adds support so app will no longer need to override that method and some apps need to be instructed to use that override in O. Change-Id: I94f557edb2e03f89fbf02e800beb390b2ad0544f
* | Fix incorrect title in PreferenceActivity.Filip Pavlis2017-02-171-0/+8
|/ | | | | | | | | | When navigating from a preference panel back to the headers in single pane, the title was not restored and the original one (of the previous preference panel) was kept instead. Bug: b/35468759 Test: Is covered in ag/1761868 Change-Id: I30cc4c1d2a53d05411cc849ce8423b694c76976a
* Fix incorrect header highlight when in single-pane.Filip Pavlis2017-02-101-1/+3
| | | | | | | Bug: 35216626 Test: Case will be covered in ag/1761868 Change-Id: I877823762a44d6545c80f4f59b29f190c389ba09
* Fix transitions between single and multi-pane.Filip Pavlis2017-02-071-107/+115
| | | | | | | | | | | | | | 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
* Add some more @Nullable annotationsScott Kennedy2015-02-221-1/+2
| | | | Change-Id: I586d542e087eafa8355f0eaa606d66876c0f5a56
* Add @ResourceInt annotations on APIsTor Norbye2015-02-181-5/+12
| | | | Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
* Fix bug #17521147 Settings activity looks terrible on VolantisFabrice Di Meglio2014-09-261-6/+42
| | | | | | | | - update layouts for PreferenceActivity and its headers in two panes mode (per UX request) - add theming where it was missing Change-Id: I0c478c1a66b6de7e122b7ee73da24f3dd5a7bc28
* setSelectedHeader() when switching to fragmentBrian Attwell2014-06-171-1/+8
| | | | | | | | | | Without this change, passing a EXTRA_SHOW_FRAGMENT value for a two panel preferences activity will cause the correct fragment to be shown. However, it will not cause the correct header to be highlighted. Bug: 15675746 Bug: 5045558 Change-Id: I18d8e15dd104e8f39ae1ccbb11ab17fd1bf7462e
* Code cleaning for PreferenceActivityFabrice Di Meglio2014-01-081-5/+3
| | | | | | - remove non used argument Change-Id: If57b8230aefffdd77fbba240042093ddb6975b9d
* Apply theme to PreferenceActivity headersAlan Viverette2013-12-021-2/+2
| | | | | BUG: 11900302 Change-Id: Ibd1b08b412f6e64b44b2f3f07d297ede8fa01367
* Revert "PreferenceFragment showing the breadcrumb when not needed."Svetoslav Ganov2013-11-211-5/+6
| | | | | | This reverts commit 7db97b0a29c613afb78c2734bf2504324a71963d. Change-Id: Iefe9807fd75baf04e61ec59b508e438320c80fe3
* PreferenceFragment showing the breadcrumb when not needed.Svetoslav2013-11-011-6/+5
| | | | | | | | | | | | | The breadcrumb section is used for a single pane mode for showing the current user location. The breadcrumb should not be shown if its title and subtitle are empty. The code in PreferenceActivity onCreate updates the breadcrumb with the title and subtitle in a single page mode but does not hide it if they are empty. This change fixes that. bug:11242762 Change-Id: Ib1ba9e8afd9d0ab2e85d78a65ca7c18489464f6d
* Unmarshall PFDs properly when hand-crafting interface stubsAmith Yamasani2013-09-231-2/+3
| | | | | | | | | ParcelFileDescriptors now carry an optional socket fd to communicate close events. So, make sure that the correct creator is called when reconstructing parceled PFDs. Bug: 10759966 Change-Id: Ic6b9ffb8cb7af5f3a12440def595f74682231866
* Throw an exception if isValidFragment is not overridden for KK targetsAmith Yamasani2013-09-061-5/+2
| | | | | Bug: 9901133 Change-Id: I8dfe43aa90546e351f25c94579a34bb87658bf08
* Change build version from KEY_LIME_PIE to KITKATChet Haase2013-09-051-1/+1
| | | | | | Issue #10631619 Change build version to KitKat Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
* Use more styles for preferences to allow single pane 10"Amith Yamasani2013-08-061-2/+8
| | | | Change-Id: Ib3b1032ca45f22bca08546eb65b2c42bc1975bdf
* Merge "Don't check for valid fragment when switching to another fragment"Amith Yamasani2013-08-051-5/+1
|\
| * Don't check for valid fragment when switching to another fragmentAmith Yamasani2013-08-051-5/+1
| | | | | | | | | | Bug: 10184429 Change-Id: I09b39682d907a1cd7ce140e0be0faaddfaba6bd1
* | Fix javadoc for new APIAmith Yamasani2013-08-011-1/+1
|/ | | | Change-Id: I31d3eb877552029a346f956414227aac42e5582b
* PreferenceActivity Fragment securityAmith Yamasani2013-07-301-2/+36
| | | | | | | | | | | | | | Provides a way for PreferenceActivities to verify that they aren't being launched with Fragments not meant to be attached to them. Default implementation will fail verification for apps built with KLP. This will not affect apps built for earlier targets. Also, make sure that the class being instantiated is a Fragment and not some random class. Bug: 9901133 Change-Id: I564cd5168eabcadd7594ea8011e2081ebebfe063
* Ignore list item clicks if PreferenceActivity is paused.Amith Yamasani2013-07-181-0/+3
| | | | | | | | | | | Since list item clicks are delivered asynchronously, it's possible to get click callbacks after the activity has already paused. This should actually be blocked further up the event chain, ideally, so that the list selection state is not out of sync with the application. Bug: 9752185 Change-Id: I1058d64cba98e9093b462e2e581bdbccdace1420
* am 4b8cc94c: Merge "PreferenceActivity should not leave message in looper ↵Adam Powell2013-07-121-0/+2
|\ | | | | | | | | | | | | when destroyed" * commit '4b8cc94cc67d760e724c56aee9301d1bcc2bbe89': PreferenceActivity should not leave message in looper when destroyed
| * PreferenceActivity should not leave message in looper when destroyedHiroaki Kuriyama2013-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a PreferenceActivity is destroyed as soon as created, there is a problematic case that messages for the activity are sometimes left in the looper even after the activity is destroyed. For example, by clearing user data of the selecting IME on Settings apk, com.android.settings.Settings is re-launched 2 times successively. (Destory->Create->Destroy->Create) Due to the left message, application crash can happen. (NullPointerException at BackStackRecord.getBreadCrumbTitle()) Two cases have been found to observe this issue. [Case 1] 1,Launch IME in advance. 2,Go to Settings >Apps > All and choose the IME package. 3,Click "Clear data" 4,Application crash occurs on com.android.settings. [Case 2] 1,Go to Settings > Language&input > Language. 2,ListView dialog to choose language is shown. 3,Rotate the tablet 180 degree so that 90 degree rotation occurs twice. 4,Application crash occurs on com.android.settings. Change-Id: I5ce36ea7a40ab7bc7737b7dca6641a4c3d77a480
* | Fix issue #6595555: deal better with fragmentless headers.Dianne Hackborn2013-02-121-1/+10
|/ | | | | | | | | | | | | | | | | | If you constructed a preference activity whose first header didn't have a fragment, this would crash in two-pane mode because it would try to use that header as the initially selected header but not have a fragment to show. We need to have a fragment for whatever header we switch to, so the code now looks for the first header with a fragment as the initial header. Also added some error checks to throw more descriptive exceptions on bad headers -- when there is no header at all with a fragment, if the app tries to manually switch to a header without a fragment. Change-Id: Ia84221fcb2fe5755bb674e0606ac2a1fcde4cdc9
* No breadcrumbs for single-pane preferencesAmith Yamasani2012-10-031-0/+6
| | | | | Bug: 7274530 Change-Id: I6a4b6321a72ad38a757098ea470ac58d4294639b
* docs: add links to new Settings dev guideScott Main2012-07-261-0/+7
| | | | Change-Id: I04444ec0c4c1c278569b64f15cbbc7e8c1c623cd
* Add a private method to retrieve the header list from PreferenceActivityAmith Yamasani2012-06-201-0/+8
| | | | | | | | This is required by Settings app to be able to update the header list if the accounts list changed. Bug: 6685701 Change-Id: If27f83ec86fe1f3519a6e25de4e4fe4864133dc8
* Preferences padding and scrollbars to match spec.Jeff Sharkey2011-08-171-2/+0
| | | | | | | | Adjust preferences ListView to use direct padding instead of applying to outer parent. Also display scrollbars outsideOverlay on small screens. Change-Id: I750c53d2452d8842d487a091075c32f009f2c2fc
* Fix issue #5021385: Title of any Settings subscreen changes...Dianne Hackborn2011-07-211-0/+10
| | | | | | ...to "Settings" when orientation changes Change-Id: Ib6387b9813329174013452bcdf323cedc4b29664
* Support for arbitrary ListAdapter in PreferenceActivity.Gilles Debunne2011-06-151-20/+19
| | | | | | | Now relies on the adapter defined using setListAdapter instead of relying on the original mAdapter field that was hiding the one defined in ListActivity Change-Id: I6bab7b858d215bf6a33b3666528ba0f463dfec45
* Manual merge. Preference activity changes to work on smaller tablet screens ↵Amith Yamasani2011-05-261-27/+9
| | | | | | | | | 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-19/+79
| | | | | | | Tweak padding so layouts now look decent, a few extensions so that the correct title can be shown. Change-Id: Ieace16bf4962d66564c6e2f67fb588e582943850
* Add new PreferenceActivity API for settings.Dianne Hackborn2011-03-151-5/+26
| | | | | | Need to redirect to a different activity when on non-xlarge screens. Change-Id: I8cf4793b117325604d29ecc4478dbf10322a4689
* Fix issues #4087362 and #4087356Dianne Hackborn2011-03-111-3/+3
| | | | | | | | | | | | | | 4087362: Provide a safer way to call DialogFragment.dismiss() 4087356: PreferenceActivity.invalidateHeaders() can cause IllegalStateException: Can not perform this action after onSaveInstanceState These are very safe; the first is just a new public API that allows you to use an existing feature in DialogFragment, and the second just uses the version of commit that avoids the failure if happening at a point where the operation would be lost if restored from the last state (which is no big deal for preferences). Change-Id: I53971c9fb1efdcd599694cdcd4585b81afc156b8
* Fix bug 3362375 - API REVIEW: remove unused public 'up' idAdam Powell2011-01-201-1/+3
| | | | | | Fix bug 3362453 - API REVIEW: android.app.ActionBar Change-Id: I4e0233cd9355a47682bfe7b4a7fda39801586f1a
* Fix a bunch of API review bugs.Dianne Hackborn2011-01-171-4/+2
| | | | | | | | | | 3362464 API REVIEW: android.content potpourri 3362445 API REVIEW: Fragment transaction stuff 3362428 API REVIEW: Fragment stuff 3362418 API REVIEW: Loader stuff 3362414 API REVIEW: android.content.pm.ActivityInfo Change-Id: I6475421a4735759b458acb67df4380cc6234f147
* Start renaming FragmentTransaction.openTransaction() to beginTransaction().Dianne Hackborn2011-01-171-3/+3
| | | | Change-Id: Ib4a6d824b33cca699b7b25159c491fb610d5f5da
* Add a way to insert a parent bread crumb so that deep linked settings can ↵Amith Yamasani2010-12-141-0/+15
| | | | | | | | | navigate up. Bug: 3236568 This adds a way to insert a title as well as get a callback when that title is clicked. It is not really on the backstack and clicks must be handled via the listener interface.
* Potential fix for Settings screen ClassCast exception on the phone.Amith Yamasani2010-12-101-0/+3
| | | | | Bug: 3273396 Change-Id: I92477dc8d5e864027923c52545069710dff3575a
* Move the breadcrumbs to the right pane.Amith Yamasani2010-12-081-9/+12
| | | | Bug: 3236568
* Fix 3148496: Update PreferenceActivity to handle single-pane fragments.Jim Miller2010-12-081-1/+6
| | | | | | This fixes a couple of bugs I found while updating SecuritySettings. Change-Id: I9881cff71799ddf3c1d1493c2f7f3bfb31ca7774