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

Commit 4f76070b authored by Ajay Panicker's avatar Ajay Panicker Committed by Gerrit Code Review
Browse files

Merge "Use custom metadata object for all logging"

parents 98c49931 39a67c79
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -46,8 +46,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().getDescription());
                Log.d(TAG, "  └ Current queueItem: " + qitem);
                Log.d(TAG, "  └ Current metadata : " + mdata);
            }
            return false;
        }
+8 −7
Original line number Diff line number Diff line
@@ -208,8 +208,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;
            }
@@ -294,10 +294,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));
            }

            // TODO(apanicke): Add metric collection here.
@@ -374,7 +375,7 @@ class MediaPlayerWrapper {
                return;
            }

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

            if (!metadata.equals(getMetadata())) {
                e("The callback metadata doesn't match controller metadata");
@@ -447,7 +448,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 + " }";

    }
}