Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 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){ private suspend fun checkEnrolled(context: Context) {
  20. try {
  21. var showError = false
  22. val isEnrolled = awSDKManager?.isEnrolled
  23. if (isEnrolled == false) {
  24. showError = true
  25. }
  26.  
  27. val sharedDeviceMode = awSDKManager?.sharedDeviceStatus?.isSharedDeviceModeEnabled
  28. if (sharedDeviceMode == true) {
  29. showError = true
  30. val jsonString = awSDKManager?.sharedDeviceStatus?.getcheckoutStatus()
  31.  
  32. if (jsonString != null){
  33. val checkoutStatus = Serializer.fromJson(jsonString, CheckoutStatus::class.java)
  34.  
  35. if (settings.isOnline){
  36.  
  37. if (checkoutStatus.status != 0){
  38. showError = true
  39. }
  40.  
  41. } else {
  42. showError = true
  43. }
  44.  
  45. } else {
  46. showError = true
  47. }
  48. }
  49.  
  50. if (showError) {
  51. eventsBroadcastChannel.send(SecurityMessage.IS_ENROLLED)
  52. }
  53. } catch (e: AirWatchSDKException) {
  54. }
  55. }
  56. showError = true
  57. }
  58.  
  59. } else {
  60. showError = true
  61. }
  62.  
  63. } else {
  64. showError = true
  65. }
  66. }
  67.  
  68. if (showError) {
  69. eventsBroadcastChannel.send(SecurityMessage.IS_ENROLLED)
  70. }
  71. } catch (e: AirWatchSDKException) {
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement