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

Commit 79de37a9 authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge branch 'issue_2225_q' into test-top-bar-q

parents 0d6d8891 7b7eafb2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7985,6 +7985,8 @@
    <!-- Configure Notifications: setting title, whether the snooze menu is shown on notifications [CHAR LIMIT=80] -->
    <string name="snooze_options_title">Allow notification snoozing</string>
    <string name="hide_notification_icons">Hide notification icons</string>
    <!-- Configure Notifications: setting title [CHAR LIMIT=80] -->
    <string name="hide_silent_icons_title">Hide icons from gentle notifications</string>
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,12 @@
            android:title="@string/snooze_options_title"
            settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" />

        <SwitchPreference
            android:key="hide_notification_icons"
            lineage:requiresConfig="@*android:bool/config_hide_notificationIcons"
            android:title="@string/hide_notification_icons"
             />
        <!--settings:controller="com.android.settings.notification.HideNotificationIconsPreferenceController"-->
        <SwitchPreference
            android:key="asst_capabilities_actions_replies"
            android:title="@string/asst_capabilities_actions_replies_title"
+64 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.settings.notification;

import android.content.Context;
import android.provider.Settings;

import androidx.annotation.VisibleForTesting;

import com.android.settings.core.TogglePreferenceController;

import static android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE;

public class HideNotificationIconsPreferenceController extends TogglePreferenceController {

    private static final String TAG = "HideNotificationIconsPreferenceController";
    @VisibleForTesting
    static final int ON = 1;
    @VisibleForTesting
    static final int OFF = 0;

    /*
    mContext.getResources()
                .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons)
                ? AVAILABLE : UNSUPPORTED_ON_DEVICE;

    * */

    public HideNotificationIconsPreferenceController(Context context, String preferenceKey) {
        super(context, preferenceKey);
    }

    @Override
    public int getAvailabilityStatus() {
        return AVAILABLE;
    }

    @Override
    public boolean isChecked() {
        return true;
//        return mContext.getResources()
//                .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons);
    }

    @Override
    public boolean setChecked(boolean isChecked) {

       return isChecked;//Settings.Secure.putInt(mContext.getContentResolver(),SHOW_NOTIFICATION_SNOOZE, isChecked ? ON : OFF);
    }
}