Commit Graph

6708 Commits

Author SHA1 Message Date
Robert Shih
ef157649d5 Merge "MediaCodec.CryptoInfo: expose subsample encryption pattern" into pi-dev
am: e3348a2593

Change-Id: I6eaaabc353304ee29aa677bf03d94384ddede51c
2018-05-30 11:13:45 -07:00
Robert Shih
e3348a2593 Merge "MediaCodec.CryptoInfo: expose subsample encryption pattern" into pi-dev 2018-05-30 17:43:58 +00:00
Robert Shih
97825a4fd0 MediaCodec.CryptoInfo: expose subsample encryption pattern
Bug: 31215085
Test: com.google.android.media.gts.WidevineMp4TempTests
Change-Id: I6965adc646684053633530e39258b171724b34bc
2018-05-25 17:44:56 -07:00
Jaewan Kim
0349869c06 Merge "Differentiate MediaBrowsers in a process for MediaBrowserService" into pi-dev
am: 0e7a307e14

Change-Id: I455466d79d0c1b534d87b33cdb787194422a51bf
2018-05-24 12:39:29 -07:00
Daisuke Teranishi
2e92e5c30b Merge "Use correct filename when adding to ringtone" am: daff857ffd
am: 24062f05d3

Change-Id: Id9d89491c5604b1611b22f215827f55de98f8ac2
2018-05-24 12:18:14 -07:00
TreeHugger Robot
0e7a307e14 Merge "Differentiate MediaBrowsers in a process for MediaBrowserService" into pi-dev 2018-05-24 09:59:28 +00:00
Daisuke Teranishi
ce4d67b6d0 Use correct filename when adding to ringtone
If the title of the music file includes "/", it's recognized
as a directory separator.
Use correct filename to select the file properly.

Bug: 80202253
Test: Add mp3 which title includes "/" to ringtone

Change-Id: I9bb05f6fe2d7d4dbbdf4f67db7ac6fde04707979
2018-05-24 11:39:33 +09:00
Ajay Panicker
d8e8126abe Merge "Add field to set A2DP device volume on connect (1/2)" into pi-dev 2018-05-23 18:58:28 +00:00
Eric Laurent
3e6fb63090 Add field to set A2DP device volume on connect (1/2)
Add a field to setBluetoothA2dpDeviceConnectionStateInt() to allow
Bluetooth to set a volume for the new device when it connects.

Bug: 79529581
Test: Switch repeatedly between devices and see that the old volume isn't
used on the new device or the new volume isn't used on the old device.
Change-Id: I909fa3f40818c595fc977695fbfa1214f9a4de72
2018-05-23 17:24:55 +00:00
TreeHugger Robot
2914820ebf Merge "Avoid race condition when broadcasting device list changed." into pi-dev 2018-05-23 15:24:23 +00:00
TreeHugger Robot
1ba53717fe Merge "MediaPlayer: sanity check track before dereferencing" into pi-dev 2018-05-23 02:35:15 +00:00
Marius Renn
f3703f9ef7 Merge "Adds support for hardware buffers in ImageWriter Images." into pi-dev 2018-05-23 01:35:11 +00:00
jiabin
8c3a767b2d Avoid race condition when broadcasting device list changed.
Since broadcastDeviceListChanged could be called in different threads,
there would be race condition causing mutilple callback due to
mPreviousPorts is not thread safe.

Bug: 80138804
Test: run TestDeviceList app in toolbox and cts
Change-Id: I0aa70dc45594bca263ea6f36703f22fe0293f679
2018-05-22 17:56:09 -07:00
Wei Jia
aea5de9410 MediaPlayer: sanity check track before dereferencing
Test: media post submit tests passed
Bug: 78175875
Change-Id: I6a23fc859a077eba03a17a562a7c3bb01d97e85b
2018-05-22 15:26:01 -07:00
renn
be09219f61 Adds support for hardware buffers in ImageWriter Images.
This allows dequeuing private image buffers from ImageWriters,
and accessing their hardware buffers.

Bug: 79422702
Test: verified cts locally
Change-Id: Ia003ffa0af305fad8ca9407f5379a3c9c1ab07b5
2018-05-22 20:43:07 +00:00
Ricardo Garcia
7d195a5a87 Merge "Fix DynamicsProcessing effect defaults and documentation typo" into pi-dev 2018-05-22 18:00:06 +00:00
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
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
1b3ef3cb7d Merge "MediaFormat: fix javadoc for AAC-related keys" into pi-dev 2018-05-18 20:34:47 +00: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
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
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
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
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 89f979849a)
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
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
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