Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5e79003 authored by Wei Jia's avatar Wei Jia
Browse files

MediaPlayer2: allow prepared->pause

Test: cts
Bug: 112549021
Change-Id: Ifa6c556347b0e50d2a054aa43810294fd3cf0e95
parent c981b8cf
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -254,22 +254,6 @@ public final class MediaPlayer2Impl extends MediaPlayer2 {
            void process() {
                stayAwake(false);

                // TODO: remove this block when native code allows prepared -> pause
                // and sends MEDIA_INFO_DATA_SOURCE_START when pipeline is created.
                if (getState() == PLAYER_STATE_PREPARED) {
                    final DataSourceDesc dsd;
                    synchronized (mSrcLock) {
                        dsd = mCurrentDSD;
                    }
                    sendEvent(new EventNotifier() {
                        @Override
                        public void notify(EventCallback callback) {
                            callback.onInfo(
                                    MediaPlayer2Impl.this, dsd, MEDIA_INFO_DATA_SOURCE_START, 0);
                        }
                    });
                }

                _pause();
            }
        });