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

Commit c2bcc727 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Introduce IMPORTANCE_MIN." into nyc-dev

parents 2071eda1 518b93f5
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -5966,17 +5966,20 @@
    <!-- [CHAR LIMIT=100] Notification Importance slider: blocked importance level description -->
    <string name="notification_importance_blocked">Blocked: Never show these notifications</string>
    <!-- [CHAR LIMIT=100] Notification Importance slider: min importance level description -->
    <string name="notification_importance_min">Min: Silently show at the bottom of the notification list</string>
    <!-- [CHAR LIMIT=100] Notification Importance slider: low importance level description -->
    <string name="notification_importance_low">Low: Silently show at the bottom of the notification list</string>
    <string name="notification_importance_low">Low: Silently show these notifications</string>
    <!-- [CHAR LIMIT=100] Notification Importance slider: normal importance level description -->
    <string name="notification_importance_default">Normal: Silently show these notifications</string>
    <string name="notification_importance_default">Normal: Allow these notification to make sounds</string>
    <!-- [CHAR LIMIT=100] Notification Importance slider: high importance level description -->
    <string name="notification_importance_high">High: Show at the top of the notifications list and allow sound</string>
    <string name="notification_importance_high">High: Peek onto the screen and allow sound and allow sound</string>
    <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description -->
    <string name="notification_importance_max">Urgent: Peek onto the screen and allow sound</string>
    <string name="notification_importance_max">Urgent: Show at the top of the notifications list, peek onto the screen and allow sound</string>
    <!-- [CHAR LIMIT=60] Notification importance reset button -->
    <string name="importance_reset">Reset</string>
+4 −4
Original line number Diff line number Diff line
@@ -106,12 +106,12 @@ public class AppNotificationSettings extends NotificationSettingsBase {
        final boolean allowPrivate = getLockscreenAllowPrivateNotifications();

        if (getPreferenceScreen().findPreference(mBlock.getKey()) != null) {
            setVisible(mSilent, checkCanBeVisible(Ranking.IMPORTANCE_LOW, importance));
            mSilent.setChecked(importance == Ranking.IMPORTANCE_DEFAULT);
            setVisible(mSilent, checkCanBeVisible(Ranking.IMPORTANCE_MIN, importance));
            mSilent.setChecked(importance == Ranking.IMPORTANCE_LOW);
        }
        setVisible(mPriority, checkCanBeVisible(Ranking.IMPORTANCE_LOW, importance)
        setVisible(mPriority, checkCanBeVisible(Ranking.IMPORTANCE_DEFAULT, importance)
                && !mDndVisualEffectsSuppressed);
        setVisible(mSensitive, checkCanBeVisible(Ranking.IMPORTANCE_HIGH, importance)
        setVisible(mSensitive, checkCanBeVisible(Ranking.IMPORTANCE_MIN, importance)
                && lockscreenSecure && lockscreenNotificationsEnabled && allowPrivate);
    }

+4 −2
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
            mImportanceTitle.setSummary(getProgressSummary(importance));
            mImportance.setSystemApp(isSystemApp);
            mImportance.setMinimumProgress(
                    isSystemApp ? Ranking.IMPORTANCE_LOW : Ranking.IMPORTANCE_NONE);
                    isSystemApp ? Ranking.IMPORTANCE_MIN : Ranking.IMPORTANCE_NONE);
            mImportance.setMax(Ranking.IMPORTANCE_MAX);
            mImportance.setProgress(importance);
            mImportance.setCallback(new ImportanceSeekBarPreference.Callback() {
@@ -230,7 +230,7 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
                public boolean onPreferenceChange(Preference preference, Object newValue) {
                    final boolean silenced = (Boolean) newValue;
                    final int importance =
                            silenced ? Ranking.IMPORTANCE_DEFAULT : Ranking.IMPORTANCE_UNSPECIFIED;
                            silenced ? Ranking.IMPORTANCE_LOW : Ranking.IMPORTANCE_UNSPECIFIED;
                    mBackend.setImportance(mPkgInfo.packageName, mUid, importance);
                    updateDependents(importance);
                    return true;
@@ -244,6 +244,8 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
        switch (progress) {
            case Ranking.IMPORTANCE_NONE:
                return mContext.getString(R.string.notification_importance_blocked);
            case Ranking.IMPORTANCE_MIN:
                return mContext.getString(R.string.notification_importance_min);
            case Ranking.IMPORTANCE_LOW:
                return mContext.getString(R.string.notification_importance_low);
            case Ranking.IMPORTANCE_DEFAULT:
+5 −0
Original line number Diff line number Diff line
@@ -109,6 +109,11 @@ public class NotificationStation extends SettingsPreferenceFragment {
        public void onNotificationRankingUpdate(RankingMap ranking) {
            mRanking = ranking;
        }

        @Override
        public void onListenerConnected() {
            mRanking = getCurrentRanking();
        }
    };

    private Context mContext;