Commit Graph

197 Commits

Author SHA1 Message Date
Fabrice Di Meglio
5aaae37506 Code cleaning for PreferenceActivity
- remove non used argument

Change-Id: If57b8230aefffdd77fbba240042093ddb6975b9d
2014-01-08 15:50:34 -08:00
Alan Viverette
f878c298e1 Apply theme to PreferenceActivity headers
BUG: 11900302
Change-Id: Ibd1b08b412f6e64b44b2f3f07d297ede8fa01367
2013-12-02 18:36:00 -08:00
Svetoslav Ganov
f7d720e6b0 am 4f23b610: am b95d6f54: am c6db9c3b: Merge "Revert "PreferenceFragment showing the breadcrumb when not needed."" into klp-dev
* commit '4f23b6104e11be81f3e2ca1a1031de6ca112f50a':
  Revert "PreferenceFragment showing the breadcrumb when not needed."
2013-11-21 12:22:59 -08:00
Svetoslav Ganov
45dbd75290 am dbab7e17: am 4ed5f502: am 4d159661: Merge "Revert "PreferencesFragment showing the breadcrumb area in single pane mode."" into klp-dev
* commit 'dbab7e1794f91e3dc4b0617df6fb59183c7349e5':
  Revert "PreferencesFragment showing the breadcrumb area in single pane mode."
2013-11-21 12:22:55 -08:00
Svetoslav Ganov
c6db9c3b37 Merge "Revert "PreferenceFragment showing the breadcrumb when not needed."" into klp-dev 2013-11-21 20:12:13 +00:00
Svetoslav Ganov
8fc552e695 Revert "PreferenceFragment showing the breadcrumb when not needed."
This reverts commit 7db97b0a29.

Change-Id: Iefe9807fd75baf04e61ec59b508e438320c80fe3
2013-11-21 19:36:22 +00:00
Svetoslav Ganov
68e7f13e22 Revert "PreferencesFragment showing the breadcrumb area in single pane mode."
This reverts commit 2b8795a9db.

Change-Id: If8dcc7190cbe66af09945d8b23a3e1d8fd791b1d
2013-11-21 19:33:53 +00:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Svetoslav
26ae3286c3 am ebda68bf: am 52dedb89: am 512c722f: Merge "PreferencesFragment showing the breadcrumb area in single pane mode." into klp-dev
* commit 'ebda68bf844d4b5b75a01317b45ee04041e726e3':
  PreferencesFragment showing the breadcrumb area in single pane mode.
2013-11-11 20:52:34 -08:00
Jeff Brown
08432a419b am fa0d9c2f: am 02b77575: am 1cdbbb1e: Merge "Changes to support new screen cast settings screen." into klp-dev
* commit 'fa0d9c2fa8e5c2c73bd36688784f1e44eb08635b':
  Changes to support new screen cast settings screen.
2013-11-11 20:51:03 -08:00
Svetoslav
2b8795a9db PreferencesFragment showing the breadcrumb area in single pane mode.
If the PreferenceActivity is running in a single pane mode we are
not showing the headers and the breadcrumb area. However, when this
activity is restarted and has a saved state to restore we are trying
to use headers even in a single pane mode. As a result the breadcrumb
area is shown and the content is shifted to the bottom with an empty
space at the top. This change ignores the saved headers from the
saved instance state in a single pane mode. Note that in such a case
these headers are null anyway as we do not use them.

bug:11242762

Change-Id: I2828bc82762695d9c93fb4ca43933598a9b12b87
2013-11-11 18:31:54 -08:00
Jeff Brown
75af171006 Changes to support new screen cast settings screen.
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
2013-11-10 22:51:15 -08:00
Svetoslav
2dc3477e7f am 109c0a21: am b1dac2f4: am 517220b4: Merge "PreferenceFragment showing the breadcrumb when not needed." into klp-dev
* commit '109c0a21938cbab8ae1bde594339cbdf338cb559':
  PreferenceFragment showing the breadcrumb when not needed.
2013-11-04 21:59:59 -08:00
Svetoslav
7db97b0a29 PreferenceFragment showing the breadcrumb when not needed.
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
2013-11-01 11:57:12 -07:00
Amith Yamasani
d94c31d13a am 32a2775e: am 85f77c2b: Merge "Unmarshall PFDs properly when hand-crafting interface stubs" into klp-dev
* commit '32a2775e529d13dfd34273a3b4af5151435720b2':
  Unmarshall PFDs properly when hand-crafting interface stubs
2013-09-24 10:22:50 -07:00
Amith Yamasani
c2be0d6183 Unmarshall PFDs properly when hand-crafting interface stubs
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
2013-09-23 13:35:46 -07:00
Alan Viverette
599d2a49e8 Fix default style attr in DialogPreference subclass constructors
BUG: 10751709
Change-Id: Ia7fa91e52881b46d39711d2adc43330014234a55
2013-09-16 13:48:29 -07:00
Amith Yamasani
a927fb6169 am 23d6b7b3: am 618f8cc5: Merge "Don\'t leave space for summary text if it\'s an empty string" into klp-dev
* commit '23d6b7b36096eef53f819ee5eee0aba3beecde67':
  Don't leave space for summary text if it's an empty string
2013-09-10 09:02:43 -07:00
Amith Yamasani
618f8cc5db Merge "Don't leave space for summary text if it's an empty string" into klp-dev 2013-09-10 15:59:37 +00:00
Alan Viverette
617feb99a0 Add View constructor that supplies a default style resource
Also updates the constructor of every class that extends View.

BUG: 10676369
Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
2013-09-09 18:09:13 -07:00
Amith Yamasani
b25158886b Don't leave space for summary text if it's an empty string
Bug: 10639567
Change-Id: Ifeb71ea0779a86e39fe55fb0bc6cd267dba4a92e
2013-09-09 14:50:21 -07:00
Amith Yamasani
a5001b94a0 Throw an exception if isValidFragment is not overridden for KK targets
Bug: 9901133
Change-Id: I8dfe43aa90546e351f25c94579a34bb87658bf08
2013-09-06 14:18:00 -07:00
Alan Viverette
0ccef4d003 Merge "Apply implicit parent dependency when adding to PreferenceGroup" into klp-dev 2013-09-05 23:36:18 +00:00
Alan Viverette
651b4249b9 Apply implicit parent dependency when adding to PreferenceGroup
BUG: 10493706
Change-Id: Iba741d8dd4e72bc5aef5c033e42a9ba4fb0c523b
2013-09-05 13:32:40 -07:00
Chet Haase
e8222dddaf Change build version from KEY_LIME_PIE to KITKAT
Issue #10631619 Change build version to KitKat

Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
2013-09-05 08:44:33 -07:00
Alan Viverette
d3927bd035 Merge "Allow recycling of Preferences in com.android.* packages" into klp-dev 2013-08-21 01:58:55 +00:00
Alan Viverette
791b37e0d9 Allow recycling of Preferences in com.android.* packages
Refactors hasSpecifiedLayout to canRecycleLayout for readability's
sake. All boolean references to the method have been inverted.

BUG: 10079104
Change-Id: Ie6beda9f0b837f889a6cc6a80377349e98cc4883
2013-08-20 17:34:19 -07:00
Alan Viverette
02f5680363 Add implicit parent dependency for Preferences
Also removes unused dependency change listener interface.

BUG: 10117838
Change-Id: I03f0eb37e7ba69942f7997a8b32adb38a3dee0bd
2013-08-19 16:32:56 -07:00
Amith Yamasani
cf638aceef Use more styles for preferences to allow single pane 10"
Change-Id: Ib3b1032ca45f22bca08546eb65b2c42bc1975bdf
2013-08-06 15:19:10 -07:00
Amith Yamasani
5b8f93047c Merge "Don't check for valid fragment when switching to another fragment" 2013-08-05 17:58:45 +00:00
Amith Yamasani
a47372c861 Don't check for valid fragment when switching to another fragment
Bug: 10184429
Change-Id: I09b39682d907a1cd7ce140e0be0faaddfaba6bd1
2013-08-05 10:55:28 -07:00
Amith Yamasani
20915daf06 Fix javadoc for new API
Change-Id: I31d3eb877552029a346f956414227aac42e5582b
2013-08-01 12:44:01 -07:00
Amith Yamasani
364ed4dda4 PreferenceActivity Fragment security
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
2013-07-30 16:23:50 -07:00
Alan Viverette
eb2fded0d3 Merge "Fix handling of ListPreference.setValue()" 2013-07-23 22:16:56 +00:00
Alan Viverette
94c02a1a1a Fix handling of ListPreference.setValue()
Previously, setValue() was not calling notifyChanged(). This
prevented the summary from updating correctly. Now it calls
notifyChanged() the first time it's called and when the value
actually changes.

BUG: 9987962
Change-Id: I02dd4be6bde2969f39d30921a62a7ba908128e0e
2013-07-23 14:43:37 -07:00
Eric Laurent
aca105cfb4 VolumePreference: fix audio sample playback
Handle audio sample start/stop request in a handler
to avoid race conditions.

If a sample is active, do not ignore playback requests but
schedule a second attempt one second later. This is to avoid
ignoring a playback request if a sample is short or about to finish.

Bug: 8176776.

Change-Id: If2d5f7d469eba345af3f4771067a076a56f4bfed
2013-07-19 19:48:02 +00:00
Amith Yamasani
49bdc1681e Ignore list item clicks if PreferenceActivity is paused.
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
2013-07-18 09:57:43 -07:00
Adam Powell
1dc3b790df am 4b8cc94c: Merge "PreferenceActivity should not leave message in looper when destroyed"
* commit '4b8cc94cc67d760e724c56aee9301d1bcc2bbe89':
  PreferenceActivity should not leave message in looper when destroyed
2013-07-12 15:09:54 -07:00
Hiroaki Kuriyama
1ebf13ef20 PreferenceActivity should not leave message in looper when destroyed
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
2013-07-12 15:42:35 +09:00
Dianne Hackborn
43861f9de9 am f46449ab: Merge "Avoid IllegalArgumentException in Preference.java compareTo()"
* commit 'f46449abedcba2167fffa8ba8dc2f6d7a6d410b9':
  Avoid IllegalArgumentException in Preference.java compareTo()
2013-05-26 00:02:46 -07:00
Carsten Hauge
b2e61e44e9 Avoid IllegalArgumentException in Preference.java compareTo()
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
2013-04-29 11:17:54 +02:00
Dianne Hackborn
19470ecc0f Fix issue #6595555: deal better with fragmentless headers.
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
2013-02-12 11:42:51 -08:00
Justin Koh
37ae558676 Expose PreferenceManager constructor / Preference#performClick
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
2012-10-25 16:27:43 -07:00
Amith Yamasani
3ec7bac9a0 No breadcrumbs for single-pane preferences
Bug: 7274530
Change-Id: I6a4b6321a72ad38a757098ea470ac58d4294639b
2012-10-03 16:21:42 -07:00
Adam Powell
c1b07211b8 Don't assume a default of 'false' for TwoStatePreference
TwoStatePreference would treat a default value of false as having no
effect since it matched the initial value of the internal field. This
caused asymmetric behavior around persistence and listener
notification when the default was true (persisted) vs. false (not
persisted).

Standard behavior for most Preferences is to persist the default
value. Make TwoStatePreference (CheckBoxPreference and
SwitchPreference) follow this pattern.

Bug 5722690

Change-Id: I8b3cf55efc5dfd573b511913b48ced017f0432d8
2012-08-10 14:36:53 -07:00
Scott Main
cdd0c59a01 docs: add links to new Settings dev guide
Change-Id: I04444ec0c4c1c278569b64f15cbbc7e8c1c623cd
2012-07-26 17:03:51 -07:00
Scott Main
bbb3f41e26 docs: add Settings dev guide;
a few changes to javadocs

Change-Id: I2d671aafe91e4c6e224e2a556a60dce9f93f11ae
2012-07-25 13:52:46 -07:00
Amith Yamasani
423d48bbba Add a private method to retrieve the header list from PreferenceActivity
This is required by Settings app to be able to update the header list
if the accounts list changed.

Bug: 6685701
Change-Id: If27f83ec86fe1f3519a6e25de4e4fe4864133dc8
2012-06-20 13:54:53 -07:00
Amith Yamasani
ade026f749 Avoid launching dialogs twice from double-clicking a preference.
Bug: 6500628

Only create the dialog if another one doesn't already exist.

Change-Id: Ie9be06a58c369299bcb67526e668785e6735a307
2012-05-16 17:02:32 -07:00
Amith Yamasani
cd9ea08d9c Fix amnesia problem in MultiSelectListPreference.
Bug: 6478079

Pointer assignment instead of copy was resulting in mValues being cleared
on next launch, since mValues became the same pointer as mNewValues.

Change-Id: I91014948e4f48056474b3ab31aab6d35e0ad69ca
2012-05-15 17:17:24 -07:00