Starting next month (September 2023) it will be required to target
Android 13 to publish to the Play Store.
On Android 13, we need to request the POST_NOTIFICATIONS permission.
This change adds the permission as required/optional to the plugins
that do create notifications. It also adds a popup to request it the
first time you open the app.
Since we now require API 21, we can use setAudioAttributes instead of
the deprecated setAudioStreamType.
Since we already require WAKE_LOCK for the SMS plugin, we can use it
here to prevent the screen from sleeping.
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.
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.
We were using the device context, which is not suitable to start an
Activity, causing "android.util.AndroidRuntimeException: Calling
startActivity() from outside of an Activity."
Summary:
PreferenceActivity has been deprecated since Android 3.0 API 11 in favour of PreferenceFragment
| {F6515113} | {F6515114}|
|Before|
| {F6515111} | {F6515112}|
|After|
Test Plan:
Apply patch and observe that the DeviceSettings and PluginSettings screen behave as expected
and now also follow material design guidelines
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17859
Summary: KDE Connect, now with correct naming!
Test Plan: It still builds.
Reviewers: #kde_connect, apol, nicolasfella
Reviewed By: #kde_connect, apol, nicolasfella
Subscribers: nicolasfella, apol
Differential Revision: https://phabricator.kde.org/D11035
Summary:
BUG: 379023
Let users choose a ring tone in the settings.
Test Plan: Open settings, choose a ringtone, search for device.
Reviewers: #kde_connect, albertvaka
Reviewed By: #kde_connect, albertvaka
Subscribers: mtijink, andyholmes, albertvaka, apol, #kde_connect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D10332