Skip to content

Commit d5220da

Browse files
committed
Update minSdk version to 24
Updating the minSdk version allows use of more Java 8 language features (without desugaring need) and the removalof code that dealt with older versions. Given that api level 24 (Android 7) come out in 2016 and usage of Android versions 5 and 6 (Api levels 21, 22, 23) are bellow 1% and decreasing (as reported by Google Play), this seems an appropriate tradeoff.
1 parent 026667b commit d5220da

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ android {
1414

1515
defaultConfig {
1616
applicationId "org.xbmc.kore"
17-
minSdkVersion 21
17+
minSdkVersion 24
1818
targetSdkVersion 32
1919
versionCode 31
2020
versionName = getVersionName()

app/src/main/java/org/xbmc/kore/service/MediaSessionService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void onCreate() {
139139
// Create the intent to start the remote when the user taps the notification
140140
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
141141
stackBuilder.addNextIntentWithParentStack(new Intent(this, RemoteActivity.class));
142-
int flags = Utils.isMOrLater() ? PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT : PendingIntent.FLAG_UPDATE_CURRENT;
142+
int flags = PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT;
143143
remoteStartPendingIntent = stackBuilder.getPendingIntent(0, flags);
144144

145145
// Create the notification channel and the default notification

app/src/main/java/org/xbmc/kore/ui/sections/settings/SettingsFragment.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,9 @@ private void updatePreferredLanguage(String localeName) {
294294
}
295295

296296
private Locale getSystemLocale() {
297-
return Utils.isNOrLater() ?
298-
Resources.getSystem().getConfiguration().getLocales().get(0) :
299-
Resources.getSystem().getConfiguration().locale;
297+
return Resources.getSystem().getConfiguration().getLocales().get(0);
300298
}
301299

302300
private Locale getCurrentLocale() {
303-
return Utils.isNOrLater() ?
304-
getResources().getConfiguration().getLocales().get(0) :
305-
getResources().getConfiguration().locale;
301+
return getResources().getConfiguration().getLocales().get(0);
306302
}}

app/src/main/java/org/xbmc/kore/utils/Utils.java

-8
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@
4040
public class Utils {
4141
private static final String TAG = LogUtils.makeLogTag(Utils.class);
4242

43-
public static boolean isMOrLater() {
44-
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
45-
}
46-
47-
public static boolean isNOrLater() {
48-
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
49-
}
50-
5143
public static boolean isOreoOrLater() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O; }
5244

5345
public static boolean isOreoMR1OrLater() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1; }

0 commit comments

Comments
 (0)