Commit f684fbe8 authored by Erik Duisters's avatar Erik Duisters

Migrate from android support libraries to androidx

Summary: Use the new AndroidX libraries instead of the legacy support libraries

Test Plan: Apply patch and verify everything works as before

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: shubham, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17818
parent 51c71f80
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
</activity> </activity>
<provider <provider
android:name="android.support.v4.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="org.kde.kdeconnect_tp.fileprovider" android:authorities="org.kde.kdeconnect_tp.fileprovider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">
......
apply plugin: 'com.android.application'
buildscript { buildscript {
repositories { repositories {
jcenter() jcenter()
...@@ -8,8 +10,6 @@ buildscript { ...@@ -8,8 +10,6 @@ buildscript {
} }
} }
apply plugin: 'com.android.application'
android { android {
compileSdkVersion 28 compileSdkVersion 28
defaultConfig { defaultConfig {
...@@ -69,10 +69,10 @@ dependencies { ...@@ -69,10 +69,10 @@ dependencies {
google() google()
} }
implementation 'com.android.support:support-media-compat:28.0.0' implementation 'androidx.media:media:1.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.android.support:preference-v7:28.0.0' implementation 'androidx.preference:preference:1.0.0'
implementation 'com.android.support:design:28.0.0' implementation 'com.google.android.material:material:1.0.0'
implementation 'com.jakewharton:disklrucache:2.0.2' //For caching album art bitmaps implementation 'com.jakewharton:disklrucache:2.0.2' //For caching album art bitmaps
implementation 'org.apache.sshd:sshd-core:0.14.0' implementation 'org.apache.sshd:sshd-core:0.14.0'
...@@ -80,8 +80,8 @@ dependencies { ...@@ -80,8 +80,8 @@ dependencies {
implementation 'com.madgag.spongycastle:bcpkix-jdk15on:1.58.0.0' //For SSL certificate generation implementation 'com.madgag.spongycastle:bcpkix-jdk15on:1.58.0.0' //For SSL certificate generation
implementation 'com.jakewharton:butterknife:9.0.0-rc2' implementation 'com.jakewharton:butterknife:9.0.0-rc3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc2' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'
// Testing // Testing
androidTestImplementation 'org.mockito:mockito-core:1.10.19' androidTestImplementation 'org.mockito:mockito-core:1.10.19'
......
android.enableJetifier=true
android.useAndroidX=true
\ No newline at end of file
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
android:padding="16dp" android:padding="16dp"
android:visibility="gone"> android:visibility="gone">
<android.support.v7.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/error_message_icon" android:id="@+id/error_message_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true"> <!-- fitSystemWindows to make the drawer slide below the Lollipop transparent status bar --> android:fitsSystemWindows="true"> <!-- fitSystemWindows to make the drawer slide below the Lollipop transparent status bar -->
<android.support.design.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinatorLayout" android:id="@+id/coordinatorLayout"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="match_parent" android:layout_width="match_parent"
tools:context="org.kde.kdeconnect.UserInterface.MainActivity"> tools:context="org.kde.kdeconnect.UserInterface.MainActivity">
<android.support.design.widget.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:elevation="8dp"/> android:elevation="8dp"/>
</android.support.design.widget.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<FrameLayout <FrameLayout
android:id="@+id/container" android:id="@+id/container"
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/> app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView <com.google.android.material.navigation.NavigationView
android:id="@+id/navigation_drawer" android:id="@+id/navigation_drawer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -40,4 +40,4 @@ ...@@ -40,4 +40,4 @@
app:headerLayout="@layout/nav_header" app:headerLayout="@layout/nav_header"
style="?attr/mainNavigationViewStyle" /> style="?attr/mainNavigationViewStyle" />
</android.support.v4.widget.DrawerLayout> </androidx.drawerlayout.widget.DrawerLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ListView <ListView
android:id="@+id/runcommandslist" android:id="@+id/runcommandslist"
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:addStatesFromChildren="true" android:addStatesFromChildren="true"
android:orientation="vertical" /> android:orientation="vertical" />
<android.support.design.widget.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/add_command_button" android:id="@+id/add_command_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -33,4 +33,4 @@ ...@@ -33,4 +33,4 @@
android:textAlignment="center" android:textAlignment="center"
android:textSize="16sp" /> android:textSize="16sp" />
</android.support.design.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/refresh_list_layout" android:id="@+id/refresh_list_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ListView <ListView
android:id="@+id/devices_list" android:id="@+id/devices_list"
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
android:paddingRight="16dip" android:paddingRight="16dip"
tools:context=".MainActivity" /> tools:context=".MainActivity" />
</android.support.v4.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="16dp"> android:paddingRight="16dp">
<android.support.v7.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/list_item_entry_icon" android:id="@+id/list_item_entry_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
android:layout_marginTop="8dip" android:layout_marginTop="8dip"
android:orientation="horizontal"> android:orientation="horizontal">
<android.support.v7.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/imageView" android:id="@+id/imageView"
android:layout_width="30dip" android:layout_width="30dip"
android:layout_height="30dip" android:layout_height="30dip"
......
<android.support.v7.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/dark_theme" android:id="@+id/dark_theme"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</RelativeLayout> </RelativeLayout>
<android.support.v7.widget.AppCompatImageButton <androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/settingsButton" android:id="@+id/settingsButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -32,7 +32,6 @@ import android.net.ConnectivityManager; ...@@ -32,7 +32,6 @@ import android.net.ConnectivityManager;
import android.os.Binder; import android.os.Binder;
import android.os.Build; import android.os.Build;
import android.os.IBinder; import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
...@@ -53,6 +52,8 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -53,6 +52,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import androidx.core.app.NotificationCompat;
//import org.kde.kdeconnect.Backends.BluetoothBackend.BluetoothLinkProvider; //import org.kde.kdeconnect.Backends.BluetoothBackend.BluetoothLinkProvider;
public class BackgroundService extends Service { public class BackgroundService extends Service {
......
...@@ -30,8 +30,6 @@ import android.content.res.Resources; ...@@ -30,8 +30,6 @@ import android.content.res.Resources;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.ContextCompat;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
...@@ -61,6 +59,9 @@ import java.util.Vector; ...@@ -61,6 +59,9 @@ import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
public class Device implements BaseLink.PacketReceiver { public class Device implements BaseLink.PacketReceiver {
private final Context context; private final Context context;
......
...@@ -28,8 +28,6 @@ import android.net.Uri; ...@@ -28,8 +28,6 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.provider.ContactsContract; import android.provider.ContactsContract;
import android.provider.ContactsContract.PhoneLookup; import android.provider.ContactsContract.PhoneLookup;
import android.support.annotation.RequiresApi;
import android.support.v4.util.LongSparseArray;
import android.util.Base64; import android.util.Base64;
import android.util.Base64OutputStream; import android.util.Base64OutputStream;
import android.util.Log; import android.util.Log;
...@@ -48,6 +46,9 @@ import java.util.List; ...@@ -48,6 +46,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import androidx.annotation.RequiresApi;
import androidx.collection.LongSparseArray;
public class ContactsHelper { public class ContactsHelper {
......
...@@ -27,7 +27,6 @@ import android.net.Uri; ...@@ -27,7 +27,6 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Looper; import android.os.Looper;
import android.provider.Telephony; import android.provider.Telephony;
import android.support.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import org.json.JSONException; import org.json.JSONException;
...@@ -41,6 +40,8 @@ import java.util.concurrent.locks.Condition; ...@@ -41,6 +40,8 @@ import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import androidx.annotation.RequiresApi;
public class SMSHelper { public class SMSHelper {
/** /**
......
...@@ -25,7 +25,6 @@ import android.content.SharedPreferences; ...@@ -25,7 +25,6 @@ import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.view.GestureDetector; import android.view.GestureDetector;
import android.view.HapticFeedbackConstants; import android.view.HapticFeedbackConstants;
import android.view.Menu; import android.view.Menu;
...@@ -39,6 +38,8 @@ import org.kde.kdeconnect.BackgroundService; ...@@ -39,6 +38,8 @@ import org.kde.kdeconnect.BackgroundService;
import org.kde.kdeconnect.UserInterface.ThemeUtil; import org.kde.kdeconnect.UserInterface.ThemeUtil;
import org.kde.kdeconnect_tp.R; import org.kde.kdeconnect_tp.R;
import androidx.appcompat.app.AppCompatActivity;
public class MousePadActivity extends AppCompatActivity implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener, MousePadGestureDetector.OnGestureListener { public class MousePadActivity extends AppCompatActivity implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener, MousePadGestureDetector.OnGestureListener {
private String deviceId; private String deviceId;
......
...@@ -23,12 +23,13 @@ package org.kde.kdeconnect.Plugins.MousePadPlugin; ...@@ -23,12 +23,13 @@ package org.kde.kdeconnect.Plugins.MousePadPlugin;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import org.kde.kdeconnect.NetworkPacket; import org.kde.kdeconnect.NetworkPacket;
import org.kde.kdeconnect.Plugins.Plugin; import org.kde.kdeconnect.Plugins.Plugin;
import org.kde.kdeconnect_tp.R; import org.kde.kdeconnect_tp.R;
import androidx.core.content.ContextCompat;
public class MousePadPlugin extends Plugin { public class MousePadPlugin extends Plugin {
//public final static String PACKET_TYPE_MOUSEPAD = "kdeconnect.mousepad"; //public final static String PACKET_TYPE_MOUSEPAD = "kdeconnect.mousepad";
......
...@@ -28,7 +28,6 @@ import android.graphics.BitmapFactory; ...@@ -28,7 +28,6 @@ import android.graphics.BitmapFactory;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.support.v4.util.LruCache;
import android.util.Log; import android.util.Log;
import com.jakewharton.disklrucache.DiskLruCache; import com.jakewharton.disklrucache.DiskLruCache;
...@@ -47,6 +46,8 @@ import java.security.MessageDigest; ...@@ -47,6 +46,8 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.ArrayList; import java.util.ArrayList;
import androidx.collection.LruCache;
/** /**
* Handles the cache for album art * Handles the cache for album art
*/ */
......
...@@ -27,10 +27,6 @@ import android.os.Bundle; ...@@ -27,10 +27,6 @@ import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentManager;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
...@@ -46,13 +42,18 @@ import org.kde.kdeconnect.Backends.BaseLink; ...@@ -46,13 +42,18 @@ import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.Backends.BaseLinkProvider; import org.kde.kdeconnect.Backends.BaseLinkProvider;
import org.kde.kdeconnect.BackgroundService; import org.kde.kdeconnect.BackgroundService;
import org.kde.kdeconnect.Device; import org.kde.kdeconnect.Device;
import org.kde.kdeconnect.Plugins.SystemvolumePlugin.SystemvolumeFragment;
import org.kde.kdeconnect.NetworkPacket; import org.kde.kdeconnect.NetworkPacket;
import org.kde.kdeconnect.Plugins.SystemvolumePlugin.SystemvolumeFragment;
import org.kde.kdeconnect.UserInterface.ThemeUtil; import org.kde.kdeconnect.UserInterface.ThemeUtil;
import org.kde.kdeconnect_tp.R; import org.kde.kdeconnect_tp.R;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.fragment.app.FragmentManager;
public class MprisActivity extends AppCompatActivity { public class MprisActivity extends AppCompatActivity {
private String deviceId; private String deviceId;
......
...@@ -30,12 +30,9 @@ import android.os.Handler; ...@@ -30,12 +30,9 @@ import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.os.Message; import android.os.Message;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.TaskStackBuilder;
import android.support.v4.media.MediaMetadataCompat; import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaSessionCompat; import android.support.v4.media.session.MediaSessionCompat;
import android.support.v4.media.session.PlaybackStateCompat; import android.support.v4.media.session.PlaybackStateCompat;
import android.support.v4.media.app.NotificationCompat.MediaStyle;
import org.kde.kdeconnect.BackgroundService; import org.kde.kdeconnect.BackgroundService;
import org.kde.kdeconnect.Device; import org.kde.kdeconnect.Device;
...@@ -44,6 +41,10 @@ import org.kde.kdeconnect_tp.R; ...@@ -44,6 +41,10 @@ import org.kde.kdeconnect_tp.R;
import java.util.HashSet; import java.util.HashSet;
import androidx.core.app.NotificationCompat;
import androidx.core.app.TaskStackBuilder;
import androidx.media.app.NotificationCompat.MediaStyle;
/** /**
* Controls the mpris media control notification * Controls the mpris media control notification
* <p> * <p>
...@@ -319,7 +320,7 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh ...@@ -319,7 +320,7 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
.setSmallIcon(R.drawable.ic_play_white) .setSmallIcon(R.drawable.ic_play_white)
.setShowWhen(false) .setShowWhen(false)
.setColor(service.getResources().getColor(R.color.primary)) .setColor(service.getResources().getColor(R.color.primary))
.setVisibility(android.support.v4.app.NotificationCompat.VISIBILITY_PUBLIC); .setVisibility(androidx.core.app.NotificationCompat.VISIBILITY_PUBLIC);
if (!notificationPlayer.getTitle().isEmpty()) { if (!notificationPlayer.getTitle().isEmpty()) {
notification.setContentTitle(notificationPlayer.getTitle()); notification.setContentTitle(notificationPlayer.getTitle());
......
...@@ -26,7 +26,6 @@ import android.graphics.Bitmap; ...@@ -26,7 +26,6 @@ import android.graphics.Bitmap;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.support.v4.content.ContextCompat;
import android.util.Log; import android.util.Log;
import org.kde.kdeconnect.NetworkPacket; import org.kde.kdeconnect.NetworkPacket;
...@@ -41,6 +40,8 @@ import java.util.HashMap; ...@@ -41,6 +40,8 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import androidx.core.content.ContextCompat;
public class MprisPlugin extends Plugin { public class MprisPlugin extends Plugin {
public class MprisPlayer { public class MprisPlayer {
private String player = ""; private String player = "";
......
...@@ -24,9 +24,10 @@ import android.media.MediaMetadata; ...@@ -24,9 +24,10 @@ import android.media.MediaMetadata;
import android.media.session.MediaController; import android.media.session.MediaController;
import android.media.session.PlaybackState; import android.media.session.PlaybackState;
import android.os.Build; import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.NonNull;
import android.support.annotation.RequiresApi; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
......
...@@ -24,7 +24,8 @@ import android.media.MediaMetadata; ...@@ -24,7 +24,8 @@ import android.media.MediaMetadata;
import android.media.session.MediaController; import android.media.session.MediaController;
import android.media.session.PlaybackState; import android.media.session.PlaybackState;
import android.os.Build; import android.os.Build;
import android.support.annotation.RequiresApi;
import androidx.annotation.RequiresApi;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
class MprisReceiverPlayer { class MprisReceiverPlayer {
......
...@@ -31,8 +31,6 @@ import android.os.Build; ...@@ -31,8 +31,6 @@ import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import org.kde.kdeconnect.Helpers.AppsHelper; import org.kde.kdeconnect.Helpers.AppsHelper;
...@@ -45,6 +43,9 @@ import org.kde.kdeconnect_tp.R; ...@@ -45,6 +43,9 @@ import org.kde.kdeconnect_tp.R;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class MprisReceiverPlugin extends Plugin implements MediaSessionManager.OnActiveSessionsChangedListener { public class MprisReceiverPlugin extends Plugin implements MediaSessionManager.OnActiveSessionsChangedListener {
......
...@@ -30,7 +30,6 @@ import android.graphics.Canvas; ...@@ -30,7 +30,6 @@ import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -41,13 +40,14 @@ import android.widget.CheckedTextView; ...@@ -41,13 +40,14 @@ import android.widget.CheckedTextView;
import android.widget.ListView; import android.widget.ListView;
import org.kde.kdeconnect.BackgroundService; import org.kde.kdeconnect.BackgroundService;
import org.kde.kdeconnect.Helpers.StringsHelper;
import org.kde.kdeconnect.UserInterface.ThemeUtil; import org.kde.kdeconnect.UserInterface.ThemeUtil;
import org.kde.kdeconnect_tp.R; import org.kde.kdeconnect_tp.R;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import androidx.appcompat.app.AppCompatActivity;
public class NotificationFilterActivity extends AppCompatActivity { public class NotificationFilterActivity extends AppCompatActivity {
private AppDatabase appDatabase; private AppDatabase appDatabase;
......
...@@ -26,12 +26,13 @@ import android.content.Intent; ...@@ -26,12 +26,13 @@ import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification;
import android.support.annotation.RequiresApi;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;