From c3dd11f2f3bd3ee235017ea0cf12fbabc25b503f Mon Sep 17 00:00:00 2001 From: Tim Boundy Date: Mon, 30 Oct 2023 17:06:24 +1100 Subject: [PATCH] Retry async query of Profile Manager when we get the FEATURE_NOT_READY_TO_USE response, tends to happen shortly after a device boot while the EMDK is still starting --- .../deviceidentifierswrapper/DIProfileManagerCommand.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java index 24da9b8..5fa76ee 100644 --- a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java +++ b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/DIProfileManagerCommand.java @@ -73,6 +73,11 @@ public void onStatus(EMDKManager.StatusData statusData, EMDKBase emdkBase) { { String errorMessage = "Error when trying to retrieve ProfileManager: " + getResultCode(statusData.getResult()); logMessage(errorMessage, EMessageType.ERROR); + + // Timed out, try again + if (statusData.getResult() == EMDKResults.STATUS_CODE.FEATURE_NOT_READY_TO_USE) { + onEMDKManagerRetrieved(mEMDKManager); + } } } }; @@ -96,7 +101,7 @@ public void onClosed() { public DIProfileManagerCommand(Context aContext) { super(aContext); mSettings = new DICommandBaseSettings(){{ - mTimeOutMS = 20000; + mTimeOutMS = 120000; mEnableTimeOutMechanism = true; mCommandId = "DWProfileManagerCommand"; }};