Skip to content

Commit af0117a

Browse files
authored
Merge pull request #367 from ytai/api34
api34
2 parents 6e177d1 + 823836e commit af0117a

File tree

15 files changed

+44
-28
lines changed

15 files changed

+44
-28
lines changed

IOIOLibAndroid/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
namespace 'ioio.lib'
88
defaultConfig {
99
minSdkVersion 14
10-
compileSdk 33
11-
targetSdkVersion 33
10+
compileSdk 34
11+
targetSdkVersion 34
1212
}
1313
}
1414

IOIOLibAndroidAccessory/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
namespace 'ioio.lib.accessory'
88
defaultConfig {
99
minSdkVersion 14
10-
compileSdk 33
11-
targetSdkVersion 33
10+
compileSdk 34
11+
targetSdkVersion 34
1212
}
1313
}
1414

IOIOLibAndroidAccessory/src/main/java/ioio/lib/android/accessory/AccessoryConnectionBootstrap.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import java.io.OutputStream;
4848
import java.util.Collection;
4949

50+
import android.annotation.SuppressLint;
5051
import android.app.PendingIntent;
5152
import android.content.BroadcastReceiver;
5253
import android.content.Context;
@@ -267,9 +268,16 @@ private boolean tryOpen() {
267268
}
268269
}
269270

271+
@SuppressLint("UnspecifiedRegisterReceiverFlag")
270272
private void registerReceiver() {
271273
IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
272-
activity_.registerReceiver(this, filter);
274+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
275+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
276+
activity_.registerReceiver(this, filter, Context.RECEIVER_NOT_EXPORTED);
277+
} else
278+
activity_.registerReceiver(this, filter);
279+
} else
280+
activity_.registerReceiver(this, filter);
273281
}
274282

275283
private void unregisterReceiver() {

IOIOLibAndroidBluetooth/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
namespace 'ioio.lib.bluetooth'
88
defaultConfig {
99
minSdkVersion 14
10-
compileSdk 33
11-
targetSdkVersion 33
10+
compileSdk 34
11+
targetSdkVersion 34
1212
}
1313
}
1414

IOIOLibAndroidDevice/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
namespace 'ioio.lib.android.device'
88
defaultConfig {
99
minSdkVersion 14
10-
compileSdk 33
11-
targetSdkVersion 33
10+
compileSdk 34
11+
targetSdkVersion 34
1212
}
1313
}
1414

IOIOLibAndroidDevice/src/main/java/ioio/lib/android/device/DeviceConnectionBootstrap.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.util.Collection;
4343
import java.util.HashMap;
4444

45+
import android.annotation.SuppressLint;
4546
import android.annotation.TargetApi;
4647
import android.app.PendingIntent;
4748
import android.content.BroadcastReceiver;
@@ -484,11 +485,18 @@ private void checkPermission() {
484485
}
485486
}
486487

488+
@SuppressLint("UnspecifiedRegisterReceiverFlag")
487489
private void registerReceiver() {
488490
IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
489491
filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
490492
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
491-
activity_.registerReceiver(this, filter);
493+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
494+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
495+
activity_.registerReceiver(this, filter, Context.RECEIVER_NOT_EXPORTED);
496+
} else
497+
activity_.registerReceiver(this, filter);
498+
} else
499+
activity_.registerReceiver(this, filter);
492500
}
493501

494502
private void unregisterReceiver() {

applications/HelloIOIO/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66

77
defaultConfig {
88
minSdkVersion 21
9-
compileSdk 33
10-
targetSdkVersion 33
9+
compileSdk 34
10+
targetSdkVersion 34
1111

1212
versionCode getGitCommitCount()
1313
versionName getTag()

applications/HelloIOIOService/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ android {
44
namespace 'ioio.examples.hello_service'
55
defaultConfig {
66
minSdkVersion 14
7-
compileSdk 33
8-
targetSdkVersion 33
7+
compileSdk 34
8+
targetSdkVersion 34
99

1010
versionCode getGitCommitCount()
1111
versionName getTag()

applications/HolidayIOIO/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ android {
55
namespace "ioio.examples.holiday"
66
defaultConfig {
77
minSdkVersion 21
8-
compileSdk 33
9-
targetSdkVersion 33
8+
compileSdk 34
9+
targetSdkVersion 34
1010

1111
versionCode getGitCommitCount()
1212
versionName getTag()

applications/IOIOConnectionTesterAndroid/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ android {
44
namespace "ioio.connection_tester"
55
defaultConfig {
66
minSdkVersion 14
7-
compileSdk 33
8-
targetSdkVersion 33
7+
compileSdk 34
8+
targetSdkVersion 34
99

1010
versionCode getGitCommitCount()
1111
versionName getTag()

0 commit comments

Comments
 (0)