<table><tr><td style="">mtijink requested changes to this revision.<br />mtijink added a comment.<br />This revision now requires changes to proceed.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12559">View Revision</a></tr></table><br /><div><div><p>Sorry, thought of a couple of new things.</p>
<p>I tested it, and there's still an issue: updates (e.g. after next/previous) aren't displayed in KCApp. I don't know on which side the issue is.<br />
Also, it is cool that I can control my pc's music via my phone's KDE Connect, but I think we should blacklist that.</p></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12559#inline-64409">View Inline</a><span style="color: #4b4d51; font-weight: bold;">MprisReceiverPlayer.java:43</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">if</span> <span style="color: #aa2211">(</span><span class="n">controller</span><span style="color: #aa2211">.</span><span style="color: #354bb3">getPlaybackState</span><span style="color: #aa2211">()</span> <span style="color: #aa2211">!=</span> <span style="color: #000a65">null</span><span style="color: #aa2211">)</span> <span style="color: #aa2211">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">isPlaying</span> <span style="color: #aa2211">=</span> <span class="n">controller</span><span style="color: #aa2211">.</span><span style="color: #354bb3">getPlaybackState</span><span style="color: #aa2211">().</span><span style="color: #354bb3">getState</span><span style="color: #aa2211">()</span> <span style="color: #aa2211">==</span> <span class="n">PlaybackState</span><span style="color: #aa2211">.</span><span style="color: #354bb3">STATE_PLAYING</span><span style="color: #aa2211">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">What happens otherwise? It defaults to <tt style="background: #ebebeb; font-size: 13px;">false</tt>?</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12559#inline-64410">View Inline</a><span style="color: #4b4d51; font-weight: bold;">MprisReceiverPlayer.java:77</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">String</span> <span style="color: #004012">getAlbum</span><span style="color: #aa2211">()</span> <span style="color: #aa2211">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span class="n">String</span> <span class="n">album</span> <span style="color: #aa2211">=</span> <span class="n">controller</span><span style="color: #aa2211">.</span><span style="color: #354bb3">getMetadata</span><span style="color: #aa2211">().</span><span style="color: #354bb3">getString</span><span style="color: #aa2211">(</span><span class="n">MediaMetadata</span><span style="color: #aa2211">.</span><span style="color: #354bb3">METADATA_KEY_ALBUM</span><span style="color: #aa2211">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">return</span> <span class="n">album</span> <span style="color: #aa2211">!=</span> <span style="color: #000a65">null</span> <span style="color: #aa2211">?</span> <span class="n">album</span> <span style="color: #aa2211">:</span> <span style="color: #766510">""</span><span style="color: #aa2211">;</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">I think we need to check <tt style="background: #ebebeb; font-size: 13px;">controller.getMetadata()</tt>, it can be <tt style="background: #ebebeb; font-size: 13px;">null</tt>. See <a href="https://developer.android.com/reference/android/media/session/MediaController#getMetadata()" class="remarkup-link" target="_blank" rel="noreferrer">https://developer.android.com/reference/android/media/session/MediaController#getMetadata()</a></p>
<p style="padding: 0; margin: 8px;">Also applies elsewhere.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12559#inline-64411">View Inline</a><span style="color: #4b4d51; font-weight: bold;">MprisReceiverPlayer.java:100</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">int</span> <span style="color: #004012">getVolume</span><span style="color: #aa2211">()</span> <span style="color: #aa2211">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa4000">return</span> <span style="color: #601200">100</span> <span style="color: #aa2211">*</span> <span class="n">controller</span><span style="color: #aa2211">.</span><span style="color: #354bb3">getPlaybackInfo</span><span style="color: #aa2211">().</span><span style="color: #354bb3">getCurrentVolume</span><span style="color: #aa2211">()</span> <span style="color: #aa2211">/</span> <span class="n">controller</span><span style="color: #aa2211">.</span><span style="color: #354bb3">getPlaybackInfo</span><span style="color: #aa2211">().</span><span style="color: #354bb3">getMaxVolume</span><span style="color: #aa2211">();</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);"> <span style="color: #aa2211">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Can also be <tt style="background: #ebebeb; font-size: 13px;">null</tt>.</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D12559#inline-64125">View Inline</a><span style="color: #4b4d51; font-weight: bold;">nicolasfella</span> wrote in <span style="color: #4b4d51; font-weight: bold;">MprisReceiverPlugin.java:187</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Did not find it yet</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">It looks as if the id is a package name, so we can look up the app name in most cases: <a href="https://developer.android.com/reference/android/content/pm/PackageManager.html#getApplicationInfo(java.lang.String,%20int)" class="remarkup-link" target="_blank" rel="noreferrer">https://developer.android.com/reference/android/content/pm/PackageManager.html#getApplicationInfo(java.lang.String,%20int)</a> and <a href="https://developer.android.com/reference/android/content/pm/PackageManager.html#getApplicationLabel(android.content.pm.ApplicationInfo)" class="remarkup-link" target="_blank" rel="noreferrer">https://developer.android.com/reference/android/content/pm/PackageManager.html#getApplicationLabel(android.content.pm.ApplicationInfo)</a></p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R225 KDE Connect - Android application</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12559">https://phabricator.kde.org/D12559</a></div></div><br /><div><strong>To: </strong>nicolasfella, KDE Connect, mtijink<br /><strong>Cc: </strong>mtijink, KDE Connect, yannux, Danial0_0, johnq, Pitel, adeen-s, SemperPeritus, ahmedbesbes, ndavis, daniel.z.tg, jeanv, seebauer, bugzy, MayeulC, menasshock, ach, apol<br /></div>