D7652: Better broadcast/neighbor networking

Daniel Tang noreply at phabricator.kde.org
Mon Sep 4 08:15:11 UTC 2017


daniel.z.tg added a comment.


  To make this easier to review, there are 4 main parts:
  
  **Part 1: GUI**
  Being on mobile data is now called being disconnected or "not being connected to any compatible networks". Non-English translations are needed.
  The disconnected error is now on top of the unreachable error.
  
  **Part 2: BackgroundSerivce**
  `BackgroundService` is now mostly `static`. A lot of changes resulted from changing the signature of `onServiceStart()` from `void (BackgroundService)` to `void ()`. Changes were mostly done automatically by finding and replacing references to the `service` field to the `BackgroundService` class, and refactoring the method signature.
  All calls to `onNetworkChange()` now go through `refreshNetwork()`.
  While making things static, `getDevices()` has been made to return `Collection<Device>` instead of `ConcurrentHashMap<String, Device>` because nobody cared about the key, and only wanted the `Collection<Device>` obtained through `values()`.
  
  **Part 3: Networking**
  `NetworkHelper` has finished switching to link-local broadcasts.
  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.
  Being disconnected is when there are no broadcast destinations.
  Calculations are cached, and tied to `BackgroundService.refreshNetwork()`.
  Listeners for tethering have been installed. The network change listener has been fixed for Android N ( https://developer.android.com/reference/android/net/ConnectivityManager.html#CONNECTIVITY_ACTION ).
  
  **Part 4: Optimization, etc.**
  Code affected by the other changes:
  
  - Has been simplified and/or optimized.
    - `LanLinkProvider`
    - `BackgroundService` and users
    - `CustomDevicesActivity` and users
    - `DeviceFragment`
  - Has its internal API changed from leaking implementation detail like `ArrayList foo()` to generic `List foo()` to make things easier to change.
    - `BackgroundService`
    - `CustomDevicesActivity`
  - Has been deduplicated.
    - `BackgroundService` users
    - `CustomDevicesActivity`

REPOSITORY
  R225 KDE Connect - Android application

REVISION DETAIL
  https://phabricator.kde.org/D7652

To: daniel.z.tg, #kde_connect
Cc: albertvaka, daniel.z.tg, jeanv, tfella, aboudhar, seebauer, bugzy, progwolff, MayeulC, menasshock, ach, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20170904/d6c92554/attachment-0001.html>


More information about the KDEConnect mailing list