Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1093c65b authored by Ats Jenk's avatar Ats Jenk Committed by Automerger Merge Worker
Browse files

Merge "Add an option to disable showing bubbles EDU" into udc-qpr-dev am: 42058f12

parents d82d887b 42058f12
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -52,6 +52,11 @@ public class BubbleDebugConfig {
    private static final boolean FORCE_SHOW_USER_EDUCATION = false;
    private static final String FORCE_SHOW_USER_EDUCATION_SETTING =
            "force_show_bubbles_user_education";
    /**
     * When set to true, bubbles user education flow never shows up.
     */
    private static final String FORCE_HIDE_USER_EDUCATION_SETTING =
            "force_hide_bubbles_user_education";

    /**
     * @return whether we should force show user education for bubbles. Used for debugging & demos.
@@ -62,6 +67,14 @@ public class BubbleDebugConfig {
        return FORCE_SHOW_USER_EDUCATION || forceShow;
    }

    /**
     * @return whether we should never show user education for bubbles. Used in tests.
     */
    static boolean neverShowUserEducation(Context context) {
        return Settings.Secure.getInt(context.getContentResolver(),
                FORCE_HIDE_USER_EDUCATION_SETTING, 0) != 0;
    }

    static String formatBubblesString(List<Bubble> bubbles, BubbleViewProvider selected) {
        StringBuilder sb = new StringBuilder();
        for (Bubble bubble : bubbles) {
+12 −0
Original line number Diff line number Diff line
@@ -1284,6 +1284,12 @@ public class BubbleStackView extends FrameLayout
        if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
            Log.d(TAG, "Show manage edu: " + shouldShow);
        }
        if (shouldShow && BubbleDebugConfig.neverShowUserEducation(mContext)) {
            if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
                Log.d(TAG, "Want to show manage edu, but it is forced hidden");
            }
            return false;
        }
        return shouldShow;
    }

@@ -1316,6 +1322,12 @@ public class BubbleStackView extends FrameLayout
        if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
            Log.d(TAG, "Show stack edu: " + shouldShow);
        }
        if (shouldShow && BubbleDebugConfig.neverShowUserEducation(mContext)) {
            if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
                Log.d(TAG, "Want to show stack edu, but it is forced hidden");
            }
            return false;
        }
        return shouldShow;
    }