|
2 | 2 |
|
3 | 3 | import android.content.Context; |
4 | 4 | import android.net.Uri; |
| 5 | +import android.os.Build; |
5 | 6 | import android.text.TextUtils; |
6 | 7 | import android.util.Log; |
7 | 8 | import android.util.Xml; |
@@ -65,6 +66,7 @@ public class ErrorHolder |
65 | 66 | public void onStatus(EMDKManager.StatusData statusData, EMDKBase emdkBase) { |
66 | 67 | if(statusData.getResult() == EMDKResults.STATUS_CODE.SUCCESS) |
67 | 68 | { |
| 69 | + logMessage("Profile manager retrieved.", EMessageType.DEBUG); |
68 | 70 | onProfileManagerInitialized((ProfileManager)emdkBase); |
69 | 71 | } |
70 | 72 | else |
@@ -188,7 +190,21 @@ private void onEMDKManagerRetrieved(EMDKManager emdkManager) |
188 | 190 | if(mProfileManager == null) |
189 | 191 | { |
190 | 192 | try { |
191 | | - emdkManager.getInstanceAsync(EMDKManager.FEATURE_TYPE.PROFILE, mStatusListener); |
| 193 | + logMessage("Requesting profile manager.", EMessageType.DEBUG); |
| 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 | + } |
192 | 208 | } catch (EMDKException e) { |
193 | 209 | logMessage("Error when trying to retrieve profile manager: " + e.getMessage(), EMessageType.ERROR); |
194 | 210 | } |
@@ -226,7 +242,7 @@ private void onProfileManagerInitialized(ProfileManager profileManager) |
226 | 242 | { |
227 | 243 | mProfileManager = profileManager; |
228 | 244 | bInitializing = false; |
229 | | - logMessage("Profile Manager retrieved.", EMessageType.DEBUG); |
| 245 | + logMessage("Processing MX Content", EMessageType.DEBUG); |
230 | 246 | processMXContent(); |
231 | 247 | } |
232 | 248 |
|
@@ -263,6 +279,7 @@ private void processMXContent() |
263 | 279 | String[] params = new String[1]; |
264 | 280 | params[0] = msProfileData; |
265 | 281 |
|
| 282 | + logMessage("Processing profile :" + msProfileData, EMessageType.VERBOSE); |
266 | 283 | EMDKResults results = mProfileManager.processProfile(msProfileName, ProfileManager.PROFILE_FLAG.SET, params); |
267 | 284 |
|
268 | 285 | //Check the return status of processProfile |
|
0 commit comments