Commit Graph

6222 Commits

Author SHA1 Message Date
Kweku Adams
bc84aecc76 Fixing bugs in Notification proto dumping.
Also changing method signatures to be more in line with our convention.
Based on some of the changes I went through, it looks like:
1. We were only legitimately saving the very last NotificationRecord
that was dumped.
2. We weren't dumping any NotificationChannels into
NotificationChannelGroup protos.

Bug: 65750824
Test: Android builds
Change-Id: I8c1ef90cf69d8ea00a7bad0c67445741056e23ef
2018-01-23 13:36:23 -08:00
TreeHugger Robot
e74fa6c231 Merge "Add new MediaDrm methods" 2018-01-23 17:07:40 +00:00
TreeHugger Robot
d66cfdfc9a Merge "AudioFocusRequest: add ability to force ducking for a11y" 2018-01-23 16:46:10 +00:00
Jaewan Kim
b78ea164d6 Merge "MediaSession2: Introduce MediaSession2.Command / CommandGroup" 2018-01-23 09:52:03 +00:00
Jaewan Kim
727e3d2872 Merge "MediaSession2: Move MediaSession2/MediaController2 from experimental" 2018-01-23 09:46:10 +00:00
Insun Kang
fd3fdfdfed Release MediaSession when VideoView2 is detached from window.
Test: build
Change-Id: I36baae35cc8196e3fa2fc9f9bdda4219ffaf863d
2018-01-23 15:01:37 +09:00
Jaewan Kim
589795d12d MediaSession2: Introduce MediaSession2.Command / CommandGroup
Test: Run all tests once
Change-Id: I2ccafcdac5247c9f008b8d4fe50b974ea47fdeed
2018-01-23 14:36:20 +09:00
Jaewan Kim
ceb6b6e131 MediaSession2: Move MediaSession2/MediaController2 from experimental
APIs will be unhidden later

Test: Run MediaComponentsTest
Change-Id: I2d9fcd98232016281fad128e9e674885b41e20d9
2018-01-23 14:02:08 +09:00
Jeff Tinker
3eb07f46a7 Add new MediaDrm methods
Methods for querying HDCP, security levels and
number of sessions

bug:64001680
bug:33657579

Test: cts: MediaDrmMockTest, ClearKeySystemTest
gts: GtsMediaTestCases

Change-Id: Ie616f96ab6b74410a3d7548a7f34b20cf0831d0c
2018-01-22 13:34:06 -08:00
TreeHugger Robot
0e5f9c8a4b Merge "Use generic native routing event handler in MediaRecorder." 2018-01-22 19:12:42 +00:00
Jean-Michel Trivi
9228af6bc2 AudioFocusRequest: add ability to force ducking for a11y
New API to specify an accessbility service wants to force ducking
  in its focus request, regardless of the framework's evaluation
  of whether or not it should duck the other players.
Use of this API is restricted to requests coming from services
  bound to the A11y service, or root

Bug: 62194333
Test: play a podcast in GPM and "adb shell claf --gain 3 --usage 11 --forceDuck"

Change-Id: I85f26afa14fe233a3b870f86c9084613203494b8
2018-01-20 15:51:01 -08:00
Jean-Michel Trivi
5c2aae0908 Unhide audio offload for android.media.AudioTrack
Unhide some compressed audio formats for offloading
  or direct output.
Unhide AudioManager method to query whether a given
  format can be offloaded on the device.
Unhide AudioTrack.Builder method to request offload.
Unhide callback for new AudioTrack events and
  associated methods.

Bug: 63934228
Test: same as MediaPlayer2 tests
Change-Id: If763eb2424baa6aa55cb60e96bb3564c4234e23f
2018-01-20 13:18:50 -08:00
TreeHugger Robot
51a9a31ba5 Merge "Multi-A2DP support - add a new internal API to suppress Audio Noisy intent" 2018-01-20 17:58:25 +00:00
TreeHugger Robot
b5ebe3003a Merge "AudioTrack: support for offloaded playback" 2018-01-20 05:48:37 +00:00
Pavlin Radoslavov
82e06463f2 Multi-A2DP support - add a new internal API to suppress Audio Noisy intent
The new API setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent()
is similar to the existing setBluetoothA2dpDeviceConnectionState()
except that it takes one extra argument that indicates whether the
AudioManager.ACTION_AUDIO_BECOMING_NOISY intent will be sent:

  setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(
      ..., boolean suppressNoisyIntent)

This API is needed so the Active A2DP Sink device can be changed
while audio is streaming, and the audio continues playing on the new
Active Device.

Bug: 69269748
Test: Manual: multiple connected A2DP devices, and selecting each as
      the Active Device.

Change-Id: I75766a58d9e6b42b3ce68bd9ad3a7a72ca5a1023
2018-01-19 19:53:02 -08:00
Jean-Michel Trivi
980d38ff77 AudioTrack: support for offloaded playback
Surface new callbacks from native AudioTrack to
  Java through the existing callback method and
  post to the Java instance.
New AudioManager method to query whether offload
  is supported.
Allow using non-PCM format on a track built for
  offload (new option in AudioTrack.Builder)

Numerous "todo" are added for the unhide of the
  API additions and will be in a separate patch.

Bug: 63934228
Test: same as MediaPlayer2 tests

Change-Id: I98a81ffffc95c7596a39ee634dcb89bb854f3178
2018-01-19 15:05:37 -08:00
jiabin
0b9fa51992 Use generic native routing event handler in MediaRecorder.
We already make a generic native routing event handler. There is no need
to keep the handler class in MediaRecorder.

Bug: 64038649
Test: runtest --path cts/tests/tests/media/src/android/media/cts/RoutingTest.java
Change-Id: I2d54977a6f990fb549d27aabf52f040bd9da58fa
2018-01-19 14:52:12 -08:00
Nadav Bar
4d7cc1a35a Merge "Enable phone apps to mute the VOICE_CALL stream" 2018-01-19 20:05:18 +00:00
TreeHugger Robot
24de6a45aa Merge "Initial commit for VideoView2Impl" 2018-01-19 09:57:15 +00:00
Christofer Åkersten
3661ad03d2 Only load preinstalled updatable in release
Test: Instantiate MediaController2
Change-Id: I8da88cf9291ee1365143ca86fa64d3f2fde8e225
2018-01-19 16:20:37 +09:00
Insun Kang
de16c4d357 Initial commit for VideoView2Impl
Test: build
Change-Id: I12b93da01b9c37115cba29b8b50b36cf3d74ddb6
2018-01-19 14:41:39 +09:00
Christofer Åkersten
365ded397c Only pass resources to updatable
Test: Instantiate MediaController2
Change-Id: If357a01847d8a2f9995af3f4c3ec3a777082c662
2018-01-19 14:09:09 +09:00
Phil Burk
91df2717b9 AudioAttributes: note that AAudio.h should sync
Usage and other attributes may need to be added to AAudio.

Bug: 68052449
Test: just a comment
Change-Id: I6858ef22e437cbd1f9c31142516eca4705422fa6
2018-01-18 09:17:22 -08:00
Sungsoo Lim
39a4063919 Send library context to ApiFactory
Test: build
Change-Id: I2bfc5ca5cace1a82c5502391b777dd544acdcf69
2018-01-17 16:26:32 +09:00
Sungsoo Lim
e325904987 Skeleton for updatable VideoView2
Test: manual
Change-Id: I77a960269e19ddf3659ffb9e60a69c4ca86f101b
2018-01-16 17:01:56 +09:00
TreeHugger Robot
50c96d3902 Merge "mediaformat: Expose frame reordering to application." 2018-01-10 22:42:27 +00:00
Christofer Åkersten
cfa037065e Initial commit of updatable media API
Test: Created instance & called method
Change-Id: I85f6ea946ef7886abe496b7a851d5b6d50e235b5
2018-01-04 20:50:24 +09:00
Hangyu Kuang
786828b623 mediaformat: Expose frame reordering to application.
Bug: 68114820
Test: None
Change-Id: I7cf4a9843c705657215bec7b7acdd119f54503b4
2018-01-03 13:42:17 -08:00
Jiyong Park
5a8940a338 Remove @SystemApi from inherited methods of AudioFocusInfo
Since the inherited methods hashCode and equals from the class Object is
already a public API, they don't need to be marked as SystemApi; they
haven't been appear in system-current.txt.

Having annotation on such members hasn't been harmful,
but will soon trigger CTS failures when we do the exact match for
SystemAPIs; a runtime entity annotated as @SystemApi have to exist in
the documented API (e.g. system-current.txt). So, removing the bogus
annotations.

Bug: 67891551
Test: m -j does not require m update-system-api
Change-Id: I40d60ed524d660f47b5c569980c28c6f0bd83db9
2018-01-03 11:13:29 +09:00
Nadav Bar
6b7751d2b5 Enable phone apps to mute the VOICE_CALL stream
This change adds support for priveliged apps with the MODIFY_PHONE_STATE
permission to mute the voice call stream using the adjustStreamVolume method.
The change adds specific handling for VOICE_CALL as a mutable stream.

Bug: 71017199
Fixes: 7107199
Test: Tested manually
Change-Id: Ic6d0466992dcea4f37899eac80a0102c992bdd72
2017-12-25 12:59:45 +02:00
Jean-Michel Trivi
7be17d26e0 New intent for microphone mute change notification
AudioManager: define ACTION_MICROPHONE_MUTE_CHANGED.
AudioService:
 - broadcast intent when setMicrophoneMute() is called
   with FLAG_RECEIVER_REGISTERED_ONLY.
 - remove outdated (invalid) comments.

Bug: 70857126
Test: m -j ; make -j offline-sdk-docs ; make -j cts ; \
      cts-tradefed run cts-dev -m CtsMediaTestCases -t android.media.cts.AudioManagerTest#testMicrophoneMuteIntent

Change-Id: I7391522f0195d06592e4f853e9b672fdec66d37a
2017-12-22 18:32:05 -08:00
Jean-Michel Trivi
8e7aca3819 AudioManager: add method to query stream attenuations in dB
AudioManager: new methods in SDK for querying:
 - the minimum volume index
 - the volume in dB for a given index on a given device type

Bug: 64844598
Test: cts-tradefed run cts-dev -m CtsMediaTestCases -t android.media.cts.AudioManagerTest
Change-Id: Iac999e7676643272820a4f1f4a32cf3a781ab7cd
2017-12-20 16:54:50 -08:00
Jerry Zhang
f9c5c2574d Add MtpStorageManager for monitoring filesystem events
MtpStorageManager keeps track of file information and
send notifications for new files. MtpDatabase now uses
this instead of MediaProvider for getting object information,
although some operations are still reflected into MP.

Since MtpStorageManager handles storage ids, remove
that field from StorageVolume and VolumeInfo.

Clean up a lot of the jni code for MtpDatabase.

Bug: 63143623
Test: Test every MtpOperation in a variety of situations on Linux and
Windows. Also use the shell to manipulate files. Verify that the cache
is consistent throughout, and the operations behave as expected. Verify
files created by the shell appear.
Test: adb shell am instrument -w android.mtp /android.support.test.runner.AndroidJUnitRunner
Change-Id: Id4ea810047b0c323399cd833047733e5daafb30a
2017-12-15 00:59:41 +00:00
Hongwei Wang
dd241da282 Adds getPort (hidden) to AudioDeviceInfo class
Motivation of this change:

In CarAudioService, we enumerate the AudioDeviceInfo on device via
AudioManager.getDevices(). The AudioDeviceInfo would be used to
construct the dynamic routing via AudioMix.Builder, which accepts
AudioDeviceInfo.

Meanwhile, we wire also the volume change to hal via
AudioManager.setAudioPortConfig(), which accepts AudioPort.

Bug: 65751827
Test: lunch bat_land-userdebug && m -j
Change-Id: I438cfd61e502340def5376fe373a296ab69ff86e
2017-12-12 19:35:28 +00:00
Jeff Sharkey
27674aedc0 Merge "Add auto-doc support for @StringDef." 2017-12-11 16:47:13 +00:00
Tor Norbye
f740c7ea08 Switch @IntDef from long to int, and add @LongDef
This CL mirrors changes made to the android.support.annotation version
of IntDef, to keep the usage and semantics identical (though the
internal version of @IntDef and @LongDef are of course hidden and not
part of the SDK.)

Test: These annotations have source retention and therefore have
no runtime impact; the change was compiling the SDK.

Change-Id: Idaf47e8d983c88be1bd8f938615c86611014b45a
2017-12-08 20:54:50 -08:00
Jeff Sharkey
5db9a91135 Add auto-doc support for @StringDef.
Behaves pretty much the same as @IntDef, but now supports "suffix"
in addition to "prefix" when matching constants.

Test: manual docs output looks sane
Bug: 70406696
Change-Id: I35064b0f9f36f1f13ccdb40302d818a004014f15
2017-12-08 17:33:40 -07:00
kyle_tso
4c53804386 Merge "Support scanDirectories with JNI callback function" am: 5747c2b81c am: 34be883ebd
am: baa1210d25

Change-Id: I7145485a3ae3ae3791e8aaefed650874fd41887e
2017-12-06 03:53:46 +00:00
kyle_tso
baa1210d25 Merge "Support scanDirectories with JNI callback function" am: 5747c2b81c
am: 34be883ebd

Change-Id: I57a54d520cd953c7b99e6815e7894421166368d4
2017-12-06 03:42:11 +00:00
kyle_tso
34be883ebd Merge "Support scanDirectories with JNI callback function"
am: 5747c2b81c

Change-Id: I8996fb568c4024ccf76a5643049de8cee6f811c6
2017-12-06 03:22:30 +00:00
Andrew Solovay
8f9c1631c5 Merge "docs: Add note to getFrameAtTime() pointing to getScaledFrameAtTime()" into oc-mr1-dev am: 284259a633
am: dd71b1bc61

Change-Id: Ib3f40c78449e6b4e837d053645a9cd9f3ab29ee4
2017-12-01 19:38:03 +00:00
Andrew Solovay
dd71b1bc61 Merge "docs: Add note to getFrameAtTime() pointing to getScaledFrameAtTime()" into oc-mr1-dev
am: 284259a633

Change-Id: Ic8c9f91f1fc1e6c32bae90d8bf8fbe6b91beb712
2017-12-01 19:29:13 +00:00
Andrew Solovay
d1be47c3e9 docs: Add note to getFrameAtTime() pointing to getScaledFrameAtTime()
Added a note to the various getFrame... methods saying that if you
don't need a full-resolution frame, getScaledFrameAtTime() is
preferable. Removed existing text suggesting you use those other
methods for fetching a thumbnail.

Staged revised doc to:

http://go/dac-stage/reference/android/media/MediaMetadataRetriever.html

Bug: 69804003
Test: make ds-docs
Change-Id: I54250b2d127987ef3c1633c011f5eac6b747372e
2017-11-30 15:55:53 -08:00
TreeHugger Robot
54c43f46fc Merge "Make native AudioRouting Handler in a seperate class." 2017-11-30 18:17:55 +00:00
Nadav Bar
108e94d9b0 Merge "Enabled the use of VOICE_DOWNLINK, VOICE_UPLINK and VOICE_CALL as audio sources for AudioRecord (Only supported for system apps)" 2017-11-30 16:28:17 +00:00
TreeHugger Robot
a3dcd16044 Merge "ImageReader: Make discardFreeBuffers public" 2017-11-30 01:28:59 +00:00
jiabin
9070e29586 Make native AudioRouting Handler in a seperate class.
Bug: 64038649
Test: runtest --path cts/tests/tests/media/src/android/media/cts/RoutingTest.java
Change-Id: I2fc64e177797b2541ba8652d54827f08fd6ca216
2017-11-29 15:20:44 -08:00
Chien-Yu Chen
5fb64cdae7 ImageReader: Make discardFreeBuffers public
Test: CTS
Bug: 64847201
Change-Id: I61008111552b5ca4641a509e5bcf5cf821582d5e
2017-11-29 14:13:01 -08:00
jiabin
fe3e6024ed Add AudioRouting interface in MediaRecorder.
Bug: 64038649
Test: Run cts in RoutingTest
      Switching input device when using MediaRecorder

Change-Id: I3f2a9f670565c6e55d612c1477a505fa3d096e3d
2017-11-28 17:25:46 -08:00
Jeff Sharkey
c204c223a7 Deeper sanity checking of emitted types.
When emitting a method or field, verify that we're able to reference
all mentioned types.  This ensures that we don't accidentally
reference undefined classes/interfaces.

Test: manual inspection of API files
Bug: 69791141
Change-Id: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
2017-11-27 17:07:40 -07:00