From 297edab6585591e552ee814801b3397994d587a0 Mon Sep 17 00:00:00 2001 From: Erwin Scheuch-Heilig Date: Tue, 2 Jan 2024 16:05:30 +0100 Subject: [PATCH] disable gradle buildconfig --- .../java/com/fr3ts0n/ecu/gui/androbd/UsbCommService.java | 5 +++-- gradle.properties | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/androbd/src/main/java/com/fr3ts0n/ecu/gui/androbd/UsbCommService.java b/androbd/src/main/java/com/fr3ts0n/ecu/gui/androbd/UsbCommService.java index 18f58441..106feed8 100644 --- a/androbd/src/main/java/com/fr3ts0n/ecu/gui/androbd/UsbCommService.java +++ b/androbd/src/main/java/com/fr3ts0n/ecu/gui/androbd/UsbCommService.java @@ -48,7 +48,7 @@ public class UsbCommService extends CommService { private static UsbSerialPort sPort = null; private SerialInputOutputManager mSerialIoManager; - public static final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB"; + public static final String INTENT_ACTION_GRANT_USB = ".GRANT_USB"; public static final String PREF_KEY_BAUDRATE = "comm_baudrate"; public static final int DEFAULT_BAUDRATE = 38400; @@ -174,7 +174,8 @@ public void start() // Request runtime permission to access USB serial port UsbDevice device = sPort.getDriver().getDevice(); - PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(INTENT_ACTION_GRANT_USB), 0); + String intentStr = mContext.getPackageName() + INTENT_ACTION_GRANT_USB; + PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(intentStr), android.app.PendingIntent.FLAG_IMMUTABLE); usbManager.requestPermission(device, usbPermissionIntent); // Ensure access toUSB port is granted ... if (!usbManager.hasPermission(device)) diff --git a/gradle.properties b/gradle.properties index 55a1cde4..d37810e0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,3 @@ -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false android.nonTransitiveRClass=true org.gradle.unsafe.configuration-cache=true \ No newline at end of file