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

Commit 65fff059 authored by Ajay Panicker's avatar Ajay Panicker Committed by android-build-merger
Browse files

Merge "RE-APPLY: Use custom metadata object for all logging"

am: 57da5a7e

Change-Id: I7435bca526640663af817c89dbf1d73d6b890e76
parents 1119092b 57da5a7e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@ class GPMWrapper extends MediaPlayerWrapper {
        if (currItem == null || !qitem.equals(mdata)) {
            if (DEBUG) {
                Log.d(TAG, "Metadata currently out of sync for Google Play Music");
                Log.d(TAG, "  └ Current queueItem: " + currItem);
                Log.d(TAG, "  └ Current metadata : " + getMetadata());
                Log.d(TAG, "  └ Current queueItem: " + qitem);
                Log.d(TAG, "  └ Current metadata : " + mdata);
            }
            return false;
        }
+8 −7
Original line number Diff line number Diff line
@@ -209,8 +209,8 @@ class MediaPlayerWrapper {
            if (currItem == null || !qitem.equals(mdata)) {
                if (DEBUG) {
                    Log.d(TAG, "Metadata currently out of sync for " + mPackageName);
                    Log.d(TAG, "  └ Current queueItem: " + currItem);
                    Log.d(TAG, "  └ Current metadata : " + getMetadata().getDescription());
                    Log.d(TAG, "  └ Current queueItem: " + qitem);
                    Log.d(TAG, "  └ Current metadata : " + mdata);
                }
                return false;
            }
@@ -324,10 +324,11 @@ class MediaPlayerWrapper {
            }

            Log.e(TAG, "Timeout while waiting for metadata to sync for " + mPackageName);
            Log.e(TAG, "  └ Current Metadata: " + getMetadata().getDescription());
            Log.e(TAG, "  └ Current Metadata: " +  Util.toMetadata(getMetadata()));
            Log.e(TAG, "  └ Current Playstate: " + getPlaybackState());
            for (int i = 0; getQueue() != null && i < getQueue().size(); i++) {
                Log.e(TAG, "  └ QueueItem(" + i + "): " + getQueue().get(i));
            List<Metadata> current_queue = Util.toMetadataList(getQueue());
            for (int i = 0; i < current_queue.size(); i++) {
                Log.e(TAG, "  └ QueueItem(" + i + "): " + current_queue.get(i));
            }

            sendMediaUpdate();
@@ -387,7 +388,7 @@ class MediaPlayerWrapper {
                return;
            }

            Log.v(TAG, "onMetadataChanged(): " + mPackageName + " : " + metadata.getDescription());
            Log.v(TAG, "onMetadataChanged(): " + mPackageName + " : " + Util.toMetadata(metadata));

            if (!Objects.equals(metadata, getMetadata())) {
                e("The callback metadata doesn't match controller metadata");
@@ -462,7 +463,7 @@ class MediaPlayerWrapper {

            if (DEBUG) {
                for (int i = 0; i < current_queue.size(); i++) {
                    Log.d(TAG, "  └ QueueItem(" + i + "): " + queue.get(i));
                    Log.d(TAG, "  └ QueueItem(" + i + "): " + current_queue.get(i));
                }
            }

+3 −1
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ class Metadata implements Cloneable {
    @Override
    public String toString() {
        return "{ mediaId=\"" + mediaId + "\" title=\"" + title + "\" artist=\"" + artist
                + "\" album=\"" + album + "\" }";
                + "\" album=\"" + album + "\" duration=" + duration
                + " trackPosition=" + trackNum + "/" + numTracks + " }";

    }
}