<table><tr><td style="">daniel.z.tg added a comment.
</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/D7652" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>To make this easier to review, there are 4 main parts:</p>
<p><strong>Part 1: GUI</strong><br />
Being on mobile data is now called being disconnected or "not being connected to any compatible networks". Non-English translations are needed.<br />
The disconnected error is now on top of the unreachable error.</p>
<p><strong>Part 2: BackgroundSerivce</strong><br />
<tt style="background: #ebebeb; font-size: 13px;">BackgroundService</tt> is now mostly <tt style="background: #ebebeb; font-size: 13px;">static</tt>. A lot of changes resulted from changing the signature of <tt style="background: #ebebeb; font-size: 13px;">onServiceStart()</tt> from <tt style="background: #ebebeb; font-size: 13px;">void (BackgroundService)</tt> to <tt style="background: #ebebeb; font-size: 13px;">void ()</tt>. Changes were mostly done automatically by finding and replacing references to the <tt style="background: #ebebeb; font-size: 13px;">service</tt> field to the <tt style="background: #ebebeb; font-size: 13px;">BackgroundService</tt> class, and refactoring the method signature.<br />
All calls to <tt style="background: #ebebeb; font-size: 13px;">onNetworkChange()</tt> now go through <tt style="background: #ebebeb; font-size: 13px;">refreshNetwork()</tt>.<br />
While making things static, <tt style="background: #ebebeb; font-size: 13px;">getDevices()</tt> has been made to return <tt style="background: #ebebeb; font-size: 13px;">Collection<Device></tt> instead of <tt style="background: #ebebeb; font-size: 13px;">ConcurrentHashMap<String, Device></tt> because nobody cared about the key, and only wanted the <tt style="background: #ebebeb; font-size: 13px;">Collection<Device></tt> obtained through <tt style="background: #ebebeb; font-size: 13px;">values()</tt>.</p>
<p><strong>Part 3: Networking</strong><br />
<tt style="background: #ebebeb; font-size: 13px;">NetworkHelper</tt> has finished switching to link-local broadcasts.<br />
Code for "255.255.255.255" has been left in, but is disabled, so that we can switch back if we have problems. A GUI toggle could be added.<br />
Being disconnected is when there are no broadcast destinations.<br />
Calculations are cached, and tied to <tt style="background: #ebebeb; font-size: 13px;">BackgroundService.refreshNetwork()</tt>.<br />
Listeners for tethering have been installed. The network change listener has been fixed for Android N ( <a href="https://developer.android.com/reference/android/net/ConnectivityManager.html#CONNECTIVITY_ACTION" class="remarkup-link" target="_blank" rel="noreferrer">https://developer.android.com/reference/android/net/ConnectivityManager.html#CONNECTIVITY_ACTION</a> ).</p>
<p><strong>Part 4: Optimization, etc.</strong><br />
Code affected by the other changes:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Has been simplified and/or optimized.<ul class="remarkup-list">
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">LanLinkProvider</tt></li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">BackgroundService</tt> and users</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">CustomDevicesActivity</tt> and users</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">DeviceFragment</tt></li>
</ul></li>
<li class="remarkup-list-item">Has its internal API changed from leaking implementation detail like <tt style="background: #ebebeb; font-size: 13px;">ArrayList foo()</tt> to generic <tt style="background: #ebebeb; font-size: 13px;">List foo()</tt> to make things easier to change.<ul class="remarkup-list">
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">BackgroundService</tt></li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">CustomDevicesActivity</tt></li>
</ul></li>
<li class="remarkup-list-item">Has been deduplicated.<ul class="remarkup-list">
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">BackgroundService</tt> users</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">CustomDevicesActivity</tt></li>
</ul></li>
</ul></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/D7652" rel="noreferrer">https://phabricator.kde.org/D7652</a></div></div><br /><div><strong>To: </strong>daniel.z.tg, KDE Connect<br /><strong>Cc: </strong>albertvaka, daniel.z.tg, jeanv, tfella, aboudhar, seebauer, bugzy, progwolff, MayeulC, menasshock, ach, apol<br /></div>