From acbea545d0cac3211cc0e3dfa8f47f8ae15f1bdd Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Fri, 10 Jan 2020 12:50:23 +0100 Subject: [PATCH] Linter fixes --- .../Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java b/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java index 39bff382..d107abc6 100644 --- a/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java +++ b/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java @@ -35,6 +35,7 @@ import android.preference.PreferenceManager; import android.provider.Settings; import android.util.Log; +import androidx.annotation.RequiresApi; import androidx.core.app.NotificationCompat; import org.kde.kdeconnect.Helpers.DeviceHelper; @@ -48,8 +49,6 @@ import org.kde.kdeconnect_tp.R; import java.io.IOException; -import static android.content.Context.POWER_SERVICE; - @PluginFactory.LoadablePlugin public class FindMyPhonePlugin extends Plugin { public final static String PACKET_TYPE_FINDMYPHONE_REQUEST = "kdeconnect.findmyphone.request"; @@ -85,7 +84,7 @@ public class FindMyPhonePlugin extends Plugin { notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationId = (int) System.currentTimeMillis(); audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); - powerManager = (PowerManager) context.getSystemService(POWER_SERVICE); + powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Uri ringtone; @@ -138,6 +137,7 @@ public class FindMyPhonePlugin extends Plugin { return true; } + @RequiresApi(16) private void showBroadcastNotification() { Intent intent = new Intent(context, FindMyPhoneReceiver.class); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);