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

Commit e5af9298 authored by Mady Mellor's avatar Mady Mellor Committed by Android (Google) Code Review
Browse files

Merge "Force badging to be true"

parents 4cfeaeaa 973bc216
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -138,6 +138,13 @@ public class PreferencesHelper implements RankingConfig {
    private boolean mAreChannelsBypassingDnd;
    private boolean mAreChannelsBypassingDnd;
    private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS;
    private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS;


    private static final String BADGING_FORCED_TRUE = "force_badging_true_for_bug";

    // STOPSHIP (b/142218092) this should be removed before ship
    static boolean wasBadgingForcedTrue(Context context) {
        return Settings.Secure.getInt(context.getContentResolver(), BADGING_FORCED_TRUE, 0) != 0;
    }

    public PreferencesHelper(Context context, PackageManager pm, RankingHandler rankingHandler,
    public PreferencesHelper(Context context, PackageManager pm, RankingHandler rankingHandler,
            ZenModeHelper zenHelper) {
            ZenModeHelper zenHelper) {
        mContext = context;
        mContext = context;
@@ -145,6 +152,14 @@ public class PreferencesHelper implements RankingConfig {
        mRankingHandler = rankingHandler;
        mRankingHandler = rankingHandler;
        mPm = pm;
        mPm = pm;


        // STOPSHIP (b/142218092) this should be removed before ship
        if (!wasBadgingForcedTrue(context)) {
            Settings.Secure.putInt(mContext.getContentResolver(),
                    Settings.Secure.NOTIFICATION_BADGING,
                    DEFAULT_SHOW_BADGE ? 1 : 0);
            Settings.Secure.putInt(context.getContentResolver(), BADGING_FORCED_TRUE, 1);
        }

        updateBadgingEnabled();
        updateBadgingEnabled();
        updateBubblesEnabled();
        updateBubblesEnabled();
        syncChannelsBypassingDnd(mContext.getUserId());
        syncChannelsBypassingDnd(mContext.getUserId());