diff --git a/datawedgeprofileintentswrapper/build.gradle b/datawedgeprofileintentswrapper/build.gradle index e73a927..cf668da 100644 --- a/datawedgeprofileintentswrapper/build.gradle +++ b/datawedgeprofileintentswrapper/build.gradle @@ -12,8 +12,8 @@ android { minSdkVersion 21 //noinspection EditedTargetSdkVersion targetSdkVersion 34 - versionCode 144 - versionName "14.4" + versionCode 145 + versionName "14.5" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWEnumerateScanners.java b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWEnumerateScanners.java index a3d51b8..b6fd38b 100644 --- a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWEnumerateScanners.java +++ b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWEnumerateScanners.java @@ -15,6 +15,8 @@ import java.util.Arrays; import java.util.List; +import androidx.core.content.ContextCompat; + /** * Created by laure on 16/04/2018. */ @@ -87,7 +89,8 @@ public void execute(DWEnumerateScannersSettings settings, onEnumerateScannerResu broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper(); broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper); - mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler); + ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED); + /* Ask for DataWedge profile list diff --git a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileChecker.java b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileChecker.java index 8cd287a..5d1a9b9 100644 --- a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileChecker.java +++ b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileChecker.java @@ -10,6 +10,8 @@ import java.util.Arrays; +import androidx.core.content.ContextCompat; + /** * Created by laure on 16/04/2018. */ @@ -74,7 +76,7 @@ public void execute(DWProfileCheckerSettings settings, onProfileExistResult call broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper(); broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper); - mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler); + ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED); /* Ask for DataWedge profile list diff --git a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileCommandBase.java b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileCommandBase.java index 90c6321..9f6b83b 100644 --- a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileCommandBase.java +++ b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWProfileCommandBase.java @@ -84,9 +84,6 @@ protected void execute(DWProfileBaseSettings settings, onProfileCommandResult ca broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper(); broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper); - - //mContext.registerReceiver(mBroadcastReceiver, intentFilter); - //mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler); ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED); } diff --git a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScanReceiver.java b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScanReceiver.java index 3cac959..5d49875 100644 --- a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScanReceiver.java +++ b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScanReceiver.java @@ -117,7 +117,6 @@ public void startReceive() mBroadcastReceiverThreadLooper = mBroadcastReceiverThread.getLooper(); mBroadcastReceiverHandler = new Handler(mBroadcastReceiverThreadLooper); - //mContext.registerReceiver(mMessageReceiver, mIntentFilter, null, mBroadcastReceiverHandler); ContextCompat.registerReceiver(mContext, mMessageReceiver, mIntentFilter, null, mBroadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED); } catch (Exception e) { diff --git a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScannerPluginStatus.java b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScannerPluginStatus.java index 6ace2c3..4b1a363 100644 --- a/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScannerPluginStatus.java +++ b/datawedgeprofileintentswrapper/src/main/java/com/zebra/datawedgeprofileintents/DWScannerPluginStatus.java @@ -8,6 +8,8 @@ import android.os.HandlerThread; import android.os.Looper; +import androidx.core.content.ContextCompat; + /** * Created by laure on 16/04/2018. */ @@ -71,7 +73,7 @@ public void execute(DWProfileBaseSettings settings, onScannerPluginStatus callba broadcastReceiverThreadLooper = broadcastReceiverThread.getLooper(); broadcastReceiverHandler = new Handler(broadcastReceiverThreadLooper); - mContext.registerReceiver(mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler); + ContextCompat.registerReceiver(mContext, mBroadcastReceiver, intentFilter, null, broadcastReceiverHandler, ContextCompat.RECEIVER_EXPORTED); /* Ask for DataWedge profile list