2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 01:51:47 +00:00

7 Commits

Author SHA1 Message Date
Nicolas Fella
b3b74f25f4 Convert license headers to SPDX 2020-08-17 16:17:20 +02:00
Isira Seneviratne
52aafe6b8c Use ContextCompat.getSystemService() to retrieve system services without casting. 2020-07-07 16:47:39 +05:30
Anjani Kumar
74ecab507b Adding a layout file for ClipboardFloatinActivity. It contains an invisible button. 2020-04-21 15:15:49 +05:30
Anjani Kumar
34c80314ed This reverts commit 0fc5d0907827451092afed17fb04dc1b3417e316. 2020-04-21 15:15:49 +05:30
Albert Vaca Cintora
0fc5d09078 Revert send clipboard on Android X
This reverts 3 commits:

"Clipboard Plugin: Added support to send clipboard to multiple devices on Android 10 and later."
b92271105a5317c24e945e25a935875b0cf3cc2a

"Excluded ClipboardFloatingActivity from App recents Screen"
ee1562050c6517acffd312fbc00a2715a28ccdde

"Make Clipboard plugin work in Android X"
b81d3a82e5a71757388fffb4a3b3486aea74d1aa
2020-04-16 23:55:22 +02:00
Anjani Kumar
b92271105a Clipboard Plugin: Added support to send clipboard to multiple devices on Android 10 and later. 2020-04-14 10:28:57 +05:30
Anjani Kumar
b81d3a82e5 Make Clipboard plugin work in Android X
## Summary

Fixes #5

BUG: 417419](https://bugs.kde.org/show_bug.cgi?id=417419)

This patch introduces a workaround to access the restricted clipboard in Android X.
Clipboard synchronisation in KDE Connect was one of the killer features before Android X. An action button is added in the persistent foreground notification **Send Clipboard** which adds the ability to send the clipboard using a small workaround. Clipboard Synchronisation works as usual in lower Android Versions.

This is a very convenient workaround for sending clipboard quickly as it does not requires to open the app. Floating Activity is quite handy for quick actions.

## Details of the workaround

### ClipboardFloatingActivity

* This activity is only executed in Android X.
* This is transparent, accesses the clipboard when in focus.
* Sends a `NetworkPacket` containing *text* and *timestamp*.
* When the packet has been sent, it pops up a toast with a success message.
* Automatically closes after the showing the Toast.

### Reverted changes for Android X.

* Changes done in commits 54be4a1a997e14516353f5104ef1619f98ba99ec and 9f3b75b7483fe79527d635ad10a2bb7cf6496d8c have been reverted.
* These changes are not required anymore as the workaround for clipboard sync works.

The action button in the notification for **Send Clipboard** is not added in the lower versions of Android. **It is only added in Android X**.

**Two way sync is working in Android X with this patch. Sync works normally in lower Android versions.**

## Test Plan

### Before:

Clipboard from PC to Phones were synchronised but Clipboard of phones didn't get synchronised with the PC.

### After:

The action button is up in Android X while using other apps.

![Screenshot_20200227-150435_Chrome](/uploads/201960e1577321c8a77c9945bd2b5e76/Screenshot_20200227-150435_Chrome.png)

After clicking the button, a cute Toast appears with the message *Clipboard sent*

![Screenshot_20200228-233701_Chrome](/uploads/8da58b1006b95ce82c7cec2c91f32878/Screenshot_20200228-233701_Chrome.png)

I think this is one of the best workarounds available to make this awesome plugin work.
2020-03-12 03:56:37 +00:00