Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. private suspend fun checkEnrolled(context: Context) {
  2. try {
  3. var showError = false
  4. val isEnrolled = awSDKManager?.isEnrolled
  5. if (isEnrolled == false) {
  6. showError = true
  7. }
  8.  
  9. val sharedDeviceMode = awSDKManager?.sharedDeviceStatus?.isSharedDeviceModeEnabled
  10. if (sharedDeviceMode == true) {
  11. showError = true
  12. val jsonString = awSDKManager?.sharedDeviceStatus?.getcheckoutStatus()
  13.  
  14. if (jsonString != null){
  15. val checkoutStatus = Serializer.fromJson(jsonString, CheckoutStatus::class.java)
  16.  
  17. if (settings.isOnline){
  18.  
  19. if (checkoutStatus.status != 0){
  20. showError = true
  21. }
  22.  
  23. } else {
  24. showError = true
  25. }
  26.  
  27. } else {
  28. showError = true
  29. }
  30. }
  31.  
  32. if (showError) {
  33. eventsBroadcastChannel.send(SecurityMessage.IS_ENROLLED)
  34. }
  35. } catch (e: AirWatchSDKException) {
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement