package com.epson.mobilephone.common.wifidirect;

import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel;
import java.util.ArrayDeque;
import java.util.Deque;

public class DialogProgressWiFiDirectViewModel extends ViewModel {
    public static final String DO_DISMISS = "do_dismiss";
    public static final String DO_SHOW = "do_show";
    private final MutableLiveData<Deque<String[]>> mJob = new MutableLiveData<>();
    private final Deque<String[]> mQueue = new ArrayDeque();

    public void doShow(String str) {
        this.mQueue.offer(new String[]{str, "do_show"});
        this.mJob.postValue(this.mQueue);
    }

    public void doDismiss(String str) {
        this.mQueue.offer(new String[]{str, "do_dismiss"});
        this.mJob.postValue(this.mQueue);
    }

    public MutableLiveData<Deque<String[]>> getDialogJob() {
        return this.mJob;
    }

    public String[] checkQueue() {
        String[] poll = this.mQueue.poll();
        if (poll != null) {
            this.mJob.postValue(this.mQueue);
        }
        return poll;
    }
}
