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); }