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

Commit 921c55da authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 9e8d612c: am aab5b08c: AwesomePlayer: do not send events when paused.

* commit '9e8d612c':
  AwesomePlayer: do not send events when paused.
parents 7a72e2ac 9e8d612c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -798,8 +798,10 @@ void AwesomePlayer::onBufferingUpdate() {
        }
    }

    if (mFlags & (PLAYING | PREPARING)) {
        postBufferingEvent_l();
    }
}

void AwesomePlayer::sendCacheStats() {
    sp<MediaPlayerBase> listener = mListener.promote();
@@ -1001,6 +1003,10 @@ status_t AwesomePlayer::play_l() {
    }
    addBatteryData(params);

    if (isStreamingHTTP()) {
        postBufferingEvent_l();
    }

    return OK;
}

+6 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@
#include <media/stagefright/foundation/ALooper.h>
#include <binder/IServiceManager.h>
#include <powermanager/PowerManager.h>
#include <binder/IPCThreadState.h>
#include <utils/CallStack.h>

namespace android {

@@ -327,10 +329,12 @@ void TimedEventQueue::acquireWakeLock_l()
    }
    if (mPowerManager != 0) {
        sp<IBinder> binder = new BBinder();
        int64_t token = IPCThreadState::self()->clearCallingIdentity();
        status_t status = mPowerManager->acquireWakeLock(POWERMANAGER_PARTIAL_WAKE_LOCK,
                                                         binder,
                                                         String16("TimedEventQueue"),
                                                         String16("media"));
        IPCThreadState::self()->restoreCallingIdentity(token);
        if (status == NO_ERROR) {
            mWakeLockToken = binder;
        }
@@ -343,7 +347,9 @@ void TimedEventQueue::releaseWakeLock_l()
        return;
    }
    if (mPowerManager != 0) {
        int64_t token = IPCThreadState::self()->clearCallingIdentity();
        mPowerManager->releaseWakeLock(mWakeLockToken, 0);
        IPCThreadState::self()->restoreCallingIdentity(token);
    }
    mWakeLockToken.clear();
}