13215 Commits

Author SHA1 Message Date
rago
39276259c7 Fix DynamicsProcessing effect defaults and documentation typo
Fixing level for default values of Dynamics Processing effect.
Fixing typo on documentation

Bug: 79712497
Test: manual testing and sound amplifier test
Change-Id: I54b2bd728dc502839cdde97327c840b825811c3c
2018-05-21 19:01:45 -07:00
Jaewan Kim
a31254bde1 Merge "Differentiate MediaController in a process for MediaSession" into pi-dev
am: 43688e8f2f

Change-Id: I8deb492fa82dcb2bec04d85a65a0aa267be830a4
2018-05-21 17:29:35 -07:00
TreeHugger Robot
43688e8f2f Merge "Differentiate MediaController in a process for MediaSession" into pi-dev 2018-05-22 00:11:49 +00:00
Jaewan Kim
74ee5b36a0 Differentiate MediaBrowsers in a process for MediaBrowserService
MediaBrowserService#getCurrentControllerInfo() can have more fine
grained differentiation for multiple MediaBrowser in a package/process

Bug: 79728675
Test: Run CtsMediaTestCases
Change-Id: Ibc5076ea5ec40f059297b1e7bda9edef7107556e
2018-05-19 08:37:03 +09:00
Jaewan Kim
21c23e30b4 Differentiate MediaController in a process for MediaSession
MediaSession#getCurrentControllerInfo() can have more fine grained
differentiation for multiple MediaController in a package/process

Bug: 79728675
Test: Run CtsMediaTestCases
Change-Id: I81e94736e795ee5e7fbd28cb6cd834cc3a3b8f98
2018-05-19 08:36:51 +09:00
Jean-Michel Trivi
6a59e737fc Merge "MediaFormat: fix javadoc for AAC-related keys" into pi-dev
am: 1b3ef3cb7d

Change-Id: I75f8fffea0bcc873e0b7aed257c30d8a03f97f29
2018-05-18 13:49:34 -07:00
Jean-Michel Trivi
1b3ef3cb7d Merge "MediaFormat: fix javadoc for AAC-related keys" into pi-dev 2018-05-18 20:34:47 +00:00
Chong Zhang
4c15c9e07c Merge "Add a hidden flag to indicate exif data block." into pi-dev
am: 23fdce9295

Change-Id: Ifd2f6ca586d2e42c73b8f9a30c5db1b9cc644bbf
2018-05-18 10:21:59 -07:00
TreeHugger Robot
23fdce9295 Merge "Add a hidden flag to indicate exif data block." into pi-dev 2018-05-18 17:09:36 +00:00
Jean-Michel Trivi
5cf2899ccd MediaFormat: fix javadoc for AAC-related keys
Bug: 71430241
Test: make offline-sdk-docs
Change-Id: Id0d6439e0ff35af0a34d0c51cdcdafa8822fd5a9
2018-05-17 15:26:28 -07:00
Chong Zhang
2d4340e8a5 Add a hidden flag to indicate exif data block.
bug: 79476308
Change-Id: Ib86e7bd718fe54a4e3e265ce8644706038f1444c
2018-05-16 14:50:10 -07:00
Dan Willemsen
d00c851e55 Merge "Convert to Soong" am: acbd94d76f
am: b1005a8a2a

Change-Id: If5cb26e0669f79240d8fee1d40aaa2162d8e611f
2018-05-15 15:06:19 -07:00
Jerry Zhang
73e4d170c5 Merge "Call access(2) on all files/dirs modified by Mtp" into pi-dev
am: 01f41f96fe

Change-Id: I7c329a8cdff834a24a3e0ef3f82387421084b5de
2018-05-15 14:55:19 -07:00
Jerry Zhang
9e1d134556 Merge "Access removable volumes through /mnt/media_rw" into pi-dev
am: 1e62b676d9

Change-Id: Ibc2cf0e4243adb0f69f2ba7ac3ca7526bb492b38
2018-05-15 14:50:02 -07:00
Jerry Zhang
01f41f96fe Merge "Call access(2) on all files/dirs modified by Mtp" into pi-dev 2018-05-15 21:35:43 +00:00
Jerry Zhang
1e62b676d9 Merge "Access removable volumes through /mnt/media_rw" into pi-dev 2018-05-15 21:35:43 +00:00
Jiabin Huang
bccbeb1bbb Merge "Add support for manually set surround formats." into pi-dev
am: eddc0d712c

Change-Id: I96c58363303db1ac7fc6dfa43c3bd57c7f8ab734
2018-05-15 14:10:39 -07:00
Jiabin Huang
eddc0d712c Merge "Add support for manually set surround formats." into pi-dev 2018-05-15 20:54:27 +00:00
Jerry Zhang
d470a1eca6 Call access(2) on all files/dirs modified by Mtp
External sdcards are accessed through /mnt/media_rw,
so access() each touched file for sdcardfs to update
its metadata.

Java handles single object renames directly so that
is the only place where it is needed.

Bug: 77849654
Test: use mtp with emulated sdcard
Change-Id: Ie460398010f1fe74d8084808a6333b121674362c
2018-05-15 12:29:13 -07:00
jiabin
3994075a5b Add support for manually set surround formats.
To make surround sound setting more clear to users, we are changing
surround setting from ALWAYS to MANUAL. With MANUAL, users could enable
surround formats according to their need.

Bug: 67479735
Test: Try creating AudioTrack with enable/disable surround formats.
Change-Id: I79e610f6c43d7003daf13da3bee4e03ba9b6ea87
2018-05-15 10:10:47 -07:00
Colin Cross
d6a3bafd12 Merge "Fix errors caught by aapt2" am: 5d58a302e3
am: 2743c5bb09

Change-Id: I84dbf6e0fbfe8e2730ffa3fa79c3ef732702e192
2018-05-14 18:03:55 -07:00
Dan Willemsen
4888b1f6f0 Convert to Soong
See build/soong/README.md for more information.

Test: m libframeworks_coretests_jni
Test: m FrameworkCoreTests_install
Test: m libshim_jni
Test: m CtsShimPrivUpgrade
Test: m libfilterfw
Test: m PMTest_Java_dual
Test: m libdefcontainer_jni
Test: m libperftestscore_jni
Test: m libpmtest32 libpmtest64
Test: m libprintspooler_jni
Test: m libsmartcamera_jni
Test: m idmap
Test: m libdrmframework_jni
Test: m libdvr_loader com.google.vr.platform com.google.vr.platform.xml
Test: m libfilterpack_imageproc libfilterpack_base
Test: m libwebviewchromium_loader
Test: m shared_mem_test
Test: m test-touchlag
Change-Id: I868561dd237fa28647896d59049ab9260373ada1
2018-05-14 16:47:02 -07:00
Jerry Zhang
71938e18ca Access removable volumes through /mnt/media_rw
Due to permissions changes, we now need to access
the underlying filesystem of removable devices in
order to get write access.

Add internalPath to StorageVolume, and have VolumeInfo
set the field on creation.

Bug: 77849654
Test: Can write to emulated sdcard through MTP
Change-Id: I63302ecf2dd2600a1c9f3f6ab106c3695654cbaa
2018-05-14 11:39:12 -07:00
Michael Dooley
74b6863504 Merge "Don't crash if SoundTriggerDetectionService client is gone or if there is a remote exception while finishing an opperation" into pi-dev 2018-05-11 17:46:41 +00:00
Colin Cross
3478ddce8f Fix errors caught by aapt2
Fixes:
frameworks/base/media/tests/NativeMidiDemo/AndroidManifest.xml:11: error: unknown element <uses-feature> found.

Bug: 79481102
Test: m java FORCE_AAPT2=true
Change-Id: Ife9b7c9eb97adfd6525912776f16cb27b5d22677
Merged-In: I7bb02b8926d01090132ce873c785b5323a9fa5f8
2018-05-10 22:16:35 -07:00
TreeHugger Robot
a3a74591b7 Merge "Fix failure in ExifInterface on certain HEIF files" into pi-dev 2018-05-10 22:03:41 +00:00
Jaewan Kim
183a63474f Merge "MediaSessionService: Provide caller information for media key events" into pi-dev 2018-05-10 04:48:35 +00:00
Chong Zhang
64eeef77ee Fix failure in ExifInterface on certain HEIF files
Some sniffers in MediaExtractor might issue reads past the end of
the file. This results in IOException in our MediaDataSource. The
exception itself is not fatal, but need to make sure MediaDataSource
state is kept in sync otherwise the other extractors can't continue.

Bug: 79497983
Test: test the ExifInterface on the attached file in bug, as well as
      selected HEIF files from other devices, Exif should be extracted
      without error in the log.

Change-Id: I5c8f597b8ef14288e3465670b202adc93c09e6ea
2018-05-09 18:52:01 -07:00
mike dooley
be30661349 Don't crash if SoundTriggerDetectionService client is gone
or if there is a remote exception while finishing an opperation

Test: built
Bug: 78137044
Change-Id: I4bc92f8688c2269178d101d95946f4835ab7c6a5
2018-05-09 13:53:48 +02:00
Jaewan Kim
77748b623c MediaSessionService: Provide caller information for media key events
Current limitation is that we cannot distinguish between key events
from Window#injectInputEvent() and key presses from physical devices.

Bug: 79185725
Test: Manually verified with the test app, and Cts
Change-Id: I1c3da4a963238512eec8b57fbc2d825c7436b140
2018-05-08 15:53:00 +09:00
Jean-Michel Trivi
7d32a1e045 Merge "AudioFocusRequest: fix doc for focus listener dispatch" into pi-dev 2018-05-08 00:53:02 +00:00
Jack He
896e129f5f Bluetooth: Fix HFP SCO logic and documentation
AudioService:
* Call setBtScoActiveDevice and setBluetoothScoOn both in AudioService's
  broadcast receiver so that these two methods must be triggerred in
  the same sequence as ACTIVE_DEVICE_CHANGED and AUDIO_STATE_CHANGED
  intents are sent and we no longer need to handle race condition by
  synchronously checking active device in setBluetoothScoOn
* Default sco audio mode when no headset is active should be virtual
  voice call, as many HFP devices do not accept SCO audio without an
  ongoing call
* Synchronize checkScoAudioState() method with mScoClients
* Add helper functions connectBluetoothScoHelper and
  disconnectBluetoothScoHelper to call various SCO setup and tear down
  methods based on sco audio mode
* Try raw, virtual call, and voice recognition mode when disconnecting
  externally started SCO
* Add new sco state SCO_STATE_DEACTIVATING to allow back to back calling
  of startBluetoothSco and stopBluetoothSco

Audio Manager:
* Modified AudioManager logic so that removed devices callback is called
  before newly added devices

BluetoothHeadset:
* Modified BluetoothHeadset so that start and stop SCO using virtual
  voice call no longer need a parameter and will use active device by
  default
* Modified documentation around various sco mangement APIs to match
  their expected behaviors

Bug: 76114959
Test: VoIP calls sanity test cases
Change-Id: Id50db88f4ff36069b0f392c81dd9d90c24cd2206
(cherry picked from commit 89f979849a5cf2fa4e16d4f24ab41409f16a9956)
2018-05-07 12:57:26 -07:00
Jack He
89f979849a Bluetooth: Fix HFP SCO logic and documentation
AudioService:
* Call setBtScoActiveDevice and setBluetoothScoOn both in AudioService's
  broadcast receiver so that these two methods must be triggerred in
  the same sequence as ACTIVE_DEVICE_CHANGED and AUDIO_STATE_CHANGED
  intents are sent and we no longer need to handle race condition by
  synchronously checking active device in setBluetoothScoOn
* Default sco audio mode when no headset is active should be virtual
  voice call, as many HFP devices do not accept SCO audio without an
  ongoing call
* Synchronize checkScoAudioState() method with mScoClients
* Add helper functions connectBluetoothScoHelper and
  disconnectBluetoothScoHelper to call various SCO setup and tear down
  methods based on sco audio mode
* Try raw, virtual call, and voice recognition mode when disconnecting
  externally started SCO
* Add new sco state SCO_STATE_DEACTIVATING to allow back to back calling
  of startBluetoothSco and stopBluetoothSco

Audio Manager:
* Modified AudioManager logic so that removed devices callback is called
  before newly added devices

BluetoothHeadset:
* Modified BluetoothHeadset so that start and stop SCO using virtual
  voice call no longer need a parameter and will use active device by
  default
* Modified documentation around various sco mangement APIs to match
  their expected behaviors

Bug: 76114959
Test: VoIP calls sanity test cases
Change-Id: Id50db88f4ff36069b0f392c81dd9d90c24cd2206
2018-05-04 19:49:49 -07:00
Jean-Michel Trivi
15c1da270b AudioFocusRequest: fix doc for focus listener dispatch
Bug: 78617702
Test: make offline-sdk-docs
Change-Id: I6eeacfdc309f76295276e271bb5700ec6f89148a
2018-05-04 18:16:11 -07:00
android-build-team Robot
353a9bc4bf Merge "Fix documentation bug that breaks generation" into pi-dev 2018-04-27 23:46:07 +00:00
Marco Nelissen
bab75909fa Don't treat failed scans as valid media files
Instead, add them to the MediaProvider as non-media files.
Bug: 77656952
Test: manual, CTS

Change-Id: I3b72b3e28f481b6775349337588225daeacbe552
2018-04-25 14:39:04 -07:00
Jeff Tinker
af71bb69e1 Fix documentation bug that breaks generation
bug:78536565
Change-Id: Ic30762459e888c355e5995067377486b8ac34557

Test:make offline-sdk-docs
2018-04-25 19:22:59 +00:00
Marco Nelissen
a98bb36fed Merge "Guard against native crash due to null Surface" into pi-dev 2018-04-23 19:58:46 +00:00
TreeHugger Robot
6cc4575ced Merge "ExifInterface: Prevent infinite loop" into pi-dev 2018-04-20 02:43:54 +00:00
Jin Seok Park
12e7aa5882 ExifInterface: Prevent infinite loop
A corrupted image file may create two problems.
1. A corrupted IFD pointer may point to an IFD that has already
been read, thus creating an infinite loop and a stack overflow.
2. A corrupted IFD offset value may have a negative value, thus
prompting a random reading of the file and creating an infinite
loop.
This CL addresses these issues.

Bug: 63800695
Test: Run cts (ExifInterfaceTest)
Change-Id: I706a0c3eae6af8301af69407333ea88e5681df3c
2018-04-20 10:36:00 +09:00
Marco Nelissen
59cf9aa283 Guard against native crash due to null Surface
Bug: 77874529
Test: record video, mini CTS
Change-Id: I00815fa334a9701e344b263e62549655299013cf
2018-04-19 12:33:36 -07:00
TreeHugger Robot
11d203ea0d Merge "Use heif embedded thumbnail if available" into pi-dev 2018-04-14 00:23:37 +00:00
Jean-Michel Trivi
ec4f10df90 Source of deadlock between PlayerBase.mLock and
PlaybackActivityMonitor.mPlayerLock:

android.media.MediaPlayer.release()
> android.media.PlayerBase.baseRelease()
  > synchronized (mLock)
    > com.android.server.audio.PlaybackActivityMonitor.releasePlayer()
       > synchronized(mPlayerLock)
and:

com.android.server.audio.PlaybackActivityMonitor.unmutePlayersForCall()
> synchronized (mPlayerLock)
  > android.media.PlayerProxy.setVolume()
    > android.media.PlayerBase$IPlayerWrapper.setVolume()
      > android.media.PlayerBase.baseSetVolume()
        > synchronized (mLock)
          playerSetVolume()

Since system_server can have its own players, the calls to
 AudioService from PlayerBase can be synchronous, hence the
 deadlock.
The fix consists in never holding the lock in PlayerBase
 while calling into AudioService.
Refactor the playstate update into a method used for
 start / stop / pause.

Bug: 72294559
Test: see bug
Change-Id: Ib41045de124683a7484184cf63577bd2412d1362
2018-04-12 17:27:30 -07:00
TreeHugger Robot
fd3e190cbf Merge "Use system property to get the package name for media update" into pi-dev 2018-04-12 20:54:46 +00:00
TreeHugger Robot
ccaba49ab5 Merge "Change log level when microphone enumeration APIs native call fail." into pi-dev 2018-04-12 17:05:12 +00:00
TreeHugger Robot
773791a94c Merge "Fix missing video caps for HEIC type encoders" into pi-dev 2018-04-12 09:59:28 +00:00
TreeHugger Robot
ed01dfba3e Merge "Fix possible NPE in MediaSessionManager" into pi-dev 2018-04-12 06:51:52 +00:00
TreeHugger Robot
437b252c96 Merge "PlayerBase: fix deadlock" into pi-dev 2018-04-12 01:46:52 +00:00
Jean-Michel Trivi
76e124bcd3 PlayerBase: fix deadlock
Source of deadlock between PlayerBase.mLock and
  PlaybackActivityMonitor.mPlayerLock:

android.media.MediaPlayer.release()
> android.media.PlayerBase.baseRelease()
  > synchronized (mLock)
    > com.android.server.audio.PlaybackActivityMonitor.releasePlayer()
       > synchronized(mPlayerLock)
and:

com.android.server.audio.PlaybackActivityMonitor.unmutePlayersForCall()
> synchronized (mPlayerLock)
  > android.media.PlayerProxy.setVolume()
    > android.media.PlayerBase$IPlayerWrapper.setVolume()
      > android.media.PlayerBase.baseSetVolume()
        > synchronized (mLock)
          playerSetVolume()

Since system_server can have its own players, the calls to
 AudioService from PlayerBase can be synchronous, hence the
 deadlock.
The fix consists in never holding the lock in PlayerBase
 while calling into AudioService.
Refactor the playstate update into a method used for
 start / stop / pause.

Bug: 72294559
Test: see bug

Change-Id: I6451aa3bf19a0365472ba007b116a9e6151ab33e
2018-04-11 17:22:59 -07:00
Chong Zhang
7d12714020 Use heif embedded thumbnail if available
Use the heif embedded thumbnail as long as it's not
too small to avoid decoding the full image and downscale.

bug: 74395267
Test: CTS MediaMetadataRetriever test; manual test of thumbnail
extraction by browsing new folders containing heif files in
Downloads app.
Change-Id: I5b2be0521452376153a773cb7671fefe7f9bc439
2018-04-12 00:08:57 +00:00