148 Commits

Author SHA1 Message Date
Andy Hung
240d32c201 SoundPool: Clean up attribute pointer
Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Test: atest AudioManagerTest#testSoundEffects
Test: soundpool_stress
Bug: 223815163
Change-Id: Idb2dafb9ad53dc7ffa0005425ea630fa7b7e5102
2022-03-29 09:42:04 -07:00
Andy Hung
337cfcbe0a SoundPool: Clean up JNI weak reference handling
Remove unnecessary JNI params and overhead.
Use weak reference entirely on the native side.

Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Test: atest AudioManagerTest#testSoundEffects
Bug: 223815163
Change-Id: I31964b27ab3e8a96f49794e78537b165e9e84ed3
2022-03-24 10:36:52 -07:00
Andy Hung
0850300d63 SoundPool: Clean up JNI AudioAttribute handling
Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Test: atest AudioManagerTest#testSoundEffects
Bug: 223815163
Change-Id: I9a7b474408654ad65a3e2be0acf0b3add91c9fd1
2022-03-24 10:06:21 -07:00
Andy Hung
0a6c126796 SoundPool: Fix WeakRef lifetime
Ensure WeakRef lifetime is extended to duration of callback.

Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Test: atest AudioManagerTest#testSoundEffects
Bug: 223815163
Change-Id: I235ef32532d919823f1bbc4d7c90ec47311cc7ae
2022-03-24 10:02:19 -07:00
Andy Hung
48c0795054 SoundPool: Fix lifetime of SoundPool native object
Avoids race between release and Binder volume adjustment.

Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Test: atest AudioManagerTest#testSoundEffects
Bug: 223815163
Change-Id: Iac6ad878050ffc0cd1faa70abe11d3441ea34d8e
2022-03-24 09:30:46 -07:00
Atneya Nair
81fb57f59b Update Soundpool callback interface
Update Soundpool to utilize new AudioTrack callback interface which
takes a sp<> to an interface object.

Test: build_and_run.sh takes 10232s
Bug: 199156212
Change-Id: I422331f81afdd0e8c8e357d1f15dcea4ae4b3d04
2022-03-01 13:25:30 -05:00
Andy Hung
cba3b71632 Merge "SoundPool: Clean up Stream::play_l logic for garbage collection" am: 3c44833a91 am: c69cfc5a7c am: e434fc68e4 am: 95292b064a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922978

Change-Id: I8daee4a9ccc93ce9c6452de601da9a7553d1ac60
2022-01-11 19:48:03 +00:00
Andy Hung
71791c0e0c SoundPool: Clean up Stream::play_l logic for garbage collection
Test: soundpool_stress
Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Bug: 210682934
Change-Id: Ief7ff8415861570c0f2f817bfae7e88948d810c0
2021-12-15 19:40:10 -08:00
Andy Hung
d17933a7ea Merge "SoundPool: Implement generic garbage collection" am: 361e9e1da9 am: 135ebfe059 am: e6c9a5de4b am: 01a98143e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1905392

Change-Id: Idf613d196626c11fbbe75e5f4ca75c97b576cb43
2021-12-14 19:49:38 +00:00
Andy Hung
361e9e1da9 Merge "SoundPool: Implement generic garbage collection" 2021-12-14 18:34:51 +00:00
Andy Hung
bd670a28fa Merge "SoundPool: Update queue only if streamID matches" am: f0f20c17e0 am: 27383c906c am: e9b9317232 am: 713e259dd5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1905390

Change-Id: Ib4eb5416d231200c783ff2f2b09d856b4355d7fc
2021-12-10 19:35:51 +00:00
Andy Hung
151117ec0b SoundPool: Update queue only if streamID matches
SoundPool API commands are based on an atomic
compare-StreamID if match then operate (see compare-exchange).

Test: soundpool_stress
Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Bug: 201233890
Bug: 201262390
Change-Id: I63cc07d581a0ac1d5440852bfe0c75edc9d73e75
2021-12-09 10:03:26 -08:00
Andy Hung
4474c3f82c SoundPool: Implement generic garbage collection
Move audio tracks to a gc mechanism for release outside of lock.

Test: soundpool_stress
Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Bug: 203193643
Change-Id: I5babd4f3fa73cca25579fde2194123bf62cf53b4
2021-12-02 11:32:28 -08:00
Ray Essick
980f66ea59 Guard against negative sizes from codec
Protect against a negative codec buffer sizes. Avoids casting a negative
size to a very large size.

Bug: 193904641
Test: soundpool invocations during boot
Change-Id: If0e71537ca6301344df1f2f1493ed6b81bbed1f3
2021-09-24 12:55:35 -07:00
Andy Hung
8558709c73 Audio: Support FCC_LIMIT for 22.2 testing
Rename from FCC_8.

Test: SoundPool(Aac|Haptic|Midi|Ogg)Test
Bug: 189325443
Change-Id: I6c83d4bc2cbf4aaf72ac4648bbebaceaf9bb06a9
2021-06-08 11:15:36 -07:00
Svet Ganov
2eebf92965 Switch media fw permissions checks to AttributionSource
Attribution source is the abstraction to capture the data
flows for private data across apps. Checking permissions
for an attribution source does this for all apps in the
chain that would receive the data as well as the relevant
app ops are checked/noted/started as needed.

Teach speech recognition service about attribution
chains. If an implementation does nothing the OS
would enforce permisisons and do blame as always.
This apporach leads to double blaming and doesn't
support attribition chains where app calls into
the default recognizer which calls into the on
device recognizer (this nests recursively). If the
implementer takes advantage of the attribution chain
mechanims the permissions for the entire chain are
checked at mic access time and all apps are blamed
only once.

Fixed a few bugs around finishing ops for attribution
chains. Also ensured that any app death in a started
attribution chain would lead to finishing the op for
this app

bug: 158792096

Test: (added tests for speech reco)
      atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases
      atest CtsAppOpsTestCases
      atest CtsAppOps2TestCases

Merged-In: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4

Change-Id: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4
2021-06-01 23:43:29 +00:00
Andy Hung
0821db29bf SoundPool: Avoid busy waiting during stream restart
A stream on the restart queue can cause the StreamManager to
busy-wait.  This was introduced by a fix
commit ba04dbe7732bc2d016bf81c81bd349d931de63f2.

Test: Verbose log on StreamManager.cpp, run SoundPool CTS tests.
Bug: 182923919
Change-Id: Iae794bc957869426a4e1e27cd3c088aa9dd83208
2021-03-16 12:13:35 -07:00
Andy Hung
fe4d13843a SoundPool: Improve single stream SoundPool handling
By design, the StreamManager ramps down volume
on a Stream stop to prevent pops and glitches.
When the SoundPool is configured only with a single stream,
there may be a short period of unavailability of that stream
while stop is called by the worker thread; an immediate
play after a stop may return 0 (failure).

To allow immediate play after stop for a *single* Stream configured
SoundPool, we lock the StreamManager worker thread so that the
stop call is processed and the stream is visible to the client for use.

We prefer not to keep this lock for the multiple Stream case as it
prevents concurrent initiation of sounds from multiple StreamManager
worker threads and such blocking is not appropriate for games.

Test: SoundPoolAacTest SoundPoolHapticTest
Test: SoundPoolMidiTest SoundPoolOggTest
Bug: 175097719
Bug: 177287876
Change-Id: Iec777d6319d5ed76000d4c5b12336b106dacede4
2021-03-15 11:50:06 -07:00
Andy Hung
7ced2d7c87 Merge "SoundPool: Fix clang-tidy" am: c337968e03 am: fa59a51450 am: efb2d5bdfe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625766

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie8b37b13c7138734741334407125dc3f7b6c0030
2021-03-12 19:33:25 +00:00
Andy Hung
a5daa17187 SoundPool: Fix clang-tidy
Test: touch *.cpp,  mma, verify no clang-tidy warnings
Test: SoundPoolAacTest, SoundPoolHapticTest,
Test: SoundPoolMidiTest, SoundPoolOggTest
Bug: 182414042
Change-Id: I77af4f0999c46931d6993d917443df1fa8425353
2021-03-11 15:24:59 -08:00
Philip P. Moltmann
fece2436d4 Add attributionTag to audio-recordings
... by switching from packageName/uid/pid to the Identity class.

This allows up to track which parts of the app trigger audio-recordings.

Test: atest CtsAppOpsTestCases
            CtsNativeMediaAAudioTestCases
Fixes: 160150145
Change-Id: I0913a336a862e4a1cb38b9d967cfbdc490513ab0
2021-03-11 08:40:40 -08:00
Chih-hung Hsieh
d82f6409a2 Merge "Do not add quotes around flags argument" am: af4f8b9510
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1598500

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3f053a9b5419dc9422720dca4577615538ece2a4
2021-02-23 23:56:12 +00:00
Chih-Hung Hsieh
c8d81cf67a Do not add quotes around flags argument
* build/soong will adds quotes around the whole flags
  and preserve the quotes around flags argument.
  The quotes incorrectly became part of a flag's value.
* build/soong adds automatically module directory to
  -header-filter.
* allow new found .h file clang-tidy warnings, not as errors.

Bug: 180862582
Test: make; make with WITH_TIDY=1
Change-Id: I460d56284a843ad5e85a36c47fc3981f49d04f4a
2021-02-21 18:46:52 -08:00
Xin Li
be473bf819 Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4bf82035631ccff6d5a6144d6d9b1d203b076851
Change-Id: I1b5f3a672a55eaabba0f5389bab110b395553559
2021-02-21 09:39:53 -08:00
Bob Badour
051ef786ac [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  apct-tests/perftests/autofill/Android.bp
  apct-tests/perftests/blobstore/Android.bp
  apct-tests/perftests/core/Android.bp
  apct-tests/perftests/core/apps/overlay/Android.bp
  apct-tests/perftests/core/apps/reources_manager/Android.bp
  apct-tests/perftests/core/jni/Android.bp
  apct-tests/perftests/multiuser/Android.bp
  apct-tests/perftests/multiuser/apps/dummyapp/Android.bp
  apct-tests/perftests/packagemanager/Android.bp
  apct-tests/perftests/packagemanager/apps/query-all/Android.bp
  apct-tests/perftests/textclassifier/Android.bp
  apct-tests/perftests/utils/Android.bp
  apct-tests/perftests/windowmanager/Android.bp
  apex/Android.bp
  apex/blobstore/framework/Android.bp
  apex/blobstore/service/Android.bp
  apex/jobscheduler/framework/Android.bp
  apex/jobscheduler/service/Android.bp
  apex/media/Android.bp
  apex/media/aidl/Android.bp
  apex/media/framework/Android.bp
  cmds/am/Android.bp
  cmds/app_process/Android.bp
  cmds/appops/Android.bp
  cmds/appwidget/Android.bp
  cmds/backup/Android.bp
  cmds/bmgr/Android.bp
  cmds/bootanimation/Android.bp
  cmds/bu/Android.bp
  cmds/content/Android.bp
  cmds/dpm/Android.bp
  cmds/hid/Android.bp
  cmds/hid/jni/Android.bp
  cmds/idmap2/Android.bp
  cmds/ime/Android.bp
  cmds/incident/Android.bp
  cmds/incident_helper/Android.bp
  cmds/incidentd/Android.bp
  cmds/input/Android.bp
  cmds/interrupter/Android.bp
  cmds/locksettings/Android.bp
  cmds/pm/Android.bp
  cmds/requestsync/Android.bp
  cmds/screencap/Android.bp
  cmds/sm/Android.bp
  cmds/svc/Android.bp
  cmds/telecom/Android.bp
  cmds/uiautomator/Android.bp
  cmds/uiautomator/cmds/uiautomator/Android.bp
  cmds/uiautomator/instrumentation/Android.bp
  cmds/uiautomator/library/Android.bp
  cmds/vr/Android.bp
  cmds/wm/Android.bp
  config/Android.bp
  core/java/android/service/wallpaper/Android.bp
  core/jni/Android.bp
  core/sysprop/Android.bp
  core/tests/BroadcastRadioTests/Android.bp
  core/tests/ConnectivityManagerTest/Android.bp
  core/tests/PackageInstallerSessions/Android.bp
  core/tests/PlatformCompatFramework/Android.bp
  core/tests/bandwidthtests/Android.bp
  core/tests/benchmarks/Android.bp
  core/tests/bluetoothtests/Android.bp
  core/tests/bugreports/Android.bp
  core/tests/coretests/Android.bp
  core/tests/coretests/BinderDeathRecipientHelperApp/Android.bp
  core/tests/coretests/BinderProxyCountingTestApp/Android.bp
  core/tests/coretests/BinderProxyCountingTestService/Android.bp
  core/tests/coretests/BstatsTestApp/Android.bp
  core/tests/coretests/DisabledTestApp/Android.bp
  core/tests/coretests/EnabledTestApp/Android.bp
  core/tests/coretests/aidl/Android.bp
  core/tests/coretests/apks/Android.bp
  core/tests/coretests/apks/install/Android.bp
  core/tests/coretests/apks/install_bad_dex/Android.bp
  core/tests/coretests/apks/install_complete_package_info/Android.bp
  core/tests/coretests/apks/install_decl_perm/Android.bp
  core/tests/coretests/apks/install_jni_lib/Android.bp
  core/tests/coretests/apks/install_jni_lib_open_from_apk/Android.bp
  core/tests/coretests/apks/install_loc_auto/Android.bp
  core/tests/coretests/apks/install_loc_internal/Android.bp
  core/tests/coretests/apks/install_loc_sdcard/Android.bp
  core/tests/coretests/apks/install_loc_unspecified/Android.bp
  core/tests/coretests/apks/install_use_perm_good/Android.bp
  core/tests/coretests/apks/install_uses_feature/Android.bp
  core/tests/coretests/apks/install_verifier_bad/Android.bp
  core/tests/coretests/apks/install_verifier_good/Android.bp
  core/tests/coretests/apks/keyset/Android.bp
  core/tests/coretests/apks/locales/Android.bp
  core/tests/coretests/apks/overlay_config/Android.bp
  core/tests/coretests/apks/version/Android.bp
  core/tests/coretests/apks/version_nosys/Android.bp
  core/tests/featureflagtests/Android.bp
  core/tests/hdmitests/Android.bp
  core/tests/hosttests/test-apps/AutoLocTestApp/Android.bp
  core/tests/hosttests/test-apps/AutoLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/AutoLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/ExternalLocAllPermsTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocPermsFLTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/ExternalLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPerms/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.bp
  core/tests/hosttests/test-apps/InternalLocTestApp/Android.bp
  core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests/Android.bp
  core/tests/hosttests/test-apps/NoLocTestApp/Android.bp
  core/tests/hosttests/test-apps/NoLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/NoLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/SharedUid/32/Android.bp
  core/tests/hosttests/test-apps/SharedUid/32/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/64/Android.bp
  core/tests/hosttests/test-apps/SharedUid/64/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/dual/Android.bp
  core/tests/hosttests/test-apps/SharedUid/dual/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/java_only/Android.bp
  core/tests/hosttests/test-apps/SimpleTestApp/Android.bp
  core/tests/hosttests/test-apps/UpdateExtToIntLocTestApp_v1_ext/Android.bp
  core/tests/hosttests/test-apps/UpdateExtToIntLocTestApp_v2_int/Android.bp
  core/tests/hosttests/test-apps/UpdateExternalLocTestApp_v1_ext/Android.bp
  core/tests/hosttests/test-apps/UpdateExternalLocTestApp_v2_none/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_Auto/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_External/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_Internal/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_None/Android.bp
  core/tests/mockingcoretests/Android.bp
  core/tests/notificationtests/Android.bp
  core/tests/overlaytests/device/Android.bp
  core/tests/overlaytests/device/test-apps/AppOverlayOne/Android.bp
  core/tests/overlaytests/device/test-apps/AppOverlayTwo/Android.bp
  core/tests/overlaytests/device/test-apps/FrameworkOverlay/Android.bp
  core/tests/overlaytests/host/Android.bp
  core/tests/overlaytests/remount/Android.bp
  core/tests/overlaytests/remount/test-apps/Overlay/Android.bp
  core/tests/overlaytests/remount/test-apps/SharedLibrary/Android.bp
  core/tests/overlaytests/remount/test-apps/SharedLibraryOverlay/Android.bp
  core/tests/overlaytests/remount/test-apps/Target/Android.bp
  core/tests/packagemanagertests/Android.bp
  core/tests/privacytests/Android.bp
  core/tests/screenshothelpertests/Android.bp
  core/tests/systemproperties/Android.bp
  core/tests/utillib/Android.bp
  core/tests/utiltests/Android.bp
  core/tests/utiltests/jni/Android.bp
  core/tests/uwbtests/Android.bp
  core/xsd/Android.bp
  core/xsd/vts/Android.bp
  data/etc/Android.bp
  data/etc/car/Android.bp
  data/fonts/Android.bp
  data/keyboards/Android.mk
  drm/jni/Android.bp
  errorprone/Android.bp
  graphics/proto/Android.bp
  keystore/Android.bp
  keystore/tests/Android.bp
  libs/WindowManager/Jetpack/Android.bp
  libs/WindowManager/Shell/Android.bp
  libs/WindowManager/Shell/tests/Android.bp
  libs/androidfw/Android.bp
  libs/androidfw/fuzz/resourcefile_fuzzer/Android.bp
  libs/hostgraphics/Android.bp
  libs/incident/Android.bp
  libs/input/Android.bp
  libs/input/tests/Android.bp
  libs/protoutil/Android.bp
  libs/services/Android.bp
  libs/storage/Android.bp
  libs/usb/tests/AccessoryChat/Android.bp
  libs/usb/tests/AccessoryChat/accessorychat/Android.bp
  location/lib/Android.bp
  location/tests/Android.bp
  location/tests/locationtests/Android.bp
  lowpan/tests/Android.bp
  media/Android.bp
  media/java/Android.bp
  media/java/android/media/tv/tunerresourcemanager/Android.bp
  media/jni/Android.bp
  media/jni/audioeffect/Android.bp
  media/jni/soundpool/Android.bp
  media/jni/soundpool/tests/Android.bp
  media/lib/remotedisplay/Android.bp
  media/lib/signer/Android.bp
  media/lib/tvremote/Android.bp
  media/lib/tvremote/tests/Android.bp
  media/mca/filterfw/Android.bp
  media/mca/filterfw/native/Android.bp
  media/mca/filterpacks/Android.bp
  media/mca/samples/CameraEffectsRecordingSample/Android.bp
  media/mca/tests/Android.bp
  media/native/midi/Android.bp
  media/packages/BluetoothMidiService/Android.bp
  media/packages/BluetoothMidiService/tests/unit/Android.bp
  media/tests/AudioPolicyTest/Android.bp
  media/tests/CameraBrowser/Android.bp
  media/tests/EffectsTest/Android.bp
  media/tests/MediaDump/Android.bp
  media/tests/MediaFrameworkTest/Android.bp
  media/tests/MediaRouter/Android.bp
  media/tests/MtpTests/Android.bp
  media/tests/ScoAudioTest/Android.bp
  media/tests/SoundPoolTest/Android.bp
  media/tests/TunerTest/Android.bp
  media/tests/audiotests/Android.bp
  media/tests/players/Android.bp
  mime/Android.bp
  native/android/Android.bp
  native/graphics/jni/Android.bp
  native/webview/loader/Android.bp
  nfc-extras/Android.bp
  nfc-extras/tests/Android.bp
  packages/AppPredictionLib/Android.bp
  packages/BackupEncryption/Android.bp
  packages/BackupEncryption/test/robolectric-integration/Android.bp
  packages/BackupEncryption/test/robolectric/Android.bp
  packages/BackupEncryption/test/unittest/Android.bp
  packages/BackupRestoreConfirmation/Android.bp
  packages/CarSystemUI/Android.bp
  packages/CarrierDefaultApp/Android.bp
  packages/CarrierDefaultApp/tests/unit/Android.bp
  packages/CompanionDeviceManager/Android.bp
  packages/Connectivity/framework/Android.bp
  packages/Connectivity/service/Android.bp
  packages/CtsShim/Android.bp
  packages/CtsShim/build/Android.bp
  packages/CtsShim/build/jni/Android.bp
  packages/DynamicSystemInstallationService/Android.bp
  packages/DynamicSystemInstallationService/tests/Android.bp
  packages/EasterEgg/Android.bp
  packages/EncryptedLocalTransport/Android.bp
  packages/ExtShared/Android.bp
  packages/ExternalStorageProvider/Android.bp
  packages/ExternalStorageProvider/tests/Android.bp
  packages/FakeOemFeatures/Android.bp
  packages/FusedLocation/Android.bp
  packages/InputDevices/Android.bp
  packages/LocalTransport/Android.bp
  packages/PackageInstaller/Android.bp
  packages/PrintRecommendationService/Android.bp
  packages/PrintSpooler/Android.bp
  packages/PrintSpooler/jni/Android.bp
  packages/PrintSpooler/tests/outofprocess/Android.bp
  packages/SettingsLib/ActionBarShadow/Android.bp
  packages/SettingsLib/ActionButtonsPreference/Android.bp
  packages/SettingsLib/AdaptiveIcon/Android.bp
  packages/SettingsLib/Android.bp
  packages/SettingsLib/AppPreference/Android.bp
  packages/SettingsLib/BarChartPreference/Android.bp
  packages/SettingsLib/DisplayDensityUtils/Android.bp
  packages/SettingsLib/EntityHeaderWidgets/Android.bp
  packages/SettingsLib/HelpUtils/Android.bp
  packages/SettingsLib/LayoutPreference/Android.bp
  packages/SettingsLib/ProgressBar/Android.bp
  packages/SettingsLib/RadioButtonPreference/Android.bp
  packages/SettingsLib/RestrictedLockUtils/Android.bp
  packages/SettingsLib/SchedulesProvider/Android.bp
  packages/SettingsLib/SearchProvider/Android.bp
  packages/SettingsLib/SearchWidget/Android.bp
  packages/SettingsLib/SettingsSpinner/Android.bp
  packages/SettingsLib/SettingsTheme/Android.bp
  packages/SettingsLib/Tile/Android.bp
  packages/SettingsLib/Utils/Android.bp
  packages/SettingsLib/search/Android.bp
  packages/SettingsLib/tests/integ/Android.bp
  packages/SettingsLib/tests/robotests/Android.bp
  packages/SettingsProvider/Android.bp
  packages/SharedStorageBackup/Android.bp
  packages/Shell/Android.bp
  packages/Shell/tests/Android.bp
  packages/SimAppDialog/Android.bp
  packages/SoundPicker/Android.bp
  packages/StatementService/Android.bp
  packages/SystemUI/Android.bp
  packages/SystemUI/plugin/Android.bp
  packages/SystemUI/plugin/ExamplePlugin/Android.bp
  packages/SystemUI/plugin_core/Android.bp
  packages/SystemUI/shared/Android.bp
  packages/VpnDialogs/Android.bp
  packages/WAPPushManager/Android.bp
  packages/WAPPushManager/tests/Android.bp
  packages/WallpaperBackup/Android.bp
  packages/WallpaperCropper/Android.bp
  packages/overlays/Android.mk
  packages/overlays/tests/Android.bp
  packages/services/PacProcessor/Android.bp
  packages/services/PacProcessor/jni/Android.bp
  packages/services/Proxy/Android.bp
  proto/Android.bp
  rs/jni/Android.mk
  samples/demo/haptic-assessment/Android.bp
  sax/tests/saxtests/Android.bp
  services/Android.bp
  services/accessibility/Android.bp
  services/appprediction/Android.bp
  services/appwidget/Android.bp
  services/autofill/Android.bp
  services/backup/Android.bp
  services/backup/backuplib/Android.bp
  services/companion/Android.bp
  services/contentcapture/Android.bp
  services/contentsuggestions/Android.bp
  services/core/Android.bp
  services/core/java/com/android/server/vcn/Android.bp
  services/core/jni/Android.bp
  services/core/xsd/Android.bp
  services/core/xsd/vts/Android.bp
  services/coverage/Android.bp
  services/devicepolicy/Android.bp
  services/incremental/Android.bp
  services/midi/Android.bp
  services/net/Android.bp
  services/people/Android.bp
  services/print/Android.bp
  services/profcollect/Android.bp
  services/restrictions/Android.bp
  services/robotests/Android.bp
  services/robotests/backup/Android.bp
  services/systemcaptions/Android.bp
  services/tests/PackageManagerComponentOverrideTests/Android.bp
  services/tests/PackageManagerServiceTests/host/Android.bp
  services/tests/PackageManagerServiceTests/host/test-apps/Android.bp
  services/tests/mockingservicestests/Android.bp
  services/tests/rescueparty/Android.bp
  services/tests/servicestests/Android.bp
  services/tests/servicestests/aidl/Android.bp
  services/tests/servicestests/apks/Android.bp
  services/tests/servicestests/apks/install-split-base/Android.bp
  services/tests/servicestests/apks/install-split-feature-a/Android.bp
  services/tests/servicestests/apks/install_intent_filters/Android.bp
  services/tests/servicestests/apks/install_uses_sdk/Android.bp
  services/tests/servicestests/test-apps/ConnTestApp/Android.bp
  services/tests/servicestests/test-apps/JobTestApp/Android.bp
  services/tests/servicestests/test-apps/PackageParserApp/Android.bp
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  services/tests/servicestests/test-apps/SimpleServiceTestApp/Android.bp
  services/tests/servicestests/test-apps/SuspendTestApp/Android.bp
  services/tests/shortcutmanagerutils/Android.bp
  services/tests/uiservicestests/Android.bp
  services/tests/wmtests/Android.bp
  services/usage/Android.bp
  services/usb/Android.bp
  services/voiceinteraction/Android.bp
  services/wifi/Android.bp
  startop/apps/test/Android.bp
  startop/iorap/Android.bp
  startop/iorap/functional_tests/Android.bp
  startop/iorap/stress/Android.bp
  startop/iorap/tests/Android.bp
  startop/view_compiler/Android.bp
  startop/view_compiler/dex_builder_test/Android.bp
  test-base/hiddenapi/Android.bp
  test-mock/Android.bp
  test-runner/tests/Android.bp
  tests/AccessibilityEventsLogger/Android.bp
  tests/AccessoryDisplay/common/Android.bp
  tests/AccessoryDisplay/sink/Android.bp
  tests/AccessoryDisplay/source/Android.bp
  tests/ActivityManagerPerfTests/stub-app/Android.bp
  tests/ActivityManagerPerfTests/test-app/Android.bp
  tests/ActivityManagerPerfTests/tests/Android.bp
  tests/ActivityManagerPerfTests/utils/Android.bp
  tests/ActivityTests/Android.bp
  tests/ActivityViewTest/Android.bp
  tests/AmSlam/Android.bp
  tests/ApkVerityTest/Android.bp
  tests/ApkVerityTest/ApkVerityTestApp/Android.bp
  tests/ApkVerityTest/block_device_writer/Android.bp
  tests/AppLaunch/Android.bp
  tests/AppLaunchWear/Android.bp
  tests/AppResourcesLoaders/Android.bp
  tests/AppResourcesLoaders/Overlay/Android.bp
  tests/Assist/Android.bp
  tests/AutoVerify/app1/Android.bp
  tests/AutoVerify/app2/Android.bp
  tests/AutoVerify/app3/Android.bp
  tests/AutoVerify/app4/Android.bp
  tests/BackgroundDexOptServiceIntegrationTests/Android.bp
  tests/BandwidthTests/Android.bp
  tests/BatteryWaster/Android.bp
  tests/BiDiTests/Android.bp
  tests/BlobStoreTestUtils/Android.bp
  tests/BootImageProfileTest/Android.bp
  tests/BrowserPowerTest/Android.bp
  tests/Camera2Tests/SmartCamera/SimpleCamera/jni/Android.bp
  tests/CameraPrewarmTest/Android.bp
  tests/Codegen/Android.bp
  tests/Compatibility/Android.bp
  tests/CoreTests/android/Android.bp
  tests/DataIdleTest/Android.bp
  tests/DozeTest/Android.bp
  tests/DpiTest/Android.bp
  tests/DynamicCodeLoggerIntegrationTests/Android.mk
  tests/FeatureSplit/base/Android.bp
  tests/FeatureSplit/feature1/Android.bp
  tests/FeatureSplit/feature2/Android.bp
  tests/FixVibrateSetting/Android.bp
  tests/FlickerTests/Android.bp
  tests/FlickerTests/test-apps/Android.bp
  tests/FlickerTests/test-apps/flickerapp/Android.bp
  tests/FrameworkPerf/Android.bp
  tests/GamePerformance/Android.bp
  tests/GridLayoutTest/Android.bp
  tests/HierarchyViewerTest/Android.bp
  tests/HugeBackup/Android.bp
  tests/HwAccelerationTest/Android.bp
  tests/Internal/Android.bp
  tests/JankBench/Android.bp
  tests/JobSchedulerPerfTests/Android.bp
  tests/JobSchedulerTestApp/Android.bp
  tests/LargeAssetTest/Android.bp
  tests/LegacyAssistant/Android.bp
  tests/LocalizationTest/Android.bp
  tests/LocationTracker/Android.bp
  tests/LotsOfApps/Android.bp
  tests/LowStorageTest/Android.bp
  tests/ManagedProfileLifecycleStressTest/Android.bp
  tests/ManagedProfileLifecycleStressTest/app/DummyDPC/Android.bp
  tests/MemoryUsage/Android.bp
  tests/MirrorSurfaceTest/Android.bp
  tests/NativeProcessesMemoryTest/Android.bp
  tests/NetworkSecurityConfigTest/Android.bp
  tests/NullHomeTest/Android.bp
  tests/OdmApps/Android.bp
  tests/OdmApps/app/Android.bp
  tests/OdmApps/priv-app/Android.bp
  tests/OneMedia/Android.bp
  tests/PackageWatchdog/Android.bp
  tests/PlatformCompatGating/Android.bp
  tests/PlatformCompatGating/test-rules/Android.bp
  tests/ProtoInputStreamTests/Android.bp
  tests/RemoteDisplayProvider/Android.bp
  tests/RenderThreadTest/Android.bp
  tests/RollbackTest/Android.bp
  tests/SerialChat/Android.bp
  tests/ServiceCrashTest/Android.bp
  tests/SharedLibrary/client/Android.bp
  tests/SharedLibrary/lib/Android.bp
  tests/ShowWhenLockedApp/Android.bp
  tests/SmokeTest/Android.bp
  tests/SmokeTest/tests/Android.bp
  tests/SmokeTestApps/Android.bp
  tests/SoundTriggerTestApp/Android.bp
  tests/Split/Android.bp
  tests/StagedInstallTest/Android.bp
  tests/StatusBar/Android.bp
  tests/SurfaceComposition/Android.bp
  tests/SurfaceControlViewHostTest/Android.bp
  tests/SystemMemoryTest/device/Android.bp
  tests/SystemMemoryTest/host/Android.bp
  tests/SystemUIDemoModeController/Android.bp
  tests/TaskOrganizerTest/Android.bp
  tests/TelephonyCommonTests/Android.bp
  tests/TouchLatency/Android.bp
  tests/TransformTest/Android.bp
  tests/TtsTests/Android.bp
  tests/UiBench/Android.bp
  tests/UsageReportingTest/Android.bp
  tests/UsageStatsPerfTests/Android.bp
  tests/UsageStatsTest/Android.bp
  tests/UsbHostExternalManagmentTest/AoapTestDevice/Android.bp
  tests/UsbHostExternalManagmentTest/AoapTestHost/Android.bp
  tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/Android.bp
  tests/UsbManagerTests/Android.bp
  tests/UsbManagerTests/lib/Android.bp
  tests/UsbTests/Android.bp
  tests/UsesFeature2Test/Android.bp
  tests/VectorDrawableTest/Android.bp
  tests/VoiceEnrollment/Android.bp
  tests/VoiceInteraction/Android.bp
  tests/WallpaperTest/Android.bp
  tests/WindowAnimationJank/Android.bp
  tests/WindowInsetsTests/Android.bp
  tests/appwidgets/AppWidgetHostTest/Android.bp
  tests/appwidgets/AppWidgetProviderTest/Android.bp
  tests/backup/Android.mk
  tests/benchmarks/Android.bp
  tests/libs-permissions/Android.bp
  tests/net/Android.bp
  tests/net/common/Android.bp
  tests/net/deflake/Android.bp
  tests/net/integration/Android.bp
  tests/net/jni/Android.bp
  tests/net/smoketest/Android.bp
  tests/notification/Android.bp
  tests/permission/Android.bp
  tests/privapp-permissions/Android.bp
  tests/testables/Android.bp
  tests/testables/tests/Android.bp
  tests/utils/StubIME/Android.bp
  tests/utils/hostutils/Android.bp
  tests/utils/testutils/Android.bp
  tests/vcn/Android.bp
  tools/aapt/Android.bp
  tools/aapt2/Android.bp
  tools/aapt2/integration-tests/AutoVersionTest/Android.bp
  tools/aapt2/integration-tests/BasicTest/Android.bp
  tools/aapt2/integration-tests/MergeOnlyTest/LeafLib/Android.mk
  tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/LibOne/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/LibTwo/Android.mk
  tools/aapt2/integration-tests/StaticLibTest/App/Android.bp
  tools/aapt2/integration-tests/StaticLibTest/LibOne/Android.bp
  tools/aapt2/integration-tests/StaticLibTest/LibTwo/Android.bp
  tools/aapt2/integration-tests/SymlinkTest/Android.bp
  tools/bit/Android.bp
  tools/codegen/Android.bp
  tools/dump-coverage/Android.bp
  tools/incident_report/Android.bp
  tools/incident_section_gen/Android.bp
  tools/lock_agent/Android.bp
  tools/locked_region_code_injection/Android.bp
  tools/obbtool/Android.bp
  tools/powermodel/Android.bp
  tools/preload-check/Android.bp
  tools/preload-check/device/Android.bp
  tools/preload/loadclass/Android.bp
  tools/processors/staledataclass/Android.bp
  tools/processors/view_inspector/Android.bp
  tools/protologtool/Android.bp
  tools/sdkparcelables/Android.bp
  tools/split-select/Android.bp
  tools/streaming_proto/Android.bp
  tools/validatekeymaps/Android.bp
  wifi/java/Android.bp
  wifi/tests/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  libs/hwui/Android.bp
  native/webview/plat_support/Android.bp
  obex/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-CPL-1.0
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-MIT SPDX-license-identifier-Unicode-DFS
    SPDX-license-identifier-W3C legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    legacy_unencumbered
to:
  core/java/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-CPL-1.0
to:
  test-base/Android.bp
  test-runner/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL
to:
  core/res/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL-2.0
to:
  libs/usb/Android.bp
  libs/usb/tests/accessorytest/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  tools/preload/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
    SPDX-license-identifier-Unicode-DFS
to:
  api/Android.bp
  boot/Android.bp
  cmds/device_config/Android.bp
  cmds/settings/Android.bp
  core/api/Android.bp
  core/tests/coretests/certs/Android.bp
  core/tests/overlaytests/remount/test-apps/certs/Android.bp
  core/tests/overlaytests/remount/test-apps/overlaid_apex/Android.bp
  core/tests/overlaytests/remount/test-apps/overlay_apex/Android.bp
  libs/tracingproxy/Android.bp
  services/startop/Android.bp
  test-legacy/Android.mk
  tests/ApkVerityTest/testdata/Android.bp
  tests/TransitionTests/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ic44d662936d1ff0cae7fbe915932b37aa4e4869a
Merged-in: I6e9103c3275cb2e6df5dc586588eccd7d2ab6b06
2021-02-16 04:09:57 -08:00
jiabin
181d26b7e5 Add package name when initializing SoundPool.
The package name is useful for permission validation. Currently, package
name is required when starting external vibration so that the vibrator
service can verify if the app has the permission to start vibration.

Bug: 175595599
Test: SoundPool tests in cts
Test: play audio-coupled-haptic file using SoundPool.
Change-Id: Ibfe414063a303118a5bb393d65ea5dc2323bf722
Merged-In: Ibfe414063a303118a5bb393d65ea5dc2323bf722
(cherry picked from commit de9005bab1751e23342bbc9f0f51213eea8885af)
2020-12-18 07:23:04 +00:00
Mikhail Naganov
8c845dca4a Convert mask types from uint32_t to enum type
This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I7f32a7c7741dea88fa2fd8a2e7fe50d0c31eb2e7
Merged-In: I7f32a7c7741dea88fa2fd8a2e7fe50d0c31eb2e7
2020-11-24 23:13:08 +00:00
Orion Hodson
864d304156 Update to use nativehelper/JNIPlatformHelp.h
Reflects refactoring of JNI helper code that depends on private
methods within libnativehelper.

Bug: 151443957
Test: Treehugger
Change-Id: I7af128f42ae89a77a8e3fb113ea533331153c535
Merged-In: I7af128f42ae89a77a8e3fb113ea533331153c535
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit 329c612e3d5ae440bf13e1f5fc9a4012263524e9)
2020-06-24 12:46:47 +00:00
Andy Hung
09e865b694 SoundPool: fix fcntl argument
Fixes flakiness introduced by commit 77eb2bda0e5758b7c350db2991d6fc5806680b57

Test: android.media.cts.SoundPoolAacTest
Test: android.media.cts.SoundPoolHapticTest
Test: android.media.cts.SoundPoolMidiTest
Test: android.media.cts.SoundPoolOggTest
Test: android.media.cts.AudioManagerTest#testSoundEffects
Bug: 157924783
Change-Id: I8371c93337852424e2b47a17e5a19a1caaf2600f
2020-06-01 16:38:26 -07:00
Andy Hung
ce8e6daa9a SoundPool: Fix verbose logging compilation
Make compatible with clang warning / thread safety.

Test: build verbose and logcat
Bug: 157618660
Change-Id: I773f446561b86a0f3a8b5ddc355cfe6adf0d4294
2020-06-01 09:51:46 -07:00
Andy Hung
77eb2bda0e SoundPool: Add clang-tidy and fix
Test: soundpool_stress
Test: SoundPoolAacTest
Test: SoundPoolHapticTest
Test: SoundPoolMidiTest
Test: SoundPoolOggTest
Bug: 157501605
Change-Id: I7bba857a8b44b6255d423086127da0e2df4ce1c4
2020-05-27 10:47:41 -07:00
Andy Hung
ac5c3e6f37 MediaMetrics: Track AudioTrack and AudioRecord callers
Test: adb shell dumpsys media.metrics
Bug: 149850236
Change-Id: Ib8e14e8b3dbb6284e301483dee5306f014ddbcee
2020-04-27 10:48:25 -07:00
Andy Hung
ba04dbe773 SoundPool: Fix stream playback thread startup wait
Test: see bug for details, verified by logcat and sound analysis
Test: SoundPool(Aac|Haptic|Midi|Ogg)Test
Bug: 151781575
Change-Id: Iba65953cdfa4ab1cabc33650790e9fd5a2787786
2020-03-20 11:18:25 -07:00
Andy Hung
9bebf81345 SoundPool: Set completion flag before promise
Restores order of setting and promise changed by
commit eaeced3383fc398e657b02452952f1a3db6285a1

Test: android.media.cts.SoundPool(Aac|Haptic|Midi|Ogg)Test
Bug: 151161792
Change-Id: I0e9cc173dbcc6080bfbbd15e1cab059812f54c97
2020-03-11 14:51:52 -07:00
Andy Hung
eaeced3383 SoundPool: Fix StreamManager JavaThread shutdown
std::future destructor only blocks for ready when created by std::async,
so do a wait in the JavaThread destructor.

Do not signal that the thread is closed until we really are finished
with all member variable access.

This fixes a rare race condition.

Test: SoundPool stress test
Test: SoundPoolAacTest SoundPoolHapticTest SoundPoolMidiTest SoundPoolOggTest
Bug: 150517918
Change-Id: I412143726956ee100069f711dd39b1d59ac100b0
2020-03-03 14:08:24 -08:00
Marco Nelissen
25f8348cc7 Don't link with mediametrics headers symlinks
Bug: 143245419
Test: build
Change-Id: Id0a76cb571812168ca277aef6ff02d5aead266ca
2020-01-16 15:55:57 -08:00
Andy Hung
c6ded22ccb Merge "Revert "Revert "SoundPool: Use caller thread for sound playback""" 2019-12-12 21:28:34 +00:00
Andy Hung
8823c98a33 Revert "Revert "SoundPool: Use caller thread for sound playback""
This reverts commit af018345e56b18fcc617c04b3b9a55ac9b548b7f.

Reason for revert: Further testing indicates there is no regression from the original state before October 23. See bug for more details on testing performed.

Change-Id: Idba0a01621243ab17e9ef607aec75af2c8db2f25
Test: forrest test on builds 5960785 and 5960803 perfetto_system#ion-avg
Bug: 145834064
2019-12-12 19:43:12 +00:00
Stefania Halac
ac35213722 Merge "Revert "SoundPool: Use caller thread for sound playback"" 2019-12-09 16:17:56 +00:00
Deepika Likhite
af018345e5 Revert "SoundPool: Use caller thread for sound playback"
This reverts commit 66262b16fb169676d768a8be52485881ea53da54.

Reason for revert: < CL will be reverted since we are seeing a memory  regression. Please refer this bug http://b/145834064. Exempt-From-Owner-Approval: see go/perf-revert-firs>

Change-Id: I42db74b5e65f6cdc88d69bfbb686c93620ee563c
2019-12-07 00:01:06 +00:00
Andy Hung
457ed3ae48 SoundPool: Improve tests
Add repeated sound IDs.
Add more Stream logging.

Test: soundpool_stress
Test: android.media.cts.SoundPool*Test
Bug: 140807581
Change-Id: Icc249791c43a943d3cdb237d476eee58c669216e
2019-12-03 22:28:40 +00:00
Andy Hung
66262b16fb SoundPool: Use caller thread for sound playback
A worker playback thread may be starved under high usage situations
such as screenshots or camera snapshots.

Also fix issue with caller thread playback when reusing stream on restart queue.

Test: camera snapshot, screenshot
Test: native soundpool_stress
Test: android.media.cts.SoundPool*Test
Bug: 143448491
Bug: 144540753
Change-Id: I126c3efffc1f1dfb0fcde7a71cdea64afbe0af0a
2019-11-18 15:33:07 -08:00
Marco Nelissen
604aed30f8 Merge "Add required header_libs" am: 04d8813a01 am: 67da76a19d am: 8526f75455
am: 505135bc59

Change-Id: I651ddd23b861da8faeb77c036523bd8ad794a413
2019-10-25 13:30:32 -07:00
Marco Nelissen
8844f0f8dd Add required header_libs
Test: build
Bug: 143245419
Change-Id: Idff0bf6cde9bc3e568d04c978f388be31963bc02
2019-10-24 21:25:59 +00:00
Andy Hung
cd21537aab SoundPool: Add native stress test
Test: soundpool_stress (this is it)
Bug: 140807581
Change-Id: I777a3adfe3fa7e8a9c9162c98e472c2e38e1e7bf
2019-10-23 14:21:14 -07:00
Andy Hung
e7937b9882 SoundPool: Refactor class
Make class names fit the Java API and documentation.

Rename Channel -> Stream.
Rename Sample -> Sound.
Rename SoundPoolThread -> SoundDecoder.

Move track start and stop to worker thread.

Fix up types to ensure future compatibility with Java ints
which are 32 bits always. Upgrade 16 bit types to
32 bits (e.g. sample id, sample rate, etc.)

Move sound related code into the SoundManager class.
Move stream related code into the StreamManager class.

Clean up locking, split SoundPool lock into the following locks
1) mApiLock
2) mStreamManagerLock
3) mSoundManagerLock
4) per Stream mLock.
5) mCallbackLock

Group locked data and make private in associated classes to ensure
restricted access, yet maximum concurrency.

Fix race conditions waiting for next event to play in stream.

Ensure track commands are handled consistently when stream is stolen.

Test: SoundPoolOggTest
Bug: 140807581
Change-Id: I8fcb374ee6329eb5474b973624584ca5080da862
2019-10-22 16:26:58 -07:00
Ytai Ben-Tsvi
2c9d8f6db0 Improve visibility of IMemory security risks
This change renames the IMemory raw pointer accessors to
unsecure*() to make it apparent to coders and code reviewers
that the returned buffer may potentially be shared with
untrusted processes, who may, after the fact, attempt to
read and/or modify the contents. This may lead to hard to
find security bugs and hopefully the rename makes it harder
to forget.

The change also attempts to fix all the callsites to make
everything build correctly, but in the processes, wherever the
callsite code was not obviously secure, I added a TODO requesting
the owners to either document why it's secure or to change the
code. Apologies in advance to the owners if there are some false
positives here - I don't have enough context to reason about all
the different callsites.

Test: Completely syntactic change. Made sure code still builds.
Change-Id: I4c555ef8c8c47cf28b42b17ad8b4021a783548cd
2019-09-13 11:05:09 -07:00
Andy Hung
f1588f2694 SoundPool: Do not sleep on stop for USAGE_GAME or on BUFFER_END
Test: SoundPoolApplication, SoundPoolOggTest, Games
Bug: 139787914
Bug: 139788416
Bug: 140579743
Bug: 140779732
Merged-In: I83b9b1d61b65dcc4a73d676e1f8be1e022c70302
Change-Id: I83b9b1d61b65dcc4a73d676e1f8be1e022c70302
(cherry picked from commit a527524356a9a6bc9597e4d06cee5c02cf936a68)
2019-09-13 10:30:02 -07:00
Andy Hung
a527524356 SoundPool: Do not sleep on stop for USAGE_GAME or on BUFFER_END
Test: SoundPoolApplication, SoundPoolOggTest, Games
Bug: 139787914
Bug: 139788416
Bug: 140579743
Bug: 140779732
Change-Id: I83b9b1d61b65dcc4a73d676e1f8be1e022c70302
2019-09-10 15:34:07 -07:00
Andy Hung
5470761fba SoundPool: Ramp volume down when forcibly reclaiming track
Test: Soundbar menu scrolling
Bug: 119284313
Change-Id: I4e3e1dc616c4e53780dda5492bb755750be794a0
2019-02-07 04:29:28 +00:00