Commit Graph

6544 Commits

Author SHA1 Message Date
Wei Jia
445198cc76 Merge "MediaPlayer2Impl: fix getBufferedPosition" into pi-dev am: 2e94d509b3
am: 5d129b909d

Change-Id: Idee279d8080e6a74cb0b080c9f89899ee1d5a17d
2018-03-10 08:38:37 +00:00
Marco Nelissen
95f468d032 Merge "Rework thumbnail cleanup" into oc-mr1-dev am: b20a329f4c am: 6db0f4dac8
am: 18001f79e5

Change-Id: Id348c43f719620070f4d26581d9c307f1827e609
2018-03-10 06:32:44 +00:00
TreeHugger Robot
2e94d509b3 Merge "MediaPlayer2Impl: fix getBufferedPosition" into pi-dev 2018-03-10 01:00:35 +00:00
Marco Nelissen
6db0f4dac8 Merge "Rework thumbnail cleanup" into oc-mr1-dev
am: b20a329f4c

Change-Id: I17b77312edb4fa03af1e89543ed5c27f4501d51c
2018-03-09 23:00:20 +00:00
Wei Jia
c3725a94bb MediaPlayer2Impl: fix getBufferedPosition
Test: MediaPlayer2 plays
Bug: 74204684
Change-Id: Ide7c2ebe7e29c16d427a8aa6aa4b0384e8a2539f
2018-03-09 14:50:04 -08:00
Hyundo Moon
93370a3f45 Merge "MediaSession2: Ensure NonNull/Nullable for parameters of public methods" into pi-dev am: 5cef8984ba
am: 2006407144

Change-Id: I5cff047f7200ed85424c473ffd699fcc2f3bddbb
2018-03-09 14:51:52 +00:00
Jaewan Kim
3004860bc9 Merge "MediaSession2: Implement MediaSession2#updatePlayer()" into pi-dev am: 790a31ee31
am: 9331c2d555

Change-Id: I08124bd3175a5f49953311ba28eda1424f0fcf83
2018-03-09 09:42:38 +00:00
Hyundo Moon
5cef8984ba Merge "MediaSession2: Ensure NonNull/Nullable for parameters of public methods" into pi-dev 2018-03-09 08:28:08 +00:00
Wei Jia
85dee97df4 Merge "MediaPlayer2Impl: fix getPlayerState." into pi-dev am: af6cb35749
am: 004f53709d

Change-Id: Id2e9482736df2ecbb57145af889859cb0c03f378
2018-03-09 07:55:09 +00:00
Hyundo Moon
c896d9d7e6 MediaSession2: Ensure NonNull/Nullable for parameters of public methods
Bug: 73863865
Test: runtest-MediaComponents
Change-Id: Id40f221ae60b1e63afd9ff71950589fe13a7f526
2018-03-09 14:00:11 +09:00
TreeHugger Robot
790a31ee31 Merge "MediaSession2: Implement MediaSession2#updatePlayer()" into pi-dev 2018-03-09 04:37:29 +00:00
TreeHugger Robot
af6cb35749 Merge "MediaPlayer2Impl: fix getPlayerState." into pi-dev 2018-03-09 03:10:41 +00:00
Wei Jia
be6e3024bd MediaPlayer2Impl: fix getPlayerState.
Test: MediaPlayer2 plays
Bug: 74204684
Change-Id: Ib27930287485f074be6a8df4a90fb78023153ccd
2018-03-08 13:56:42 -08:00
Marco Nelissen
6d2096f388 Rework thumbnail cleanup
Bug: 63766886
Test: ran CTS tests
Change-Id: I1f92bb014e275eafe3f42aef1f8c817f187c6608
2018-03-08 21:46:15 +00:00
Sungsoo Lim
8c9939908b Merge "Make MediaPlaylistAgent updatable" into pi-dev am: 5f0fb0c8fa
am: 4108911411

Change-Id: I25e4dae81ef808db9b81be9506df3f1c298029a2
2018-03-08 12:37:20 +00:00
Sungsoo Lim
b9c5b5c066 Merge "VideoView2: Remove setRouteAttributes" into pi-dev am: 3bfe2b15b8
am: 81594cc2ed

Change-Id: I32bf56a5dc38cb6816034ecf295f2e1e7194a149
2018-03-08 11:09:41 +00:00
Jaewan Kim
71467d42e2 Merge "MediaSession2: Clean up TODOs under frameworks/base" into pi-dev am: c23ee7639b
am: a0e1b5bbf8

Change-Id: Icc1e3f57d9ec5ec1922c49df224dcec3b86b65c5
2018-03-08 09:22:57 +00:00
Jaewan Kim
9af5bc8370 MediaSession2: Implement MediaSession2#updatePlayer()
Bug: 74364873
Test: Run MediaSession2Test in CTS
Change-Id: I5161c0d771afd5036e2c09b2cc2a165f80c534f7
2018-03-08 18:11:55 +09:00
Sungsoo Lim
5f8a8ee0e5 Make MediaPlaylistAgent updatable
Bug: 74366050
Test: build
Change-Id: Iea8e4d9b6a11393bd837da90394d95529fdbe5eb
2018-03-08 17:28:23 +09:00
Sungsoo Lim
ec75d51e74 VideoView2: Remove setRouteAttributes
Being consistent, create route player internally and do not expose it
since VideoView2 creats a MediaPlayer inside and do not expose it.

Bug: 72527212
Test: manually with VideoViewTest
Change-Id: I6db3bc668f6ab77587fed49b2d34611bc3c30465
2018-03-08 13:55:21 +09:00
Jaewan Kim
525c88c2b7 MediaSession2: Clean up TODOs under frameworks/base
This change includes
  - Addressed trivial TODOs (takes less than 1min)
  - Renamed playlist controller to playlist agent
  - Renamed mplc to playlistAgent
  - Renamed mpb to player
  - Assigned buganizer issues for TODOs

Bug: 74361045
Test: Run MediaComponentsTest
Change-Id: I45e97081b5a3f24988c3daadd007edcb51be5288
2018-03-08 13:54:34 +09:00
Jean-Michel Trivi
3ec338d06d Merge "AudioService: don't send BECOMING_NOISY when dyn policy affects media" into pi-dev am: 4e532f59dc
am: f686a34d6a

Change-Id: If9b2bae295b36944b7d35fcd09ab191d6750fe6f
2018-03-07 22:30:28 +00:00
Jean-Michel Trivi
4e532f59dc Merge "AudioService: don't send BECOMING_NOISY when dyn policy affects media" into pi-dev 2018-03-07 21:37:55 +00:00
Beverly
1cf28b4990 Merge "System sounds get its own dnd toggle" into pi-dev am: 5a169cf2f6
am: dd333ffb28

Change-Id: Idb2d6232174dffd81d26639e8041ef07b211f830
2018-03-07 17:09:36 +00:00
TreeHugger Robot
5a169cf2f6 Merge "System sounds get its own dnd toggle" into pi-dev 2018-03-07 16:39:40 +00:00
Jaewan Kim
d7674002d0 Merge "MediaSession2: Fix random NPE in MediaBrowser2Test" into pi-dev am: aa79f03ca6
am: 2c10f2e660

Change-Id: Ie9819e7f8cc8b29a10634369129958ab08ffc5ad
2018-03-07 11:56:28 +00:00
TreeHugger Robot
aa79f03ca6 Merge "MediaSession2: Fix random NPE in MediaBrowser2Test" into pi-dev 2018-03-07 11:23:29 +00:00
Sungsoo Lim
b69db671b4 Merge changes from topics "mplc", "session2_onDataSourceMissingHelper" into pi-dev am: be1033fda2
am: e09bf4f7cd

Change-Id: I3180681e4ca55ace1b3de87a360b880208937598
2018-03-07 08:38:49 +00:00
Jaewan Kim
5c44f9f0ab MediaSession2: Add SessionCallback#onCurrentMediaItemChanged() am: 87086f59ad
am: 37e3316bde

Change-Id: Ie202cea8fd16670180552428fd913cf161aed67e
2018-03-07 08:35:01 +00:00
Jaewan Kim
87e1bc08b1 MediaSession2: Add onDataSourceMissingHelper am: 4d4a8c95ae
am: a062aa3afe

Change-Id: I279f108ae063907910178fc74f073705fc0ed87e
2018-03-07 08:32:41 +00:00
Jaewan Kim
37e3316bde MediaSession2: Add SessionCallback#onCurrentMediaItemChanged()
am: 87086f59ad

Change-Id: I5861b8b3d24546b0064ddd7547da6b8906385c6c
2018-03-07 08:16:27 +00:00
Jaewan Kim
a062aa3afe MediaSession2: Add onDataSourceMissingHelper
am: 4d4a8c95ae

Change-Id: I9342ba46a9a88ff8a282816a7d492fa0ea439020
2018-03-07 08:12:02 +00:00
Sungsoo Lim
be1033fda2 Merge changes from topics "mplc", "session2_onDataSourceMissingHelper" into pi-dev
* changes:
  Remove MediaPlaylistController, add MediaPlaylistAgent
  MediaSession2: Add SessionCallback#onCurrentMediaItemChanged()
  MediaSession2: Add onDataSourceMissingHelper
2018-03-07 07:59:53 +00:00
Sungsoo Lim
df0e8fdffd Remove MediaPlaylistController, add MediaPlaylistAgent
MediaPlaylistAgent is the abstract class an application needs to
derive from to pass an object to a MediaSession2 that will override
default playlist handling behaviors. It contains a set of notify*
methods to signal MediaSession2 that playlist-related state has
changed.

Bug: 64098437
Test: make update-api
Change-Id: Icb3c57ddc14eba276f49d4ba85f11adbeb3e0917
2018-03-07 16:41:19 +09:00
Jaewan Kim
87086f59ad MediaSession2: Add SessionCallback#onCurrentMediaItemChanged()
Added callback for session to know the currently playing media item has
changed.

Note that the callback is called in response to the
MediaPlayerBase#PlayerEventCallback#onCurrentDataSourceChanged(mpb, dsd
is called. Session will translate dsd to the media item and calls
onCurrentMediaItemChanged().

Following changes are also included
  - Removed MediaPlaylistController#getCurrentPlaylistItem(),
    because currently playing item is managed by the MediaPlayerBase.
  - Renamed ControllerCallback#onCurrentPlaylistItemChanged() to the
    ControllerCallback#onCurrentMediaItemChanged(), to make it more
    obvious that the event is from MediaPlayerBase, not
    MediaPlaylistController.
  - Added SessionCallback#onCurrentMediaItemChanged()

Bug: 64098437
Test: Run MediaComponents test
Change-Id: I78b124a7da0f968b097b2576507b9a73e36081ec
2018-03-07 16:31:56 +09:00
Jaewan Kim
4d4a8c95ae MediaSession2: Add onDataSourceMissingHelper
This allows a developer to create DataSourceDesc when the item is about
to be played. Typical example of the usages are,

    1. For a playlist consists of FileDescriptors, its developer may not
        want to open all files when MediaSession2.setPlaylist() is
        called.
    2. A controller has called setPlaylist(), addPlaylistItem(), or
        replacePlaylistItem(). Controller cannot know the
        DataSourceDesc, and only the session developer can know about
        it.

Bug: 64098437
Test: Run MediaComponents test
Change-Id: I73f27ca0a799b1cddf5046b41f0ca01d08037103
2018-03-07 16:31:53 +09:00
Robert Shih
23d155d7f0 Merge "MediaPlayer2: embed header in uri" into pi-dev am: c943614f2c
am: d8c86aa40f

Change-Id: I430c387cd4d561718680c96cfe3688ec769dc0a3
2018-03-07 06:55:34 +00:00
TreeHugger Robot
c943614f2c Merge "MediaPlayer2: embed header in uri" into pi-dev 2018-03-07 04:26:18 +00:00
Android Build Merger (Role)
095d7cc5b0 Merge "Merge changes from topic "session2-pi-listcallback" into pi-dev am: ccf41b87a9 am: f5dbd73523" 2018-03-07 02:41:43 +00:00
TreeHugger Robot
f834155efc Merge "fix slow get caps" 2018-03-07 02:40:59 +00:00
Robert Shih
3164cbd536 MediaPlayer2: embed header in uri
Bug: 63934228
Change-Id: I3eba4a0ee8e8e784f6dcf79c739a756e957025c9
2018-03-06 18:18:52 -08:00
Jaewan Kim
ccf41b87a9 Merge changes from topic "session2-pi-listcallback" into pi-dev
* changes:
  MediaSession2: Pass player info for the callbacks from MediaPlayerBase
  MediaSession2: Add MediaPlaylistController.PlaylistEventCallback
2018-03-07 00:02:09 +00:00
Chong Zhang
90d7304a83 fix slow get caps
When get caps is called on an MediaCodec object, try to
use the codec info for that MediaCodec first as it should
be available during codec construction. Only when that
somehow failed go and initialize the full MediaCodecList,
as building the entire list could be very slow.

And when cloning the CodecCapabilities from MediaCodecInfo,
copy the fields directly and the fields (other than the ones
modifiable by client) are immutable after construction.

bug: 74073607

Test:
CTS media post submit:
cts-tradefed run cts-dev --module CtsMediaTestCases --compatibility:module-arg CtsMediaTestCases:include-annotation:android.platform.test.annotations.RequiresDevice

Change-Id: I4ae5f2431da8528e1eca093c5cfb98abcb4a5bbf
2018-03-06 23:51:27 +00:00
TreeHugger Robot
e9238246b7 Merge "MediaSession2: Ask server whether a controller is trusted" into pi-dev 2018-03-06 23:06:18 +00:00
Jean-Michel Trivi
7db2d8f1cc AudioService: don't send BECOMING_NOISY when dyn policy affects media
Only send ACTION_AUDIO_BECOMING_NOISY when there is no dynamic
  policy registered that affects media.

Bug: 67610473
Test: see bug
Change-Id: I0768718fbde35ea53c36c309086529567dfa82ac
2018-03-06 13:54:23 -08:00
Jaewan Kim
42a36c341d MediaSession2: Pass player info for the callbacks from MediaPlayerBase
Player can be updated meantime, and player event from the previous
player can be sent after the update. Providing player information will
provide developers more opportunity to filter out unecessary callbacks.

Bug: 64098437
Test: Run MediaComponents test
Change-Id: I9c23101df139e26351c008462c726ae7069130eb
2018-03-07 00:12:14 +09:00
Jaewan Kim
273130dc9a MediaSession2: Add MediaPlaylistController.PlaylistEventCallback
This includes following changes per offline discussion
  - Add MediaPlaylistController.PlaylistEventCallback
  - Add following APIs to the MediaPlaylistController
    * registerPlaylistControllerCallback() /
      unregisterPlaylistControllerCallback()
    * getRepeatMode() / setRepeatMode()
    * getShuffleMode() / setShuffleMode()
    * setPlaylist() with metadata
    * setPlaylistMetadata() / getPlaylistMetadata()
  - Add following APIs to the SessionCallback
    * onMediaPrepared()
    * onPlayerStateChanged()
    * onBufferingStateChanged()
  - Remove following methods from ControllerCallback
    * onPlaylistChanged()

Bug: 64098437
Bug: 74157064
Test: passed MediaComponentTest
Change-Id: I5ad12a9a5d6a7d9e23a577dca8ea26fbacb8f259
2018-03-07 00:11:25 +09:00
Beverly
d696476fb3 System sounds get its own dnd toggle
- Added logic for streams to be muted by dnd (unassociated with ringer)

Test: runtest -x frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java
Bug: 73362490
Change-Id: I1101e67282f7331497e91eb510d2bf4f1ea6b4b1
2018-03-06 09:08:29 -05:00
Jaewan Kim
b10e372284 MediaSession2: Fix random NPE in MediaBrowser2Test
MediaSessionService#getSession() may be null until the
MediaSessionService#onCreate(), and its session callback can be called
before that. (e.g. System service can try connecting to the session
in another thread)

Don't use MediaSessionService#getSession() when it's unclear whether
the MediaSessionService#onCreate() is finished.

Bug: 74177171
Test: Run MediaComponents test 10 times
Change-Id: I89f3d1a59f84f5d950a14a7b412cfbbdad2c8bee
2018-03-06 19:48:32 +09:00
TreeHugger Robot
9bc5610869 Merge "MediaSession2: Update Builder" into pi-dev 2018-03-06 08:59:13 +00:00