Skip to content

Commit fa1d803

Browse files
committed
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)
1 parent 56d9b48 commit fa1d803

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

DeviceIdentifiersWrapper/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
defaultConfig {
99
minSdkVersion 19
1010
targetSdkVersion 33
11-
versionCode 10
12-
versionName "0.9.1"
11+
versionCode 11
12+
versionName "0.9.2"
1313

1414
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1515

DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.content.Context;
44
import android.net.Uri;
5+
import android.os.Build;
56
import android.text.TextUtils;
67
import android.util.Log;
78
import android.util.Xml;
@@ -190,7 +191,20 @@ private void onEMDKManagerRetrieved(EMDKManager emdkManager)
190191
{
191192
try {
192193
logMessage("Requesting profile manager.", EMessageType.DEBUG);
193-
emdkManager.getInstanceAsync(EMDKManager.FEATURE_TYPE.PROFILE, mStatusListener);
194+
logMessage("Current API version: " + android.os.Build.VERSION.SDK_INT, EMessageType.VERBOSE);
195+
if(android.os.Build.VERSION.SDK_INT < 33) {
196+
logMessage("Requesting profile manager Asynchonously", EMessageType.DEBUG);
197+
emdkManager.getInstanceAsync(EMDKManager.FEATURE_TYPE.PROFILE, mStatusListener);
198+
}
199+
else
200+
{
201+
logMessage("Requesting profile manager synchronized", EMessageType.DEBUG);
202+
ProfileManager profileManager = (ProfileManager) emdkManager.getInstance(EMDKManager.FEATURE_TYPE.PROFILE);
203+
if(profileManager != null)
204+
{
205+
onProfileManagerInitialized(profileManager);
206+
}
207+
}
194208
} catch (EMDKException e) {
195209
logMessage("Error when trying to retrieve profile manager: " + e.getMessage(), EMessageType.ERROR);
196210
}

0 commit comments

Comments
 (0)