package com.breadwallet.tools.manager;

/**
 * BreadWallet
 * <p/>
 * Created by Mihail Gutan on <mihail@breadwallet.com> 7/18/17.
 * Copyright (c) 2017 breadwallet LLC
 * <p/>
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * <p/>
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * <p/>
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
public class PromptManager {

    public enum PromptList{
        FINGER_PRINT,
        PAPER_KEY,
        UPGRADE_PIN,
        RECOMMEND_RESCAN
    }
}

@@ -33,16 +33,438 @@
 nager;%0A%0A
+import android.content.Context;%0A%0Aimport com.breadwallet.tools.security.KeyStoreManager;%0A%0Aimport static com.breadwallet.tools.manager.PromptManager.PromptItem.FINGER_PRINT;%0Aimport static com.breadwallet.tools.manager.PromptManager.PromptItem.PAPER_KEY;%0Aimport static com.breadwallet.tools.manager.PromptManager.PromptItem.RECOMMEND_RESCAN;%0Aimport static com.breadwallet.tools.manager.PromptManager.PromptItem.UPGRADE_PIN;%0A%0A
 /**%0A * B
@@ -1734,12 +1734,13 @@
 ompt
-List
+Item 
 %7B%0A  
@@ -1828,12 +1828,906 @@
 CAN%0A
-
     %7D%0A
+%0A    public boolean shouldPrompt(Context app, PromptItem item) %7B%0A        assert (app != null);%0A        switch (item) %7B%0A            case FINGER_PRINT:%0A                return !SharedPreferencesManager.getUseFingerprint(app);%0A            case PAPER_KEY:%0A                return !SharedPreferencesManager.getPhraseWroteDown(app);%0A            case UPGRADE_PIN:%0A                return KeyStoreManager.getPinCode(app).length() != 6;%0A            case RECOMMEND_RESCAN:%0A                return false; //todo add code to this%0A%0A        %7D%0A        return false;%0A    %7D%0A%0A    public PromptItem nextPrompt(Context app) %7B%0A        if (shouldPrompt(app, RECOMMEND_RESCAN)) return RECOMMEND_RESCAN;%0A        if (shouldPrompt(app, UPGRADE_PIN)) return UPGRADE_PIN;%0A        if (shouldPrompt(app, PAPER_KEY)) return PAPER_KEY;%0A        if (shouldPrompt(app, FINGER_PRINT)) return FINGER_PRINT;%0A        return null;%0A    %7D%0A%0A
 %7D%0A

implement the PromptManager