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

Commit 42058f12 authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge "Add an option to disable showing bubbles EDU" into udc-qpr-dev

parents 8a5c6453 42427493
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,11 @@ public class BubbleDebugConfig {
    private static final boolean FORCE_SHOW_USER_EDUCATION = false;
    private static final boolean FORCE_SHOW_USER_EDUCATION = false;
    private static final String FORCE_SHOW_USER_EDUCATION_SETTING =
    private static final String FORCE_SHOW_USER_EDUCATION_SETTING =
            "force_show_bubbles_user_education";
            "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.
     * @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 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) {
    static String formatBubblesString(List<Bubble> bubbles, BubbleViewProvider selected) {
        StringBuilder sb = new StringBuilder();
        StringBuilder sb = new StringBuilder();
        for (Bubble bubble : bubbles) {
        for (Bubble bubble : bubbles) {
+12 −0
Original line number Original line Diff line number Diff line
@@ -1284,6 +1284,12 @@ public class BubbleStackView extends FrameLayout
        if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
        if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
            Log.d(TAG, "Show manage edu: " + shouldShow);
            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;
        return shouldShow;
    }
    }


@@ -1316,6 +1322,12 @@ public class BubbleStackView extends FrameLayout
        if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
        if (BubbleDebugConfig.DEBUG_USER_EDUCATION) {
            Log.d(TAG, "Show stack edu: " + shouldShow);
            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;
        return shouldShow;
    }
    }