Skip to content

Add option to cache URLs shared to unreachable devices

Vala Zadeh requested to merge backslashv/kdeconnect-android:master into master

Summary

This change allows for caching the HTTP/HTTPS URLs shared to paired but unreachable devices. Once those devices become reachable, the URLs are delivered to them. Often, users need to sent a webpage from their phone to their computer. Prior to this change, when the computer was offline, it would not appear in the KDE's share activity. With this change, the unreachable but paired devices will still show in KDE's share activity, and the user is able to share HTTP/HTTPS URLs to them. Once those devices become online, the previously shared URLs are delivered to them.

Test Plan

Test 1

  • Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
  • Make PC unreachable, e.g., close the KDE app on it.
  • On the phone, open Chrome and share a couple of webpages to KDE.
  • In this case, in the share activity, the unreachable device name should be shown in addition to "(Unreachable)" next to it, i.e., PC (Unreachable)
  • Click on PC (Unreachable).
  • Open the KDE app on the PC.
  • Observe that the webpages are opened on PC.

Test 2

  • Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
  • Make PC unreachable, e.g., close the KDE app on it.
  • On the phone, share a file to KDE.
  • In this case, in the share activity, the unreachable device name should not be shown (legacy behavior) since the intent does not contain a URL.

Test 3

  • Make sure two PC devices are already paired with the phone. Let's say the name of these devices are "PC1" and "PC2".
  • Make PC1 and PC2 unreachable, e.g., close the KDE app on them.
  • On the phone, open Chrome and share a couple of webpages to KDE.
  • In this case, in the share activity, the unreachable devices names should be shown in addition to "(Unreachable)" next to them, i.e., PC1 (Unreachable) and PC2 (Unreachable)
  • Click on PC1 (Unreachable).
  • Open the KDE app on the PC2.
  • Observe that the webpages are NOT opened on PC2.
  • Open the KDE app on the PC1.
  • Observe that the webpages are opened on PC1.

Test 4

  • Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
  • Make PC reachable, e.g., have the KDE app open on it.
  • Try to share a URL from the phone to the PC.
  • Observe that the URL opens instantly on the PC.
Edited by Vala Zadeh

Merge request reports