Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcast receiver for android 14 v4.4 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ allprojects {
}

ext {
compileSdkVersion = 29
compileSdkVersion = 33
hwSdkVersionName = '4.4.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package de.cotech.hw.internal.transport.usb;


import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
Expand All @@ -33,11 +34,13 @@
import android.content.pm.PackageManager;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.Build;

import androidx.annotation.AnyThread;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;
import androidx.annotation.UiThread;

import de.cotech.hw.util.HwTimber;


Expand Down Expand Up @@ -121,9 +124,14 @@ private boolean handleConnectedUsbDevice(UsbDevice usbDevice, boolean requestPer
return false;
}

@SuppressLint("UnspecifiedRegisterReceiverFlag")
@UiThread
public void onActive() {
context.registerReceiver(usbBroadcastReceiver, intentFilter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(usbBroadcastReceiver, intentFilter, Context.RECEIVER_NOT_EXPORTED);
} else {
context.registerReceiver(usbBroadcastReceiver, intentFilter);
}
}

@UiThread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ public void onReceive(Context context, Intent intent) {
};
}
IntentFilter filter = new IntentFilter(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
context.registerReceiver(nfcStateBroadcastReceiver, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(nfcStateBroadcastReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
} else {
context.registerReceiver(nfcStateBroadcastReceiver, filter);
}
}

@TargetApi(VERSION_CODES.JELLY_BEAN_MR2)
Expand Down
2 changes: 1 addition & 1 deletion hwsecurity/fido/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 14
minSdkVersion 24
versionName rootProject.ext.hwSdkVersionName
vectorDrawables.useSupportLibrary = true
}
Expand Down
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk17