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

Commit 22152a68 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "No need to check a wp<> for 0 before promote()"

parents dc3ac850 e478742c
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -267,15 +267,12 @@ status_t AudioFlinger::dumpClients(int fd, const Vector<String16>& args)

    result.append("Clients:\n");
    for (size_t i = 0; i < mClients.size(); ++i) {
        wp<Client> wClient = mClients.valueAt(i);
        if (wClient != 0) {
            sp<Client> client = wClient.promote();
        sp<Client> client = mClients.valueAt(i).promote();
        if (client != 0) {
            snprintf(buffer, SIZE, "  pid: %d\n", client->pid());
            result.append(buffer);
        }
    }
    }

    result.append("Global session refs:\n");
    result.append(" session pid cnt\n");
@@ -1444,15 +1441,12 @@ status_t AudioFlinger::PlaybackThread::dumpTracks(int fd, const Vector<String16>
    result.append(buffer);
    result.append("   Name  Clien Typ Fmt Chn mask   Session Buf  S M F SRate LeftV RighV  Serv       User       Main buf   Aux Buf\n");
    for (size_t i = 0; i < mActiveTracks.size(); ++i) {
        wp<Track> wTrack = mActiveTracks[i];
        if (wTrack != 0) {
            sp<Track> track = wTrack.promote();
        sp<Track> track = mActiveTracks[i].promote();
        if (track != 0) {
            track->dump(buffer, SIZE);
            result.append(buffer);
        }
    }
    }
    write(fd, result.string(), result.size());
    return NO_ERROR;
}