2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 18:07:55 +00:00

12 Commits

Author SHA1 Message Date
Albert Vaca Cintora
c70d03dbe8 Catch BackgroundServiceStartNotAllowedException 2023-05-26 20:21:40 +02:00
Albert Vaca Cintora
ae23413971 Refactor BackgroundService
Added a new KdeConnect Application class that holds the Devices now, while
BackgroundService "only" takes care of the LinkProviders.

Since KdeConnect subclasses Application we have the guarantee that it will
exist as long as our process does, so we can use it as a singleton. This
removes the "BackgroundService.RunCommand" hack (which sent an Intent that
would awake BackgroundService in case it wasn't running already and then
call our code in a callback). This saves lots of round trips between the
system and us and makes things simpler (and stack traces useful) by making
the code sequential.

We already had an Application subclass that I moved to a new helper, which
now the KdeConnect class initializes together with all the other helpers.
2023-05-24 19:28:02 +02:00
Albert Vaca Cintora
4b775cff88 Prettier RunCommand widget & add preview
Co-authored-by: Maxim Leshchenko <cnmaks90@gmail.com>
2023-04-01 21:14:14 +02:00
Albert Vaca Cintora
7670810155 Code review fixes 2023-03-29 16:32:40 +00:00
Albert Vaca Cintora
66a649313c Consolidate network listeners in BackgroundService
* Remove usage of deprecated WiFi ConnectivityManager
* Only listen for non-cellular network changes (where we can find devices)
* Do not listen for network changes also from PairingFragment
2023-03-29 16:32:40 +00:00
Albert Vaca Cintora
6fbd923c60 Bump dependencies and targetSdkVersion
Motivation: We can't publish to the Play Store with a targetSdkVersion < 31

The new targetSdk required two changes:

* Specifying when activities, services and receivers should be exported or
  not to other apps. For the ones I wasn't sure of what we want, I made
  them exported to not break something.
* Specifying when a PendingIntent should be mutable or immutable. I made
  them all mutable for now.
2022-12-27 23:53:13 +01:00
Isira Seneviratne
32c9dc5ad5 Use view binding in RunCommandActivity. 2020-07-24 10:50:15 +00:00
Isira Seneviratne
80121a7951 Use TextUtils' isEmpty() and equals(). 2020-07-09 14:24:17 +00:00
Nicolas Fella
f244daa5bf Organize imports 2018-12-24 17:43:46 +01:00
Albert Vaca
5dc02bbb75 Remove more unnecessary API version checks 2018-10-29 19:14:14 +01:00
Nicolas Fella
a49a145d69 Only use required access modifiers 2018-10-26 23:59:20 +02:00
Nicolas Fella
e0fde16525 Added runcommandplugin widget
Summary: A simple widget to execute commands from android desktop

Test Plan:
Add the widget and execute commands from it.
By default, the selected device is the first device in the device list.
The selected device can be changed via the widget title.
If there is no commands, the widget show an empty list
If there is no connected device, show the message located in @string/unreachable_description

Reviewers: albertvaka, nicolasfella, #kde_connect

Reviewed By: albertvaka

Subscribers: kdeconnect, nicolasfella

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D12507
2018-07-30 18:15:25 +02:00