Commit Graph

366 Commits

Author SHA1 Message Date
Behnam Heydarshahi
0d92b10cc5 Remove volume_separate_notification flag
Replace it with true. This flag has been true for all UDC devices since
2022-02-17 so this is expected to have no user-visible effect, except
in cases where devices aren't getting server-side flag updates.

Bug: b/255363741

Test: atest VolumeDialogImplTest AudioServiceTest

Change-Id: I036dbe8611bf022c1e7c5878fd17ba5a61aca99d
2023-05-15 19:43:22 +00:00
Jean-Michel Trivi
f58c1ce7ff Merge "SeekBarVolumizer: fix handling of routing change" into tm-qpr-dev am: c82fa1ff23 am: 4cf8ff36ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22133032

Change-Id: Ifaa29318ecde508c21e805af7c3c15270c2b8f1a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-22 13:19:47 +00:00
Jean-Michel Trivi
4cf8ff36ea Merge "SeekBarVolumizer: fix handling of routing change" into tm-qpr-dev am: c82fa1ff23
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22133032

Change-Id: I4e4ad012c24f5c406aaf55467224b46dc01b0ea4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-22 13:10:12 +00:00
Jean-Michel Trivi
8776acf768 SeekBarVolumizer: fix handling of routing change
Bug cause: when audio routing changes, SeekBarVolumizer handles
the STREAM_DEVICES_CHANGED_ACTION intent action. When this
event is associated with a charging animation, the Fragment
handling the sliders causes VolumeSeekBarPreference.onActivityPause
to call SeekBarVolumizer.stop, which in turns sets a stop time,
and thus causes isDelay to always be false while the action
is handled. As a result the volume sliders are not updated
with the new values.
Fix: when the routing is not handled, post a message to
reevaluate the conditions for update at a later time.

Other fix: when handling STREAM_DEVICES_CHANGED_ACTION,
first consider if the device is using stream types, and only
then test for isDelay(), otherwise the VolumeGroup code
path is wrongly executed.

Optimization: do not cause AudioManager to
construct a list of AudioProductStrategy for each
event, just query once in constructor and cache the
result.

Bug: 265446544
Test: with Settings > Sound open, dock/undock the device
  (on a dock w/ speakers)

Change-Id: I1ac02854328aa16aacc9db77921cdf4cae019ead
2023-03-17 14:34:46 +00:00
Behnam Heydarshahi
a0668f97ce Merge "Add flag to separate notification audio and ui" into tm-qpr-dev am: dd4b1a0d7d am: 97b43449c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20180063

Change-Id: Ic85bec6a394769f235f29ee364c044140ec32740
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 18:33:40 +00:00
Behnam Heydarshahi
97b43449c2 Merge "Add flag to separate notification audio and ui" into tm-qpr-dev am: dd4b1a0d7d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20180063

Change-Id: I8d858b5deaaa340039edc1c3b87d20d34d915f47
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 16:15:00 +00:00
Behnam Heydarshahi
b206e0b6a2 Add flag to separate notification audio and ui
AudioService and SeekBarVolumizer now read a flag instead of a config
boolean, when trying to determine if notification stream is separate
from ring.

Remove the now unused config & symbol for ring/notif stream alias

Bug: b/38477228

Test: atest AudioServiceTest#testRingNotifAlias

Change-Id: I1ee08c78984d3841711f88fcec360c936da00090
2022-10-28 21:26:41 +00:00
Behnam Heydarshahi
07edc2a049 Merge "Separate notification/ring volume sliders in UI" into tm-qpr-dev am: 1387d8d4ac am: 18492d79dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19939977

Change-Id: I1fa3c65e2d3bfe71f064e72fd5b8b236e66e005e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 20:38:18 +00:00
Behnam Heydarshahi
18492d79dc Merge "Separate notification/ring volume sliders in UI" into tm-qpr-dev am: 1387d8d4ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19939977

Change-Id: I0ed14ab3d6ff7aa245fda866f1db1809aa069950
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 20:07:05 +00:00
Behnam Heydarshahi
60cd96f8da Separate notification/ring volume sliders in UI
Separate the logic between notification slider and ring slider in
setting through new logic in SeekBarVolumizer when ring is not aliased
with notification in config.xml.

Start the notif/ring separation code but hide it in the new SysUI volume dialog.

Bug: b/38477228

Test: manual
      (1) With ring/notif alias set to false, in the Sound Settings, drag ring volume to zero. Verify notification volume snaps to zero as well. Then drag the notification volume out of zero. Verify that notification volume is stable at the new value and does not wrongly snap back to zero.
      (2) With the alias set to false, drag media volume to zero, midpoint, and max. Verify the slider control is stable, and that the audio level corresponds relative to the level on UI.
      (3) Repeat test 2 with the alias set to true.

Change-Id: Ifff4c06a952ba13dc6d6830fea5fe47651fa5b2e
2022-10-05 15:52:17 +00:00
Sorin Basca
a3fbe9ced8 Merge "Fix errorprone 2.15.0 errors" am: f9ae30fa6f am: 211af41853 am: e224114968 am: dd8e8b2bfd am: 8180cfd052
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2220922

Change-Id: I198be85ef2ec926c9e1e3bd31fb66fbf3dc68ad0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 15:25:25 +00:00
Sorin Basca
f9ae30fa6f Merge "Fix errorprone 2.15.0 errors" 2022-09-22 12:07:04 +00:00
Sorin Basca
9494351464 Fix errorprone 2.15.0 errors
Bug: 246761518
Test: RUN_ERROR_PRONE=true m javac-check lint-check dist
Change-Id: I41ebe20f1621966b623ff5dd59e5162deeca6b10
2022-09-19 11:17:29 +01:00
Treehugger Robot
6225fe57e9 Merge "Prefer Boolean.valueOf() to new Boolean()" am: dd098dcea6 am: 3df2621db3 am: 98d7622397 am: 7222c4ce3d am: 0172885f6f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2215122

Change-Id: I2bc39ece888b8007dac4441b8eeaa22d31a3cf8b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 02:01:19 +00:00
Orion Hodson
415c4b415c Prefer Boolean.valueOf() to new Boolean()
Avoids unnecessary allocations.

Bug: N/A
Test: Treehugger
Change-Id: I4f1c9753decbb5da605a150a5bb878e565d1ba96
2022-09-13 09:42:33 +01:00
Hani Kazmi
4f221e5c51 Migrate Bundle/Intent APIs to new, type checked, variants
Part of go/safer-parcel. Follow up to ag/16639043. Migrates the following unsafe APIs:

* Parcel.readArray()
* Parcel.readParcelableArray()
* Bundle.getSerializable()
* Bundle.getParcelable()
* Bundle.getParcelableArrayList()
* Bundle.getParcelableArray()
* Bundle.getSparseParcelableArray()
* Intent.getSerializableExtra()
* Intent.getParcelableExtra()
* Intent.getParcelableArrayExtra()
* Intent.getParcelableArrayListExtra

Bug: 227458983
Test: m and presubmit pass
Change-Id: I72f206cb18eb5c669a7fff07a6845bed1c433fdb
2022-07-01 10:53:53 +00:00
Chaohui Wang
68ed78c06a Add SETTINGS_SLIDER CUJ to InteractionJankMonitor
Also add a default onStopTrackingTouch() method in the
SeekBarVolumizer.Callback to let Settings inject the jank monitor.

Bug: 230285829
Test: make build
Change-Id: I9f5f511183f62caf809d7326766549b87d226b0b
2022-04-30 12:58:02 +08:00
Alan Viverette
406e0f6553 Migrate frameworks/base javadocs references to androidx
Does not remove Support Library artifacts from docs classpath (ApiDocs.bp)
because they are still used in development/samples, which is not as easy
to migrate as javadoc.

Bug: 158779503
Test: make docs
Exempt-From-Owner-Approval: Mass find/replace for androidx migration
Change-Id: Icf7f53ec36a0e970413352e2ebf40ce9d60ed17e
2022-02-09 22:25:14 +00:00
Paul McLean
d6f87c8530 Moving additional AudioManager tests to gts/GMSCore
Bug: 183606360
Test: atest GtsGmscoreHostTestCases:AudioServiceHostTest#testAudioVolumeGroups
Test: gts-tradefed run gts --skip-device-info --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -m GtsGmscoreHostTestCases -t 'com.google.android.gts.audioservice.AudioServiceHostTest#testAudioVolumeGroups'

Change-Id: I145cfd5602ea9de92012654704d6ebffe723868a
2021-04-12 09:00:42 -06:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
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
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

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
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
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
2020-10-27 15:46:07 +00:00
Hugh Chen
a4654f1887 Add 0.5 second delay to set stream or play volume ringtone
If get Ring/Alarm/Media stream volume right after stop call volume,
it will return the volume of the earpiece then cause UI incorrect.
It is because the call volume is from the earpiece and the
alarm/ring/media is from the speaker.
This CL adds 0.5 second delay when play volume or set stream
to avoid get wrong volume.

- Add onStartTrackingTouch() callback to stop the ringtone when
  another seek bar is adjusted.
- Add 0.5 second delay to set stream or play volume ringtone.

Bug: 80194851
Test: build, adjust call volume then immediately adjust ring volume
Change-Id: I06c5e84af60f0d77daffabb4a22644f43a9cf54d
2020-09-15 16:04:11 +08:00
Louis Pullen-Freilich
b7a28dd234 Merge "Adds lpf@ to preference owners" am: 0c66523a48 am: 8a42ceda65 am: 0c311b4d8a am: d839a65584 am: 0fc494407f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1406973

Change-Id: I72b1234cfb4200e839cc810cee4b42884b1852b1
2020-08-24 12:38:30 +00:00
Louis Pullen-Freilich
0c311b4d8a Merge "Adds lpf@ to preference owners" am: 0c66523a48 am: 8a42ceda65
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1406973

Change-Id: I496eeb2ed6dc00f07bc4948af56fcfa339cf21dc
2020-08-24 11:30:34 +00:00
Louis Pullen-Freilich
76ec215c01 Adds lpf@ to preference owners
Change-Id: I11c74417090ce3b4da8c26512425df624a3932b9
2020-08-21 17:05:34 +00:00
Ming-Shin Lu
d5ae401390 Fix showing keyboard without editor focused in some cases (2/2)
As CL[1] mentioned issue symptom, we also need to remove
STATE_ALWAYS_VISIBLE in EditTextPreference
and using new WindowInsets API to show soft-keyboard, to prevent the
keyboard may be shown without focusing editor case.

[1]: I37ae6e30d1de581ba15131c2a90396b3a522a4d6

Fix: 165910518
Test: atest CtsInputMethodTestCases
Test: manual as issue steps
1. Enter Dialer-> Menu -> Settings-> calling accounts -> Fixed Dialing Numbers
2. Tap change pin2 code, input old pin2 -> pressing ok button
3. Check if password keyboard shown

Change-Id: I763838fb7b887e09b46b1fb2360a515b77de8dd4
2020-08-22 00:33:46 +08:00
Artur Satayev
bc3d8b9071 Use new UnsupportedAppUsage annotation.
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
Merged-In: I534e3fd1305e2f4af076986770033478448a665c
2020-01-13 12:39:59 +00:00
Artur Satayev
afdb23ab6f Use new UnsupportedAppUsage annotation.
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
2019-12-18 20:44:45 +00:00
Beverly
85dfc2e225 Ringer toggle always affects system sounds
Background:
- When DND is on, users can allow "touch sounds" (system sounds) to bypass DND
- The user-visible ringer stream and toggle controls notification,
ringer, and system sounds

Previously, allowing system sounds to bypass DND overrode the ringer
from affecting the system sound stream which made the volume
functionality of touch sounds different from in/out of DND.

This fix ensures that DND always respects the fact that the ringer toggle and stream
controls notifications, ringer, and system sounds at all times (whether in/out of DND).

Test: atest ZenModeHelperTest
Test: atest ZenModeConfigTest
Test: atest AudioManagerTest
Test: atest AudioManagerTest#testPriorityOnlySystemDisallowedWithRingerMuted
Test: atest AudioManagerTest#testPriorityOnlySystemAllowed
Fixes: 141292611
Change-Id: I6e36097f18a93ce554b3fad7e1a2bd1057ac9e1d
2019-09-27 20:06:11 +00:00
Jean-Michel Trivi
16ab948c01 SeekBarVolumizer: fix media volume initialization for VolumeGroup
The VolumeGroup callback was initializing the sliders by querying
  the VolumeGroup API, which talks to APM. In AVCRP with a
  BT headset that supports absolute volume, the APM only sees the
  media volume at max, as no digital attenuation is applied then,
  which causes the VolumeGroup API to report max volume.
The fix consists in using the updateSlider() method instead, which
  will cause the volume query to go through AudioService (which
  maintains the actual volume setting independently of the digital
  attenuation that is applied).

Bug: 132287865
Test: connect BT headset with abs volume, go to Settings > Sound

Change-Id: I3d46af69d808169806c86cb543440f262097965b
2019-05-20 15:41:44 -07:00
Hayden Gomes
ebd6aaa4b0 Replacing AudioVolumeGroups with List
Bug: 129262395
Test: Built and ran on device
Change-Id: I838296ead584b85be50028c410b9a2d0ba3b0398
2019-04-11 17:07:19 -07:00
Hayden Gomes
3c562e2474 Cleaning up SeekBarVolumizer
Bug: 129265140
Test: Built with make and ran on device
Change-Id: Ifcd9a24cd768249f1b6ec5ad7e2361bcacfb9a4d
2019-04-11 16:56:34 -07:00
Hayden Gomes
6d69bde308 Replacing AudioProductStrategies with List
- Removed AudioProductStrategies and updated usages to work with
List<AudioProductStrategy>
- ditributed looping logic to the respective callers

Test: built successfully with make and ran on device
Bug: 129265140
Change-Id: If95ba9c2418a1fda29590ca1af2d04e7395c2130
2019-04-11 16:56:34 -07:00
François Gaffie
59f209da32 Use Volume Group core callback in volume preference rather than intent
In order to prevent misalignement between hard-coded stream aliases,
this CL allows to use the Volume Group cb to update the SeekBarVolume.

The ultimate step would be to remove stream aliases from audioserver.

Bug: 124767636
Test: dumpsys media.audio_policy
Change-Id: Ide99e9dd97669e880d0d253102533c72070012a1
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2019-03-27 12:36:11 -07:00
TreeHugger Robot
91498b705c Merge "Revert "Disable preview on volume change" " 2019-03-26 18:19:26 +00:00
Beverly Tai
5808a8b30d Revert "Disable preview on volume change"
Fixes: 118534516
This reverts commit d7e9d35a44.

Reason for revert: Users can adjust volume from volume slice without preview sound, so re-enable preview sound in Settings > Sound 

Change-Id: I009d4a915a900e74bdcf14fb6dabad2e4a497a82
2019-03-26 14:14:05 +00:00
Andrei Onea
e30e3928f9 Add @UnsupportedAppUsage annotations
For packages:
  android.companion
  android.filterfw
  android.hardware.camera2.utils
  android.inputmethodservice
  android.net.nsd
  android.os
  android.preference
  android.security.keymaster
  android.service.dreams
  android.telecom
  android.telephony.ims.compat.feature
  android.telephony
  android.util
  android.view.accessibility
  android.media.effect

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: I9c2f8347952f3cc65759472b0e1a2717b285e44e
2019-03-21 14:04:57 +00:00
Siarhei Vishniakou
1e2c89087f Merge "Add Nullable annotation to getDecorView" am: a018254b45 am: b812cec859
am: 7f0cff2673

Change-Id: I7c607c47d057d08abf3c8dad30cf26a9dfba0caa
2019-03-13 09:49:57 -07:00
Siarhei Vishniakou
03887a9bed Merge "Add a null check for getWindow()" am: 3c69948e6a am: 71f52a6a0d
am: bee3e01c9b

Change-Id: Iee9698396354eb0e0cacff759cc0dcef621ff514
2019-03-08 06:13:49 -08:00
Siarhei Vishniakou
984d64d871 Add Nullable annotation to getDecorView
Since getDecorView may return null when dialog's window is no longer
present, annotate it as @Nullable.

Bug: 124327419
Test: none
Change-Id: I0d49b75b14f54cd8ba8304c900f6c8625f889aa8
2019-03-07 11:19:43 -08:00
Siarhei Vishniakou
d0de1cd170 Add a null check for getWindow()
Protect against crash surfaced by monkey, where it seems that the window
of the dialog is no longer present. If not present, don't need to post
dismiss runnable.

Bug: 124327419
Test: adb shell monkey -p com.google.android.GoogleCamera -s 999 -v 20000
Change-Id: Ic03b8501bb73725e04544fcb2397532be531988e
2019-03-06 11:07:22 -08:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
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
2019-02-28 23:29:04 -07:00
Beverly
1219670629 Users can change zen policy for system dnd rules
- Check consolidated zen policy in volume dialog, seek bar volumizer
and ZenModeControllerImpl instead of default notification policy
- Save ZenPolicy changes on restore

Test: atest ZenModeHelperTest
Test: atest ZenModeControllerImplTest
Bug: 111475013
Change-Id: I43b6dc8c6453739c50c874fe37415d425223d8c4
2018-12-21 10:57:54 -05:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Louis Pullen-Freilich
b9596fa128 Deprecates framework Preference classes
The AndroidX Preference Library is the recommended way to build settings
screens moving forward.

Bug: b/114357488
Test: n/a
Change-Id: I3b3bff2daf43d8239d8bf247a9c2acebbc6374eb
2018-11-19 18:58:44 +00:00
Mathew Inwood
45d2c252b1 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
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
2018-10-22 17:28:24 -07:00
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