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

Commit f47634ed authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Fix dump formatting of RemoteControlClient playback state dump

Take into account the two types of undefined plyback position.
Only use "ms" unit when there is a position to write.
Fix misplaced ",".

Change-Id: I5033ec6ee7480f1ac525af7b7b0a9da259614783
parent d1233575
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -974,10 +974,17 @@ public class MediaFocusControl implements OnFinished {

        @Override
        public String toString() {
            return stateToString() + ", "
                    + ((mPositionMs == RemoteControlClient.PLAYBACK_POSITION_INVALID) ?
                            "PLAYBACK_POSITION_INVALID ," : String.valueOf(mPositionMs)) + "ms ,"
                    + mSpeed + "X";
            return stateToString() + ", " + posToString() + ", " + mSpeed + "X";
        }

        private String posToString() {
            if (mPositionMs == RemoteControlClient.PLAYBACK_POSITION_INVALID) {
                return "PLAYBACK_POSITION_INVALID";
            } else if (mPositionMs == RemoteControlClient.PLAYBACK_POSITION_ALWAYS_UNKNOWN) {
                return "PLAYBACK_POSITION_ALWAYS_UNKNOWN";
            } else {
                return (String.valueOf(mPositionMs) + "ms");
            }
        }

        private String stateToString() {