Commit Graph

7288 Commits

Author SHA1 Message Date
Hyundo Moon
7053844db7 Revert "Introduce ControllerCallbackLink"
This reverts commit e521669b5d.

Reason for revert: Another CL will be uploaded which makes the APIs public, not @SystemApi.

Bug: 122169124
Change-Id: Ie9ed1067596fe1724879e81d768ac8252eda7841
2019-01-04 14:27:45 +09:00
Hyundo Moon
fcaaba066a Revert "Introduce SessionCallbackLink"
This reverts commit 8eee83e594.

Reason for revert: Another CL will be uploaded which makes the APIs public, not @SystemApi.

Bug: 121239657
Change-Id: I0537ffd487ab6889213b8917615156caaec17eb5
2019-01-04 14:20:47 +09:00
TreeHugger Robot
ecf7b4fed5 Merge "MediaController: Use Context#getPackageName() for RemoteUserInfo" 2019-01-03 19:51:16 +00:00
Jeff Sharkey
c54ffd28f7 Merge "MediaStore should reflect state on disk." 2019-01-03 17:56:17 +00:00
Jean-Michel Trivi
9958c94e4d Merge "Dynamic audio policies: multi-zone through uid/device affinity" 2019-01-03 16:16:50 +00:00
TreeHugger Robot
a9ccb72194 Merge "Implement cancelSessionCommand" 2019-01-03 10:02:56 +00:00
Sungsoo Lim
c6cfa0f74b Implement cancelSessionCommand
Also this CL adds missing getter methods of MediaSession2.

Bug: 122055262
Test: build
Change-Id: I4a3108ca89982e9482b8c0aa8920caad9a4d79c8
2019-01-03 14:47:13 +09:00
Jean-Michel Trivi
d6f65dea01 Dynamic audio policies: multi-zone through uid/device affinity
Augment dynamic audio policies with audio device affinity for
 apps (a.k.a multi-zone handling), to enable associating apps
 with a set of audio devices (which may form a "zone" in cars).

Bug: 111647296
Test: requires device with routing policy started by CarService
Change-Id: I2994ae80624556d9321f788a0575d9f732157228
2019-01-02 12:38:12 -08:00
Jeff Sharkey
96afa169f7 MediaStore should reflect state on disk.
It's an index of data scanned from disk, and it's been misleading to
let people mutate that data directly in MediaStore, since those
edits aren't durable in any way.  We never updated the metadata in
the underlying files, so any changes would be lost when moving
between devices.

This change moves to always re-scan files after they've been edited,
to ensure we pick up metadata changes.  It also ignores direct edit
attempts from apps.

Bug: 120711487
Test: atest android.media.cts.MediaScannerTest
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I4cc3ae24d6c6b5f01fe4bb47610ccf162c81ce83
2019-01-02 11:46:50 -07:00
Jaewan Kim
ffdb53d759 MediaController: Use Context#getPackageName() for RemoteUserInfo
Bug: 111817607, Bug: 111817367
Test: Manual test, incluing the scenario at b/110525559
Change-Id: I8dd39073dd8ae4a912e2a20db5493767b9e1d400
2019-01-02 20:18:34 +09:00
Hyundo Moon
c61fc6897c Merge "Introduce SessionCallbackLink" 2019-01-02 11:03:50 +00:00
Hyundo Moon
8eee83e594 Introduce SessionCallbackLink
In order to avoid direct AIDL usages in framework, this CL introduces a
new class SessionCallbackLink which can prevent usages of
ISessionCallback.

Also, this CL renames ControllerCallbackLink.asBinder() to
ControllerCallbackLink.getBinder().

Bug: 121239657
Test: make update-api -j / make -j
      atest CtsMediaTestCases:android.media.cts.MediaSessionTest
      atest CtsMediaTestCases:android.media.cts.MediaControllerTest
Change-Id: Icbcc4b045b1f6933c63d0d87aedc23b28c03d2de
2019-01-02 15:40:16 +09:00
Sungsoo Lim
aea2438616 Provide a way to get the command result
Bug: 122055262
Test: build
Change-Id: Icc6c2c791461df5d47479e82592895fc84b1974e
2018-12-31 20:40:43 +09:00
Sungsoo Lim
e7fe2a260d Implement sendSessionCommnad
Bug: 122055262
Test: build
Change-Id: Ia3269e6bafa4b79ab94bfafedc2c14f75fe84dd8
2018-12-31 20:40:29 +09:00
TreeHugger Robot
b7f8f718d6 Merge "Handle disconnection of MediaSession2/Controller2" 2018-12-31 11:14:17 +00:00
Sungsoo Lim
cfd36a5ab5 Handle disconnection of MediaSession2/Controller2
Bug: 122055262
Test: build
Change-Id: I388ab76beb8fc41b47e8f6310cc0bcb79b6acc9f
2018-12-31 17:01:53 +09:00
TreeHugger Robot
1ebc3f0d7e Merge "Introduce ControllerCallbackLink" 2018-12-31 07:43:55 +00:00
Hyundo Moon
e521669b5d Introduce ControllerCallbackLink
In order to avoid direct AIDL usages in framework, this CL introduces a
new class ControllerCallbackLink which can prevent usages of
ISessionControllerCallback.

Bug: 122169124
Test: make update-api -j / make -j
      atest CtsMediaTestCases:android.media.cts.MediaSessionTest
      atest CtsMediaTestCases:android.media.cts.MediaControllerTest
Change-Id: I860ea56afc046dd91e065ef207d374c0aa490c8f
2018-12-31 15:05:15 +09:00
TreeHugger Robot
4c4d22265d Merge changes I9cab65f9,I1773aa05
* changes:
  Add MediaSession2 builder and update JAVADOCs
  Add init MediaSession2 and MediaController2
2018-12-31 04:08:11 +00:00
TreeHugger Robot
6118bf44cc Merge "Change the value of AudioManager#FLAG_FROM_KEY" 2018-12-31 03:50:26 +00:00
Sungsoo Lim
938e8e91e8 Add MediaSession2 builder and update JAVADOCs
Bug: 122055262
Test: build
Change-Id: I9cab65f9b09cbe5d5570e4de649ffdff09b20b80
2018-12-31 11:46:04 +09:00
Sungsoo Lim
f894f77d49 Add init MediaSession2 and MediaController2
This CL only covers the connection logic between MediaSession2
and MediaController2.

Bug: 122055262
Test: build
Change-Id: I1773aa053ea1fce0cc548f334416e47d373f7f86
2018-12-31 11:45:46 +09:00
Andy Hung
2e961480fe MediaCodecInfo: Fix getSupportedSampleRates for null array
Test: MediaCodecTest#testPCMEncoding
Bug: 122116282
Change-Id: I3d7e16d130a6653e95e285b38678a8b4946319d7
2018-12-28 15:19:20 -08:00
Mathew Inwood
31755f94e1 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

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: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 11:50:04 +00:00
Jaewan Kim
5999fd7ec3 Merge "Media2: Initial commit of Session2Token" 2018-12-28 04:38:40 +00:00
Jaewan Kim
e1af131a37 Media2: Initial commit of Session2Token
Test: Build
Bug: 121233595
Change-Id: Ib568013f3b7a2d358fd38a937faddaa17925923a
2018-12-27 22:56:39 +09:00
Sungsoo Lim
bf37bd47fd Add Session2Command and Session2CommandGroup
Bug: 121230641
Test: build
Change-Id: Id9d79c90e99db7b78467cf3811d6dff667335a2e
2018-12-27 15:08:44 +09:00
Hyundo Moon
ca0080d919 Change the value of AudioManager#FLAG_FROM_KEY
As suggested by API review, this CL changes the value of FLAG_FROM_KEY
from 1 << 12 to 1 << 16. Also expands Javadoc of the flag as suggested.

Bug: 121325822
Test: make update-api -j / make -j
Change-Id: Ie40c609c717c68a97b01d88f68ce8ff465e3a89e
2018-12-27 13:47:52 +09:00
TreeHugger Robot
51cf66745a Merge "MediaRecorder:edit javadoc for vorbis encoder" 2018-12-26 21:48:46 +00:00
Gopalakrishnan Nallasamy
2675ac3c16 MediaRecorder:edit javadoc for vorbis encoder
MediaRecorder.AudioEncoder has unsupported VORBIS audio encoder constant declared. Edited javadoc
comment for the same as optional support.

Bug: 120211083

Test: make offline-sdk-docs
      - edited comment visible in MediaRecorder.AudioEncoder.html#VORBIS

Change-Id: I3294d9a768a8f439579f238ee2f1db93f20bc178
2018-12-26 11:48:41 -08:00
Yiwen Chen
2232e86186 Merge "Make RingtoneManager and Ringtone class support VolumeShaper" 2018-12-22 04:54:10 +00:00
Yiwen Chen
301b5bf50c Make RingtoneManager and Ringtone class support VolumeShaper
Bug: 120789399
Test: When finish the whole change, flash into a dev phone to test first.
Change-Id: I4620fac5f1c34d37b3b33565cebbea2c091a5d08
2018-12-21 16:11:27 -08:00
Wei Jia
2472c30d81 MediaPlayer2: keep EventCallbacks when reset
Test: cts
Bug: 112549021
Change-Id: I1eb4f47bf1c289a35a45e1017a28d7bd4ab8c5e8
2018-12-21 15:34:29 -08:00
TreeHugger Robot
edc0290709 Merge "MediaPlayer2: fix a typo" 2018-12-21 03:48:22 +00:00
Wei Jia
a6f5f7d89b MediaPlayer2: fix a typo
Test: cts
Bug: 112549021
Change-Id: I2b3803045d5e96d3ae186a8ff53dd11ea53bb18f
2018-12-20 15:43:57 -08:00
Eric Laurent
333dfad3bf Add AudioRecordingConfiguration changed callback
Add a callback reporting changes in current audio recording
configuration for AudioRecord and MediaRecorder.
The callback is called when the capture path configuration
changes (pre preprocessing, format, sampling rate...) or capture
is silenced/unsilenced by the system.

Bug: 111438757
Test: CTS tests for AudioRecord and MediaRecorder
Change-Id: Ifd5c5b4f5ee8911822a3f05412c84edf2db7858a
2018-12-20 19:17:29 +00:00
TreeHugger Robot
5f658dfbb3 Merge "MediaPlayer2: allow reusing DataSourceDesc" 2018-12-20 18:13:58 +00:00
Eric Laurent
c7a0cdfe1b AudioRecordingConfiguration: report more info about active use case
Report more information in onRecordingConfigChanged() callback and
AudioRecordingConfiguration:
    - For client:
      - Port ID (package private)
      - Enabled effects
      - Silenced by policy
    - For stream:
      - Active effects
      - Active audio source

Bug: 111438757
Test: CTS tests for AudioRecordingConfiguration
Change-Id: I84952614ee5d9ede23afd5836c68da7a20e79a2e
2018-12-19 17:57:09 -08:00
Wei Jia
c14da1ea14 MediaPlayer2: allow reusing DataSourceDesc
Test: cts
Bug: 112549021
Change-Id: Ib1c8daddcb04be00b75df3e4928904376a5e16bd
2018-12-19 17:50:18 -08:00
Sungsoo Lim
728e13b7b9 Add MediaItem2
Bug: 121216661
Test: build
Change-Id: I7dfd36bbc1feeeb0a80641940579b3d6187bd2f2
2018-12-19 15:03:49 +09:00
Jeff Sharkey
e8b3d96bc6 Merge "Improve thumbnail generation utilities." 2018-12-18 22:04:40 +00:00
Jeff Sharkey
32f6c7c097 Improve thumbnail generation utilities.
The existing APIs were pretty limited by only accepting a "kind"
value, so improve them to accept an arbitrary size, and offer a way
to cancel requests when no longer needed.

The older APIs were a mix of both public and @UnsupportedAppUsage,
so mark them all both public and deprecated so we can clearly steer
developers towards better options.  (The deprecated methods are
implemented using the new APIs internally for sanity.)

Use modern ImageDecode internally, which is more robust than
BitmapFactory.  Add CTS to confirm that we generate thumbnails of
reasonable sizes.

Bug: 119887587
Test: atest android.media.cts.ThumbnailUtilsTest
Change-Id: I4ca35569ad5c661b327a0cb24a48ebc21f6087b7
2018-12-18 10:03:10 -07:00
TreeHugger Robot
77a8a387f0 Merge "MediaPlayer2: add DataSourceDesc for source dependent API's" 2018-12-18 02:02:40 +00:00
Dongwon Kang
f51deea70e Merge "Remove unusued code; MediaPlayerBase and MP.set|getBufferingParams" 2018-12-18 01:24:35 +00:00
Dongwon Kang
5fbf64934f Remove unusued code; MediaPlayerBase and MP.set|getBufferingParams
Test: build
Bug: 112766913
Change-Id: I999a637a1cb47a28a032478f3c56ab0645837f92
2018-12-17 13:34:33 -08:00
Wei Jia
78a88fcba4 MediaPlayer2: add DataSourceDesc for source dependent API's
Test: cts
Bug: 112549021
Change-Id: Iecdb8cecc21abfdb906f30f93f3a5d02c2d8e16a
2018-12-17 10:57:06 -08:00
Jin Seok Park
864323beba Merge "AML: Remove unbundling MediaMetadata in MediaSessionRecord" 2018-12-17 05:04:04 +00:00
Jin Seok Park
a13857321f AML: Remove unbundling MediaMetadata in MediaSessionRecord
In order to record a log when MediaMetadata is unparceled in the
system process, MediaMetadata calls Bundle#setDefusable when it
is initialized. In order to avoid unnecessarily making
Bundle#setDefusable a public API, this CL removes the unparceling
instance in MediaSessionRecord by extracting the necessary
information inside MediaSession and sending them to
MediaSessionRecord separately.

Bug: 119789387
Test: Build
Change-Id: I7d44fd05250a291bd8d64850cc3c6f47236f9f62
2018-12-16 17:49:49 +09:00
Wei Jia
acf2796db9 DataSourceCallback: fix java docs
Test: make offline-sdk-docs
Bug: 112549021
Change-Id: I4c082f3e9547a768f9327cfaf874f3bba0dab8bf
2018-12-14 11:16:30 -08:00
Eric Laurent
7674052684 AudioEffect: make effect descriptor parcelable
Make AudioEffect.Descriptor class parcelable so that a list of
active effects can be included into AudioRecordingConfiguration.

Note: AudioEffect.Descriptor class was made final but it is OK as it
was never consumed by any SDK API.

Bug: 111438757
Test: make
Change-Id: I238b4ea47c613fd2abacc8729d9baf31423283a4
2018-12-13 10:49:51 -08:00