Skip to content

Commit ac156b5

Browse files
committed
Update target SDK to 33 (Android S) from sdk 31
This updates the code so it compiles cleanly under Android S, which amounts to adding android:exported="true" to AndroidManifest.xml and PendingIntent.FLAG_IMMUTABLE to PendingIntent.getBroadcast(flags = 0)
1 parent d767631 commit ac156b5

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

app/build.gradle

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ android {
1717
}
1818
}
1919
}
20+
compileSdk 33
2021

21-
compileSdkVersion 31
22-
buildToolsVersion "30.0.3"
22+
buildToolsVersion '34.0.0'
2323

2424
defaultConfig {
2525
applicationId "com.fpvout.digiview"
2626
minSdkVersion 21
27-
targetSdkVersion 30
27+
targetSdkVersion 33
2828
versionCode 3
2929
versionName '1.0.0'
30-
resConfigs "en", "de", "fr", "es", "zh", "pt"
30+
resConfigs 'en', 'de', 'fr', 'es', 'zh', 'pt'
3131
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3232
}
3333

@@ -62,18 +62,19 @@ android {
6262
sourceCompatibility JavaVersion.VERSION_1_8
6363
targetCompatibility JavaVersion.VERSION_1_8
6464
}
65+
namespace 'com.fpvout.digiview'
6566
}
6667

6768
dependencies {
6869

6970
implementation 'androidx.appcompat:appcompat:1.4.0'
70-
implementation 'com.google.android.material:material:1.4.0'
71-
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
72-
implementation 'com.google.android.exoplayer:exoplayer:2.16.1'
71+
implementation 'com.google.android.material:material:1.9.0'
72+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
73+
implementation 'com.google.android.exoplayer:exoplayer:2.19.1'
7374
implementation 'io.sentry:sentry-android:4.3.0'
74-
implementation 'androidx.preference:preference:1.1.1'
75+
implementation 'androidx.preference:preference:1.2.1'
7576

76-
testImplementation 'junit:junit:4.+'
77+
testImplementation 'junit:junit:4.0'
7778
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
78-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
79-
}
79+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
80+
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.fpvout.digiview">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-feature android:name="android.hardware.usb.host" />
76
<uses-permission android:name="android.permission.WAKE_LOCK" />
@@ -26,6 +25,7 @@
2625
android:launchMode="singleTask"
2726
android:name="com.fpvout.digiview.MainActivity"
2827
android:screenOrientation="sensorLandscape"
28+
android:exported="true"
2929
android:configChanges="orientation|keyboardHidden">
3030
<intent-filter>
3131
<action android:name="android.intent.action.MAIN" />

app/src/main/java/com/fpvout/digiview/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ protected void onCreate(Bundle savedInstanceState) {
195195
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
196196

197197
usbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
198-
permissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);
198+
permissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), PendingIntent.FLAG_IMMUTABLE);
199199
usbDeviceBroadcastReceiver = new UsbDeviceBroadcastReceiver(this);
200200

201201
IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
@@ -402,4 +402,4 @@ private void checkDataCollectionAgreement() {
402402
}
403403
}
404404

405-
}
405+
}

0 commit comments

Comments
 (0)