Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private suspend fun checkEnrolled(context: Context) {
- try {
- var showError = false
- val isEnrolled = awSDKManager?.isEnrolled
- if (isEnrolled == false) {
- showError = true
- }
- val sharedDeviceMode = awSDKManager?.sharedDeviceStatus?.isSharedDeviceModeEnabled
- if (sharedDeviceMode == true) {
- showError = true
- val jsonString = awSDKManager?.sharedDeviceStatus?.getcheckoutStatus()
- if (jsonString != null){
- val checkoutStatus = Serializer.fromJson(jsonString, CheckoutStatus::class.java)
- if (settings.isOnline){
- if (checkoutStatus.status != 0){
- showError = true
- }
- } else {
- showError = true
- }
- } else {
- showError = true
- }
- }
- if (showError) {
- eventsBroadcastChannel.send(SecurityMessage.IS_ENROLLED)
- }
- } catch (e: AirWatchSDKException) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement