From 56d9b48337dd219a009931bb909aac5faf5ddd0f Mon Sep 17 00:00:00 2001 From: Trudu Laurent Date: Thu, 5 Oct 2023 17:30:13 +0200 Subject: [PATCH 1/3] Added: More logs --- .idea/misc.xml | 1 - DeviceIdentifiersWrapper/build.gradle | 4 ++-- .../deviceidentifierswrapper/DIProfileManagerCommand.java | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index fa51d7d..b31a4ac 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/DeviceIdentifiersWrapper/build.gradle b/DeviceIdentifiersWrapper/build.gradle index e19c4b0..dabd858 100644 --- a/DeviceIdentifiersWrapper/build.gradle +++ b/DeviceIdentifiersWrapper/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 19 targetSdkVersion 33 - versionCode 9 - versionName "0.9" + versionCode 10 + versionName "0.9.1" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java index 661d88e..3075738 100644 --- a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java +++ b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java @@ -65,6 +65,7 @@ public class ErrorHolder public void onStatus(EMDKManager.StatusData statusData, EMDKBase emdkBase) { if(statusData.getResult() == EMDKResults.STATUS_CODE.SUCCESS) { + logMessage("Profile manager retrieved.", EMessageType.DEBUG); onProfileManagerInitialized((ProfileManager)emdkBase); } else @@ -188,6 +189,7 @@ private void onEMDKManagerRetrieved(EMDKManager emdkManager) if(mProfileManager == null) { try { + logMessage("Requesting profile manager.", EMessageType.DEBUG); emdkManager.getInstanceAsync(EMDKManager.FEATURE_TYPE.PROFILE, mStatusListener); } catch (EMDKException e) { logMessage("Error when trying to retrieve profile manager: " + e.getMessage(), EMessageType.ERROR); @@ -226,7 +228,7 @@ private void onProfileManagerInitialized(ProfileManager profileManager) { mProfileManager = profileManager; bInitializing = false; - logMessage("Profile Manager retrieved.", EMessageType.DEBUG); + logMessage("Processing MX Content", EMessageType.DEBUG); processMXContent(); } @@ -263,6 +265,7 @@ private void processMXContent() String[] params = new String[1]; params[0] = msProfileData; + logMessage("Processing profile :" + msProfileData, EMessageType.VERBOSE); EMDKResults results = mProfileManager.processProfile(msProfileName, ProfileManager.PROFILE_FLAG.SET, params); //Check the return status of processProfile From fa1d8033412e276f4ed74c2ffc437400efa55cac Mon Sep 17 00:00:00 2001 From: Trudu Laurent Date: Tue, 10 Oct 2023 13:16:27 +0200 Subject: [PATCH 2/3] Changed the way to retrieve profile manager on A13, switched from Async to sync to try to fix TC52x/57x bug (profile manager async does not return the expected object) --- DeviceIdentifiersWrapper/build.gradle | 4 ++-- .../DIProfileManagerCommand.java | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/DeviceIdentifiersWrapper/build.gradle b/DeviceIdentifiersWrapper/build.gradle index dabd858..869be36 100644 --- a/DeviceIdentifiersWrapper/build.gradle +++ b/DeviceIdentifiersWrapper/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 19 targetSdkVersion 33 - versionCode 10 - versionName "0.9.1" + versionCode 11 + versionName "0.9.2" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java index 3075738..24da9b8 100644 --- a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java +++ b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java @@ -2,6 +2,7 @@ import android.content.Context; import android.net.Uri; +import android.os.Build; import android.text.TextUtils; import android.util.Log; import android.util.Xml; @@ -190,7 +191,20 @@ private void onEMDKManagerRetrieved(EMDKManager emdkManager) { try { logMessage("Requesting profile manager.", EMessageType.DEBUG); - emdkManager.getInstanceAsync(EMDKManager.FEATURE_TYPE.PROFILE, mStatusListener); + logMessage("Current API version: " + android.os.Build.VERSION.SDK_INT, EMessageType.VERBOSE); + if(android.os.Build.VERSION.SDK_INT < 33) { + logMessage("Requesting profile manager Asynchonously", EMessageType.DEBUG); + emdkManager.getInstanceAsync(EMDKManager.FEATURE_TYPE.PROFILE, mStatusListener); + } + else + { + logMessage("Requesting profile manager synchronized", EMessageType.DEBUG); + ProfileManager profileManager = (ProfileManager) emdkManager.getInstance(EMDKManager.FEATURE_TYPE.PROFILE); + if(profileManager != null) + { + onProfileManagerInitialized(profileManager); + } + } } catch (EMDKException e) { logMessage("Error when trying to retrieve profile manager: " + e.getMessage(), EMessageType.ERROR); } From 6f5da3f215939445d817f5800d3c5bf6be4abddc Mon Sep 17 00:00:00 2001 From: Trudu Laurent Date: Tue, 10 Oct 2023 13:24:35 +0200 Subject: [PATCH 3/3] Version update --- DeviceIdentifiersWrapper/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DeviceIdentifiersWrapper/build.gradle b/DeviceIdentifiersWrapper/build.gradle index 869be36..23eb99d 100644 --- a/DeviceIdentifiersWrapper/build.gradle +++ b/DeviceIdentifiersWrapper/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 19 targetSdkVersion 33 - versionCode 11 - versionName "0.9.2" + versionCode 12 + versionName "0.9.3" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'