Skip to content

Commit

Permalink
Merge pull request #367 from ytai/api34
Browse files Browse the repository at this point in the history
api34
  • Loading branch information
hannesa2 authored May 10, 2024
2 parents 6e177d1 + 823836e commit af0117a
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 28 deletions.
4 changes: 2 additions & 2 deletions IOIOLibAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
namespace 'ioio.lib'
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34
}
}

Expand Down
4 changes: 2 additions & 2 deletions IOIOLibAndroidAccessory/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
namespace 'ioio.lib.accessory'
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.io.OutputStream;
import java.util.Collection;

import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
Expand Down Expand Up @@ -267,9 +268,16 @@ private boolean tryOpen() {
}
}

@SuppressLint("UnspecifiedRegisterReceiverFlag")
private void registerReceiver() {
IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
activity_.registerReceiver(this, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
activity_.registerReceiver(this, filter, Context.RECEIVER_NOT_EXPORTED);
} else
activity_.registerReceiver(this, filter);
} else
activity_.registerReceiver(this, filter);
}

private void unregisterReceiver() {
Expand Down
4 changes: 2 additions & 2 deletions IOIOLibAndroidBluetooth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
namespace 'ioio.lib.bluetooth'
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34
}
}

Expand Down
4 changes: 2 additions & 2 deletions IOIOLibAndroidDevice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
namespace 'ioio.lib.android.device'
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.util.Collection;
import java.util.HashMap;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
Expand Down Expand Up @@ -484,11 +485,18 @@ private void checkPermission() {
}
}

@SuppressLint("UnspecifiedRegisterReceiverFlag")
private void registerReceiver() {
IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);
filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
activity_.registerReceiver(this, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
activity_.registerReceiver(this, filter, Context.RECEIVER_NOT_EXPORTED);
} else
activity_.registerReceiver(this, filter);
} else
activity_.registerReceiver(this, filter);
}

private void unregisterReceiver() {
Expand Down
4 changes: 2 additions & 2 deletions applications/HelloIOIO/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {

defaultConfig {
minSdkVersion 21
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/HelloIOIOService/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android {
namespace 'ioio.examples.hello_service'
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/HolidayIOIO/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {
namespace "ioio.examples.holiday"
defaultConfig {
minSdkVersion 21
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/IOIOConnectionTesterAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android {
namespace "ioio.connection_tester"
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/IOIOManager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {
namespace "ioio.manager"
defaultConfig {
minSdkVersion 21
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/IOIOSimpleApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {
namespace "ioio.examples.simple"
defaultConfig {
minSdkVersion 21
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/IOIOTestBed/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android {
namespace "ioio.test_bed"
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/IOIOTortureTest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android {
namespace "ioio.tests.torture"
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down
4 changes: 2 additions & 2 deletions applications/ShoeBot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android {
namespace "ioio.applications.shoebot"
defaultConfig {
minSdkVersion 14
compileSdk 33
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34

versionCode getGitCommitCount()
versionName getTag()
Expand Down

0 comments on commit af0117a

Please sign in to comment.