Skip to content

Commit 1d4cd7a

Browse files
committed
Suppress @RequiresApi warning
Because I'm not including a library for an annotation. Doesn't happen, Google.
1 parent f592a22 commit 1d4cd7a

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

app/src/main/java/de/markusfisch/android/pielauncher/app/PieLauncherApp.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.markusfisch.android.pielauncher.app;
22

3+
import android.annotation.SuppressLint;
34
import android.annotation.TargetApi;
45
import android.app.Application;
56
import android.content.Context;
@@ -78,6 +79,7 @@ private void registerPackageEventReceiver() {
7879
registerReceiver(packageEventReceiver, filter);
7980
}
8081

82+
@SuppressLint("UseRequiresApi")
8183
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
8284
private void registerManagedEventReceiver() {
8385
IntentFilter filter = new IntentFilter();
@@ -86,6 +88,7 @@ private void registerManagedEventReceiver() {
8688
registerReceiver(managedProfileEventReceiver, filter);
8789
}
8890

91+
@SuppressLint("UseRequiresApi")
8992
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
9093
private void registerLauncherAppsCallback() {
9194
LauncherApps launcherApps = (LauncherApps) getSystemService(

app/src/main/java/de/markusfisch/android/pielauncher/content/AppMenu.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ private static void indexIntentsApps(
340340
}
341341
}
342342

343+
@SuppressLint("UseRequiresApi")
343344
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
344345
private static void indexProfilesApps(
345346
LauncherApps la,
@@ -375,6 +376,7 @@ private static void indexProfilesApps(
375376
}
376377
}
377378

379+
@SuppressLint("UseRequiresApi")
378380
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
379381
private static Drawable getBadgedIcon(LauncherActivityInfo info) {
380382
// According to Vitals, `getBadgedIcon()` can throw a NPE
@@ -559,6 +561,7 @@ private void removePackageFromPieMenu(String packageName,
559561
}
560562
}
561563

564+
@SuppressLint("UseRequiresApi")
562565
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
563566
private LauncherApps getLauncherApps(Context context) {
564567
if (launcherApps == null) {
@@ -568,6 +571,7 @@ private LauncherApps getLauncherApps(Context context) {
568571
return launcherApps;
569572
}
570573

574+
@SuppressLint("UseRequiresApi")
571575
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
572576
private UserManager getUserManager(Context context) {
573577
if (userManager == null) {
@@ -583,6 +587,7 @@ private static Intent getLaunchIntent(Context context,
583587
return pm != null ? pm.getLaunchIntentForPackage(packageName) : null;
584588
}
585589

590+
@SuppressLint("UseRequiresApi")
586591
@TargetApi(Build.VERSION_CODES.N)
587592
private void launchAppWithLauncherApp(Context context, AppIcon icon) {
588593
LauncherApps launcherApps = getLauncherApps(context);
@@ -617,6 +622,7 @@ private void launchAppWithLauncherApp(Context context, AppIcon icon) {
617622
}
618623
}
619624

625+
@SuppressLint("UseRequiresApi")
620626
@TargetApi(Build.VERSION_CODES.N)
621627
private ComponentName findEnabledActivity(
622628
String packageName,

app/src/main/java/de/markusfisch/android/pielauncher/content/LauncherItemKey.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.markusfisch.android.pielauncher.content;
22

3+
import android.annotation.SuppressLint;
34
import android.annotation.TargetApi;
45
import android.content.ComponentName;
56
import android.content.Context;
@@ -70,11 +71,13 @@ private static boolean equals(Object a, Object b) {
7071
return a == b || (a != null && a.equals(b));
7172
}
7273

74+
@SuppressLint("UseRequiresApi")
7375
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
7476
private static UserHandle getUserHandle(UserHandle userHandle) {
7577
return userHandle == null ? Process.myUserHandle() : userHandle;
7678
}
7779

80+
@SuppressLint("UseRequiresApi")
7881
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
7982
private static LauncherItemKey unflattenFromStringWithUserHandle(
8083
Context context,
@@ -102,6 +105,7 @@ private static LauncherItemKey unflattenFromStringWithUserHandle(
102105
return new LauncherItemKey(componentName, userHandle);
103106
}
104107

108+
@SuppressLint("UseRequiresApi")
105109
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
106110
private static String flattenToStringWithUserHandle(
107111
Context context,
@@ -117,6 +121,7 @@ private static String flattenToStringWithUserHandle(
117121
return sb.toString();
118122
}
119123

124+
@SuppressLint("UseRequiresApi")
120125
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
121126
private static UserManager getUserManager(Context context) {
122127
return (UserManager) context.getSystemService(Context.USER_SERVICE);

app/src/main/java/de/markusfisch/android/pielauncher/os/BatteryOptimization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class BatteryOptimization {
1616
// be available (and thus in memory). Killing this process in Doze mode
1717
// and reloading it when the user unlocks their device actually consumes
1818
// more battery.
19-
@SuppressLint("BatteryLife")
19+
@SuppressLint("BatteryLife,UseRequiresApi")
2020
@TargetApi(Build.VERSION_CODES.M)
2121
public static void requestDisable(Context context) {
2222
Intent intent = new Intent();

app/src/main/java/de/markusfisch/android/pielauncher/receiver/ManagedProfileEventReceiver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.markusfisch.android.pielauncher.receiver;
22

3+
import android.annotation.SuppressLint;
34
import android.annotation.TargetApi;
45
import android.content.BroadcastReceiver;
56
import android.content.Context;
@@ -8,6 +9,7 @@
89

910
import de.markusfisch.android.pielauncher.app.PieLauncherApp;
1011

12+
@SuppressLint("UseRequiresApi")
1113
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
1214
public class ManagedProfileEventReceiver extends BroadcastReceiver {
1315
@Override

0 commit comments

Comments
 (0)