@@ -27,8 +27,14 @@ public class DIHelper {
2727
2828 protected static String sIMEI = null ;
2929 protected static String sSerialNumber = null ;
30-
3130 protected static String sBtMacAddress = null ;
31+ protected static String sProductModel = null ;
32+ protected static String sIdentityDeviceID = null ;
33+ protected static String sWifiMac = null ;
34+ protected static String sWifiAPMac = null ;
35+ protected static String sWifiSSID = null ;
36+ protected static String sEthernetMac = null ;
37+
3238
3339 public static final long SEC_IN_MS = 1000 ;
3440 public static final long MIN_IN_MS = SEC_IN_MS * 60 ;
@@ -215,4 +221,213 @@ private static void returnBtMacAddressUsingAndroidAPIs(Context context, IDIResul
215221 callbackInterface .onSuccess (macAddress );
216222 }
217223 }
224+
225+ public static void getProductModel (Context context , IDIResultCallbacks callbackInterface )
226+ {
227+ if (sProductModel != null )
228+ {
229+ if (callbackInterface != null )
230+ {
231+ callbackInterface .onDebugStatus ("Product Model already in cache." );
232+ }
233+ callbackInterface .onSuccess (sProductModel );
234+ return ;
235+ }
236+
237+ IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks () {
238+ @ Override
239+ public void onSuccess (String message ) {
240+ sProductModel = message ;
241+ callbackInterface .onSuccess (message );
242+ }
243+
244+ @ Override
245+ public void onError (String message ) {
246+ callbackInterface .onError (message );
247+ }
248+
249+ @ Override
250+ public void onDebugStatus (String message ) {
251+ callbackInterface .onDebugStatus (message );
252+ }
253+ };
254+
255+ new RetrieveOEMInfoTask ().executeAsync (context , Uri .parse ("content://oem_info/oem.zebra.secure/ro_product_model" ),
256+ tempCallbackInterface );
257+
258+ }
259+
260+ public static void getIdentityDeviceID (Context context , IDIResultCallbacks callbackInterface )
261+ {
262+ if (sIdentityDeviceID != null )
263+ {
264+ if (callbackInterface != null )
265+ {
266+ callbackInterface .onDebugStatus ("IdentityDeviceID already in cache." );
267+ }
268+ callbackInterface .onSuccess (sIdentityDeviceID );
269+ return ;
270+ }
271+
272+ IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks () {
273+ @ Override
274+ public void onSuccess (String message ) {
275+ sIdentityDeviceID = message ;
276+ callbackInterface .onSuccess (message );
277+ }
278+
279+ @ Override
280+ public void onError (String message ) {
281+ callbackInterface .onError (message );
282+ }
283+
284+ @ Override
285+ public void onDebugStatus (String message ) {
286+ callbackInterface .onDebugStatus (message );
287+ }
288+ };
289+
290+ new RetrieveOEMInfoTask ().executeAsync (context , Uri .parse ("content://oem_info/oem.zebra.secure/identity_device_id" ),
291+ tempCallbackInterface );
292+
293+ }
294+
295+ public static void getWifiMacAddress (Context context , IDIResultCallbacks callbackInterface )
296+ {
297+ if (sWifiMac != null )
298+ {
299+ if (callbackInterface != null )
300+ {
301+ callbackInterface .onDebugStatus ("Wifi Mac Address already in cache." );
302+ }
303+ callbackInterface .onSuccess (sWifiMac );
304+ return ;
305+ }
306+
307+ IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks () {
308+ @ Override
309+ public void onSuccess (String message ) {
310+ sWifiMac = message ;
311+ callbackInterface .onSuccess (message );
312+ }
313+
314+ @ Override
315+ public void onError (String message ) {
316+ callbackInterface .onError (message );
317+ }
318+
319+ @ Override
320+ public void onDebugStatus (String message ) {
321+ callbackInterface .onDebugStatus (message );
322+ }
323+ };
324+
325+ new RetrieveOEMInfoTask ().executeAsync (context , Uri .parse ("content://oem_info/oem.zebra.secure/wifi_mac" ),
326+ tempCallbackInterface );
327+
328+ }
329+
330+ public static void getWifiAPMacAddress (Context context , IDIResultCallbacks callbackInterface )
331+ {
332+ if (sWifiAPMac != null )
333+ {
334+ if (callbackInterface != null )
335+ {
336+ callbackInterface .onDebugStatus ("Wifi AP Mac Address already in cache." );
337+ }
338+ callbackInterface .onSuccess (sWifiAPMac );
339+ return ;
340+ }
341+
342+ IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks () {
343+ @ Override
344+ public void onSuccess (String message ) {
345+ sWifiAPMac = message ;
346+ callbackInterface .onSuccess (message );
347+ }
348+
349+ @ Override
350+ public void onError (String message ) {
351+ callbackInterface .onError (message );
352+ }
353+
354+ @ Override
355+ public void onDebugStatus (String message ) {
356+ callbackInterface .onDebugStatus (message );
357+ }
358+ };
359+
360+ new RetrieveOEMInfoTask ().executeAsync (context , Uri .parse ("content://oem_info/oem.zebra.secure/wifi_ap_mac" ),
361+ tempCallbackInterface );
362+ }
363+
364+ public static void getWifiSSID (Context context , IDIResultCallbacks callbackInterface )
365+ {
366+ if (sWifiSSID != null )
367+ {
368+ if (callbackInterface != null )
369+ {
370+ callbackInterface .onDebugStatus ("Wifi SSID already in cache." );
371+ }
372+ callbackInterface .onSuccess (sWifiSSID );
373+ return ;
374+ }
375+
376+ IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks () {
377+ @ Override
378+ public void onSuccess (String message ) {
379+ sWifiSSID = message ;
380+ callbackInterface .onSuccess (message );
381+ }
382+
383+ @ Override
384+ public void onError (String message ) {
385+ callbackInterface .onError (message );
386+ }
387+
388+ @ Override
389+ public void onDebugStatus (String message ) {
390+ callbackInterface .onDebugStatus (message );
391+ }
392+ };
393+
394+ new RetrieveOEMInfoTask ().executeAsync (context , Uri .parse ("content://oem_info/oem.zebra.secure/wifi_ssid" ),
395+ tempCallbackInterface );
396+ }
397+
398+ public static void getEthernetMacAddress (Context context , IDIResultCallbacks callbackInterface )
399+ {
400+ if (sEthernetMac != null )
401+ {
402+ if (callbackInterface != null )
403+ {
404+ callbackInterface .onDebugStatus ("Ethernet Mac Address already in cache." );
405+ }
406+ callbackInterface .onSuccess (sEthernetMac );
407+ return ;
408+ }
409+
410+ IDIResultCallbacks tempCallbackInterface = new IDIResultCallbacks () {
411+ @ Override
412+ public void onSuccess (String message ) {
413+ sEthernetMac = message ;
414+ callbackInterface .onSuccess (message );
415+ }
416+
417+ @ Override
418+ public void onError (String message ) {
419+ callbackInterface .onError (message );
420+ }
421+
422+ @ Override
423+ public void onDebugStatus (String message ) {
424+ callbackInterface .onDebugStatus (message );
425+ }
426+ };
427+
428+ new RetrieveOEMInfoTask ().executeAsync (context , Uri .parse ("content://oem_info/oem.zebra.secure/ethernet_mac" ),
429+ tempCallbackInterface );
430+ }
431+
432+
218433}
0 commit comments