Commit Graph

317 Commits

Author SHA1 Message Date
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
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
2018-09-14 13:18:34 +01:00
Julia Reynolds
d7e9d35a44 Disable preview on volume change
Test: manual
Change-Id: If6994c4f41f5c727b1589b14a6a6f89abb346f80
Fixes: 112169378
2018-09-07 17:35:19 +00:00
Andrew Zeng
2de4e50e94 Clarify constructor param in SeekBarVolumizer.
Bug: 78806021
Change-Id: Ice2c087976d0c34d85ef5c5c4660553a16502ba3
2018-08-22 01:24:22 +00:00
TreeHugger Robot
87c94c5b19 Merge "Add option to not play sample in SeekBarVolumizer." 2018-08-20 11:30:38 +00:00
Mathew Inwood
f221713f87 Add @UnsupportedAppUsage annotations
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
2018-08-17 13:41:55 +01:00
Andrew Zeng
ca97fe0092 Add option to not play sample in SeekBarVolumizer.
Bug: 78806021
Change-Id: Ib4d760aa092c606bdc1340c18dead88d4b7ddaee
2018-08-16 16:09:48 -07:00
Joshua Baxter
1b745baa39 Merge "docs: fixed typo" into pi-dev am: d82da978c1
am: 5cf765bc71

Change-Id: I1c8d0f9cfb3016510108ead9925826df68572019
2018-08-13 16:49:58 -07:00
Andrew Zeng
f3df16c03a Use VOLUME_SETTINGS_INT instead of VOLUME_SETTINGS
The VOLUME_SETTINGS_INT contains more stream types, VOLUME_SETTINGS
also has the @removed tag.

Bug: 78806021
Change-Id: If01b3693e6507f1cd9c9f587b49f6a4e89a67439
2018-07-26 22:13:51 +00:00
Joshua Baxter
a9aa1be6c7 docs: fixed typo
Test: make ds-docs

Bug: 36944070
Change-Id: I47ee8cb59516495c9271308e1de84e0dc7265fb6
2018-06-04 13:25:13 -07:00
Aurimas Liutikas
7f6953369a Fix broken links in @see tags in framework docs.
doclava was accidentally suppressing all these broken links
in @see tags. This CL fixes issues so we can start enfocing
checks for broken @see links.

Test: make docs
Exempt-From-Owner-Approval: Fixing @see javadoc link issues that are currently completely broken
Change-Id: I767e9fb9842494e5eccef2a7bdeee3877c488b5d
2018-06-01 17:15:55 +00:00
Siarhei Vishniakou
c6442335be Dismiss Dialog in post instead of immediately
When ViewGroup is dispatching touch events to children, it can
happen that a child, upon receiving a touch event, may decide
to close the window. In this case, dispatchDetachedFromWindow will be
called, which would invalidate (=recycle) the TouchTargets. As the
ViewGroup would continue dispatching the event to other children, those
TouchTargets would already no longer be valid. This could cause an NPE.

In one particular example, there could be several views in a Dialog, and
one of the views would dismiss the Dialog in a click handler.
Since the click handler executes events immediately, this makes
ViewGroup.dispatchTouchEvent recurse on itself, and modify the internal
state. This would later cause the NPE.

Calling dismiss in a message avoids this issue by letting the event
handling finish before dispatching dispatchDetachedFromWindow, which
would cause another ACTION_CANCEL to be sent to the view.

Bug: 26611563
Test: created a sample app and recorded a sequence of touch events using
inputstudio in order to reproduce the crash. The repro rate was 100%.
Could no longer repro with this change.

Change-Id: Ia1d8070152c7ba2d14cddebcc5844994fe3ab5da
2018-04-04 14:22:13 -07:00
Beverly
d696476fb3 System sounds get its own dnd toggle
- Added logic for streams to be muted by dnd (unassociated with ringer)

Test: runtest -x frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java
Bug: 73362490
Change-Id: I1101e67282f7331497e91eb510d2bf4f1ea6b4b1
2018-03-06 09:08:29 -05:00
TreeHugger Robot
40ce09581d Merge "Add OWNERS for preferences" 2018-02-13 13:17:21 +00:00
Clara Bayarri
a137711868 Add OWNERS for preferences
Test: none
Change-Id: I1679ba3f10a89a4076888936aebf067c371bcf27
2018-02-13 11:28:02 +00:00
Beverly
925cde8f74 Alarms and Media visibly muted in PriorityOnly dnd
- if alarms and/or media cannot pass dnd and the phone is currently
in priority only dnd, then the alarm and/or media volume stream
will appear muted in the volume dialog and sound settings
(Settings > Sound)
- if all behavior for priority only dnd is not allowed to bypass dnd
(discluding alarms and media), then ringer is muted when priority-only
dnd mode is on. If a user clicks this ringer in the volume dialog, then
dnd ends
- Updated default zen config to version 3 (added alarms and media)
Test: manually toggle alarms + media in Settings > Sound > DND >
Behavior, toggle on/off dnd and then look at volume dialog and
volume bars in Settings > Sound
Test: runtest --path cts/tests/tests/media/src/android/media/cts/AudioManagerTest.java
Fixes: 72052742

Change-Id: Ia9e809ec2be93cb5a9ba6518dce04bf3ce45110b
2018-01-26 18:39:06 +00:00
Ian Lake
0a1feb8192 Deprecate framework Fragments and Loaders
Redirect developers to use the Support Library
versions of Fragments and Loaders to ensure that
they get consistent behavior across versions of
Android and all devices as well as access to
Lifecycle improvements.

Test: Confirmed APIs deprecated in current.txt
BUG: 68381801
Change-Id: I58ec599e557fc93c8547c45ba7c9ced96b0c8616
2017-11-13 10:55:59 -08:00
Jean-Michel Trivi
d51d398383 Fix alarm preview volume
SeekBarVolumizer: do not use FLAG_BYPASS_INTERRUPTION_POLICY as
 there is no need to bypass DnD modes in seek bar for volume
 since they are disabled according to the DnD mode.
AudioService (PlaybackActivityMonitor): check both
 AudioAttributes flags BYPASS_INTERRUPTION_POLICY and
 BYPASS_MUTE for forced alarm playback (see b/63617557).

Test: see bug
Bug: 67578783
Change-Id: Iaf43f16d96d1ad8a1eacc73a050db767004ba96b
2017-10-10 18:13:18 -07:00
Doris Ling
846234f399 Fix issue for Preference.setSingleLineTitle() has no effect.
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
2017-06-23 13:57:15 -07:00
Fan Zhang
c1caca1458 Set icon frame to invisible when iconSpaceReserved is set.
Bug: 37572025
Test: manual
Change-Id: I843bbf329a04964ddeccd17ed71e02f2264a5068
2017-04-24 10:05:12 -07:00
Doris Ling
ce58046673 Check if singleLineTitle attribute is set for the preference.
Only call setSingleLine() on the preference title if the attribute is
set.

Bug: 37328004
Test: manual
Change-Id: Ia95230cd08feaf8213cb5917c105d070eb30c11c
2017-04-14 14:04:32 -07:00
Doris Ling
9ed53e35ed Reserve space for preference icon.
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
2017-03-28 22:47:18 +00:00
Doris Ling
2cb4bab1a8 Allow multi line preference title.
Add an attribute to Preference to specify whether single line is to
be used for the preference

Change-Id: I578b496cdc4c5b0e3b3146183c6c30c4dee02eab
Fix: 36389770
Test: manual
2017-03-21 10:19:43 -07:00
TreeHugger Robot
3ee60614af Merge "Small cleanup or DataStore API javadoc." 2017-03-14 16:51:49 +00:00
Filip Pavlis
ee3bc34c3a Small cleanup or DataStore API javadoc.
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
2017-03-14 15:08:04 +00:00
Filip Pavlis
4186b344d8 Enable recycling of third party preference widgets
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
2017-03-10 19:19:47 +00:00
Filip Pavlis
e88fbbac12 Merge "Fix home/back buttons flow in PreferenceActivity." 2017-03-07 19:09:50 +00:00
Filip Pavlis
6af15ebcfe Fix home/back buttons flow in PreferenceActivity.
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
2017-03-07 19:05:57 +00:00
Filip Pavlis
0955793a45 Improve preferences for PreferenceDataStore.
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
2017-03-03 18:20:01 +00:00
TreeHugger Robot
d1c7bb771c Merge "JavaDoc improvements as suggested by API council." 2017-03-02 16:38:56 +00:00
Filip Pavlis
fd59645ba7 JavaDoc improvements as suggested by API council.
Bug: b/35813554
Test: Not needed.
Change-Id: I009497bab66c9cc624f434f6d2dde0d80381d961
2017-03-02 14:26:58 +00:00
Jeff Sharkey
dd9bda81f6 Delete @removed APIs that never shipped.
These were never part of any public API level, so apps should never
have been using them.

Test: builds, boots
Bug: 31241513
Change-Id: I4fc8f5c325da56694a5db98acc995a22d4947805
2017-02-24 13:41:20 -07:00
TreeHugger Robot
27f8d6d977 Merge "Fix incorrect title in PreferenceActivity." 2017-02-20 19:30:35 +00:00
Filip Pavlis
b07c6f621a Fix incorrect title in PreferenceActivity.
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
2017-02-17 19:23:04 +00:00
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