Commit Graph

29 Commits

Author SHA1 Message Date
jackqdyulei
f25c9b0efc Add remote volume slider to sound settings
1. Add RemoteVolumePreferenceController to control volume through
MediaSessions.
2. Add related preference to skip calling AudioManager.

Bug: 126199571
Test: RunSettingsRoboTests
Change-Id: I9cb85ccf5f49be6d127cb61caf445b2ee7dfb579
2019-02-28 10:50:05 -08:00
Raff Tsai
736eae02bd Fix talkback speaks "double tap to activate" on preference
Talkback will speak "double tap to activate" on clickable view.
But the SliderPreference is not clickable. Because it is default
clickable for Preference. We should set android:selectable in every
SliderPreference.

Change-Id: I7bf09c2a7e2d8688352e35c1882674b6e73e5db7
Fixes: 121111172
Test: Manual
2018-12-20 06:57:52 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Ryan Lin
18aa25ea47 Merge "Add call volume in sound settings" into pi-dev am: b46389a588
am: 71b333f162

Change-Id: If69203fa5c4158f609484e6c3bbc0ca5bd6e0f58
2018-05-11 15:44:53 -07:00
ryanywlin
156fd91fbd Add call volume in sound settings
* Add call volume slider
* move "Take call" controller from "Ring volume" to "Call volume"

Bug: 77254162
Test: make -j50 RunSettingsRoboTests

Change-Id: I3443021c1557f42293e9b7772fe9072e5a966cf8
2018-05-11 17:56:16 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Julia Reynolds
0ddba4c119 Show suppression msg under ringer slider
Instead of replacing the rigner slider, because the stream
isn't actually muted.

Change-Id: Id2c60d6c570084ed8febcaeb3b096a487f572312
Fixes: 77641315
Test: robotests
2018-04-17 10:46:47 -04:00
Doris Ling
de08eaf437 Fix issue in ring volume sample not always being played.
- when we adjust the sound volme in Sound settings, we only re-post the
stop sample message when we receive the onSampleStarting callback.
However, if we change the volume while a sample is still playing,
onSampleStarting will not be called as it's already started. This
results in shortened sample duration, which in extreme case, the new
sample will not be played at all if the new volume change is made almost
towards the end of the previous sample period. So, everytime user change
the volume, we should re-post the stop sample message, so that the
sample playing duration would be extended properly.

- also removed the original calls to the onStreamValueChanged() during
init, as the original implementation is empty, and during init, we do
not need any handling to start/stop the sample.

Change-Id: I9f35ddfb6d809eeb83b1a732a09362286ff6ed77
Fixes: 77514234
Test: make RunSettingsRoboTests
2018-04-04 17:35:41 -07:00
Jean-Michel Trivi
32cf7ea45c Sound: VolumeSeekBarPreference must observe min vol index
The volume sliders must observe the minimum volume stream
  index, not just the maximum.

Bug: 74985293
Test: try to mute alarms through UI and fail
Change-Id: Icc5173898eb951239d02f5822239085f1ec3fc9a
2018-04-02 18:05:54 -07:00
Doris Ling
b7490bea28 Initialize the volume seekbar preference max and progress.
When the media stream is set, initialize the preference max and progress
with the streams current value. Otherwise, when we initialize the seekbar
volumizer, it will first set the seekbar max to 0 and progress to 0,
then update with the correct value, which will result in the jank that
is seen when the sound settings are displayed.

Change-Id: I515c97bbc6ec38bbe92755e3d7cb53bb13ac52d0
Fix: 34035654
Test: make RunSettingsRoboTests
2017-08-09 13:56:13 -07:00
Sheng Wang
fd1a02d914 Merge "Volume can not be updated in Sound&notification" am: c0fdbab185 am: 161e3d14e1 am: 9dbd34a3d9
am: 61a420df95

Change-Id: I0ed31e1c4e8b1a74a2aca2288876ca57f05ca79c
2017-06-02 00:57:09 +00:00
Sheng Wang
61a420df95 Merge "Volume can not be updated in Sound&notification" am: c0fdbab185 am: 161e3d14e1
am: 9dbd34a3d9

Change-Id: I50a30452b6e0162070960ffdc35197ddef785609
2017-06-02 00:27:56 +00:00
Fan Zhang
cbfe1eb881 Add title to SeekbarPreference content description.
Adding a title to contentDesciption of the seekbar.
The title is helpful to indicate which seekbar user is changing when
talkback is enabled.

Also move SeekBarPreference from root package to widget packge.

Change-Id: I793f41c4902e350b6bc6d62761362779cc3722a9
Fix: 35421942
Test: make RunSettingsRoboTests
2017-05-16 12:35:45 -07:00
Sheng Wang
176ee343b4 Volume can not be updated in Sound&notification
After "onActivityPause()" is invoked and "onActivityResume()"
is invoked again, "mVolumizer" is not empty object,
so volume is not updated.

To fix this issue, set "mVolumizer" is null in "onActivityPause()",
if "onActivityResume()" is invoked again, recreate "mVolumizer"
and update volume.

Bug: 37558283

Change-Id: Id91064ea32305b5bf203f34e31988ac923beee6d
2017-04-22 13:40:21 +09:00
Fan Zhang
bfb006aa32 Use framework support to customize dividers between prefs.
Bug: 33579296
Test: make RunSettingsRoboTests
Change-Id: I1bb3b82b88dc727cda05b00058e6f40564f0e5db
2017-02-27 12:47:44 -08:00
Doris Ling
1b3ec04748 Update SoundSettings to extend DashboardFragment.
- initial round of refactoring SoundSettings to use DashboardFragment.
- add controller for Cast, Do not disturb, Alarm volume, Media volume,
  Ring volume and Notification volume.

Bug: 32276590
Test: make RunSettingsRoboTests
Change-Id: I5c02a344bff5117bfce93d7ccac650fccc82d2b0
2016-12-01 17:24:05 -08:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Jason Monk
72965ad53b Handle adjust volume user restriction
- Finish all do not disturb pages immediately
 - Disable relevant items in Sounds & notification

Bug: 21642285
Change-Id: I8de9bd10b8cea8adaa306b1ae388ab7d1ccc4e7e
2015-06-30 19:21:10 +00:00
John Spurlock
f82154de8c Settings: Follow frameworks change to volume sliders.
Bug: 21267436
Change-Id: I72c6411346429ebf428662d1c6d6d8a7529c0d67
2015-06-11 10:06:30 -04:00
John Spurlock
aaaa54ec0e Settings: Rebind to volume sliders after returning from stopped.
Bug: 18118623
Change-Id: I29fb22a1a4476639a4f5cce06affd8ce58b6105d
2014-12-08 15:20:33 -05:00
John Spurlock
c868f7035a Settings: Improve inline volume sliders.
- Track framework changes to show mute states for non-ringer streams
 - Update vibrate icon in sync with other system components.

Depends on:
  Ie2df52edb070055ef59c74039162a0e785d2fdbb

Bug: 17899613
Change-Id: Ib38c86600693e0f36fe72deb231ea751e0486af7
2014-12-01 11:58:25 -05:00
John Spurlock
04b2e7957d Settings: Restart volumizers explicitly on resume.
onBindView is no longer called in all cases, so use
onResume as an additional signal that the user returned
to the settings page.  onActivityStop is called in both
cases to cleanup.

Bug: 17461564
Change-Id: I73a6775260951d4fd82ca8c3d8eb852f8dcc7452
2014-11-26 11:08:43 -05:00
John Spurlock
fdebfc35c4 Settings: Add effects suppression text to Ring volume.
If the effects are being muted by a notification listener, display
a "Muted by <x>" msg instead of an active slider inside the
Ring/Notification volume setting pref.

Update volume pref design to optimize for this new custom appearance.

Depends on frameworks/base:
  Icdb5f85eb4bcaa1ead7d77c1460e06ad3f0604d5

Bug: 17461563
Change-Id: I6da871e16009370402451a2ff507de4762644a80
2014-11-14 14:38:03 -05:00
John Spurlock
af05fda24d Settings: Restart existing volumizers in volume prefs.
Use the new .start() method to ensure the underlying volumizer
is always started, regardless of pref activity lifecycle.

Depends on frameworks/base:
  I2f860864161f818d5a62a28331ef1c47051fb39f

Bug:17898190
Change-Id: I55dea590c13363730549aa29f194337efccdeaf7
2014-10-13 20:47:05 +00:00
Dan Sandler
cb9f35171d Switch to vibrate (or slash-bell) icon at ringer volume 0.
Bug: 16900054
Change-Id: If94a18a7cac596c0f4c33421b642f96dcf0280fd
2014-09-02 12:48:51 +02:00
Fabrice Di Meglio
dbaf080f44 Fix VolumeSeekBarPreference
- was not able to do theming and all progress was blocked to "0"
- add missing constructors

Change-Id: Iee0d14b7f6e6708290e5d7838768f7a8da934c93
2014-06-17 11:37:55 -07:00
John Spurlock
85315533a1 Settings: Performance tweaks for SeekBarVolumizer.
Bind to existing volumizer instance when possible.

Bug:15091992
Change-Id: I26248967ff85fdb7a850451336d6850e508d4f18
2014-05-27 13:12:35 -04:00
John Spurlock
81bef1d745 VolumeZen: Sound & Notifications settings.
- Add sound settings under the newly combined Sound & Notifications
  top-level settings page.
- New slider preferences for setting audio stream volumes.
- Migrate checkbox prefs to switch prefs.
- New settings subpage for touch sounds.
- New settings subpage for "Showing notifications"
- New setting pref for displaying intercepted notifications in zen mode.
- New tri-state lockscreen notifications pref.
- Add priority + sensitivity options to app notification dialog.
- Remove badges on app notifications row, migrate to subtitle text.
- Migrate strings to common spot in strings.xml
- Remove heads up setting.
- Remove tweaks category (unused).
- Clean up notification settings, separate out into a code section per option.
- Clean up _settings.xml files, prefix each pref with option name.
- Add appropriate indexing data to each settings page.

Depends on f/b change Ic30aa575ae07650cee62c8c1d83b6bc69395cf0d

Change-Id: If700385a7d0057f6c4c4bcf6e648dcf88b8ebff2
2014-05-18 15:37:09 -04:00