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

Commit 48b3aca5 authored by Robert Shih's avatar Robert Shih Committed by android-build-merger
Browse files

DO NOT MERGE MediaPlayerService: avoid invalid static cast am: c159a5ae

am: 2cee1dee

Change-Id: I0cde33c6f069de9eac4e954e9c6ed6f6968546be
parents 53657baf 2cee1dee
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -497,6 +497,12 @@ void MediaPlayerService::removeClient(wp<Client> client)
    mClients.remove(client);
    mClients.remove(client);
}
}


bool MediaPlayerService::hasClient(wp<Client> client)
{
    Mutex::Autolock lock(mLock);
    return mClients.indexOf(client) != NAME_NOT_FOUND;
}

MediaPlayerService::Client::Client(
MediaPlayerService::Client::Client(
        const sp<MediaPlayerService>& service, pid_t pid,
        const sp<MediaPlayerService>& service, pid_t pid,
        int32_t connId, const sp<IMediaPlayerClient>& client,
        int32_t connId, const sp<IMediaPlayerClient>& client,
@@ -926,6 +932,10 @@ status_t MediaPlayerService::Client::setNextPlayer(const sp<IMediaPlayer>& playe
    ALOGV("setNextPlayer");
    ALOGV("setNextPlayer");
    Mutex::Autolock l(mLock);
    Mutex::Autolock l(mLock);
    sp<Client> c = static_cast<Client*>(player.get());
    sp<Client> c = static_cast<Client*>(player.get());
    if (!mService->hasClient(c)) {
      return BAD_VALUE;
    }

    mNextClient = c;
    mNextClient = c;


    if (c != NULL) {
    if (c != NULL) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -276,6 +276,7 @@ public:
            const char *host, int32_t port, const char *exclusionList);
            const char *host, int32_t port, const char *exclusionList);


            void                removeClient(wp<Client> client);
            void                removeClient(wp<Client> client);
            bool                hasClient(wp<Client> client);


    // For battery usage tracking purpose
    // For battery usage tracking purpose
    struct BatteryUsageInfo {
    struct BatteryUsageInfo {