Skip to content

Commit 61c25d4

Browse files
authored
Merge pull request #13056 from HatakeKakashri/bump_min_sdk_23
Bump minimum SDK version to API 23
2 parents f5245ea + b84395d commit 61c25d4

File tree

6 files changed

+14
-26
lines changed

6 files changed

+14
-26
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
matrix:
7171
include:
72-
- api-level: 21
72+
- api-level: 23
7373
target: default
7474
arch: x86
7575
- api-level: 35

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ android {
4444
defaultConfig {
4545
applicationId = "org.schabi.newpipe"
4646
resValue("string", "app_name", "NewPipe")
47-
minSdk = 21
47+
minSdk = 23
4848
targetSdk = 35
4949

5050
versionCode = System.getProperty("versionCodeOverride")?.toInt() ?: 1005

app/src/main/java/org/schabi/newpipe/error/ErrorActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,7 @@ private String getAppLanguage() {
307307
}
308308

309309
private String getOsString() {
310-
final String osBase = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
311-
? Build.VERSION.BASE_OS : "Android";
310+
final String osBase = Build.VERSION.BASE_OS;
312311
return System.getProperty("os.name")
313312
+ " " + (osBase.isEmpty() ? "Android" : osBase)
314313
+ " " + Build.VERSION.RELEASE

app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import android.graphics.PorterDuff;
2525
import android.graphics.PorterDuffColorFilter;
2626
import android.net.Uri;
27-
import android.os.Build;
2827
import android.os.Handler;
2928
import android.os.Looper;
3029
import android.util.Log;
@@ -1587,28 +1586,23 @@ public void setupVideoSurfaceIfNeeded() {
15871586
// make sure there is nothing left over from previous calls
15881587
clearVideoSurface();
15891588

1590-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // >=API23
1591-
surfaceHolderCallback = new SurfaceHolderCallback(context, player.getExoPlayer());
1592-
binding.surfaceView.getHolder().addCallback(surfaceHolderCallback);
1589+
surfaceHolderCallback = new SurfaceHolderCallback(context, player.getExoPlayer());
1590+
binding.surfaceView.getHolder().addCallback(surfaceHolderCallback);
15931591

1594-
// ensure player is using an unreleased surface, which the surfaceView might not be
1595-
// when starting playback on background or during player switching
1596-
if (binding.surfaceView.getHolder().getSurface().isValid()) {
1597-
// initially set the surface manually otherwise
1598-
// onRenderedFirstFrame() will not be called
1599-
player.getExoPlayer().setVideoSurfaceHolder(binding.surfaceView.getHolder());
1600-
}
1601-
} else {
1602-
player.getExoPlayer().setVideoSurfaceView(binding.surfaceView);
1592+
// ensure player is using an unreleased surface, which the surfaceView might not be
1593+
// when starting playback on background or during player switching
1594+
if (binding.surfaceView.getHolder().getSurface().isValid()) {
1595+
// initially set the surface manually otherwise
1596+
// onRenderedFirstFrame() will not be called
1597+
player.getExoPlayer().setVideoSurfaceHolder(binding.surfaceView.getHolder());
16031598
}
16041599

16051600
surfaceIsSetup = true;
16061601
}
16071602
}
16081603

16091604
private void clearVideoSurface() {
1610-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M // >=API23
1611-
&& surfaceHolderCallback != null) {
1605+
if (surfaceHolderCallback != null) {
16121606
binding.surfaceView.getHolder().removeCallback(surfaceHolderCallback);
16131607
surfaceHolderCallback.release();
16141608
surfaceHolderCallback = null;

app/src/main/java/org/schabi/newpipe/settings/VideoAudioSettingsFragment.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.content.SharedPreferences;
44
import android.content.res.Resources;
5-
import android.os.Build;
65
import android.os.Bundle;
76
import android.provider.Settings;
87
import android.text.format.DateUtils;
@@ -33,8 +32,7 @@ public void onCreatePreferences(final Bundle savedInstanceState, final String ro
3332
// on M and above, if user chooses to minimise to popup player on exit
3433
// and the app doesn't have display over other apps permission,
3534
// show a snackbar to let the user give permission
36-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
37-
&& getString(R.string.minimize_on_exit_key).equals(key)) {
35+
if (getString(R.string.minimize_on_exit_key).equals(key)) {
3836
final String newSetting = sharedPreferences.getString(key, null);
3937
if (newSetting != null
4038
&& newSetting.equals(getString(R.string.minimize_on_exit_popup_key))

app/src/main/java/org/schabi/newpipe/util/PermissionHelper.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import android.text.Html;
1313
import android.widget.Toast;
1414

15-
import androidx.annotation.RequiresApi;
1615
import androidx.appcompat.app.AlertDialog;
1716
import androidx.core.app.ActivityCompat;
1817
import androidx.core.content.ContextCompat;
@@ -116,7 +115,6 @@ public static boolean checkPostNotificationsPermission(final Activity activity,
116115
* @param context {@link Context}
117116
* @return {@link Settings#canDrawOverlays(Context)}
118117
**/
119-
@RequiresApi(api = Build.VERSION_CODES.M)
120118
public static boolean checkSystemAlertWindowPermission(final Context context) {
121119
if (!Settings.canDrawOverlays(context)) {
122120
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
@@ -174,8 +172,7 @@ public static boolean checkSystemAlertWindowPermission(final Context context) {
174172
* @return whether the popup is enabled
175173
*/
176174
public static boolean isPopupEnabledElseAsk(final Context context) {
177-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M
178-
|| checkSystemAlertWindowPermission(context)) {
175+
if (checkSystemAlertWindowPermission(context)) {
179176
return true;
180177
} else {
181178
Toast.makeText(context, R.string.msg_popup_permission, Toast.LENGTH_LONG).show();

0 commit comments

Comments
 (0)