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

Commit 0a9fc3fe authored by narinder Rana's avatar narinder Rana Committed by Aayush Gupta
Browse files

Settings: Add preference to mirror system icons [1/3]

parent ee707890
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -8233,6 +8233,10 @@
    <!-- Configure Notifications: setting title, whether the snooze menu is shown on notifications [CHAR LIMIT=80] -->
    <string name="snooze_options_title">Allow notification snoozing</string>
    <!-- Mirror system icons -->
    <string name="mirror_system_icons_title">Mirror system icons</string>
    <string name="mirror_system_icons_summary">Mirror and moves system icons to the left-side of the status bar while hiding the notification icons</string>
    <!-- Configure Notifications: setting title [CHAR LIMIT=80] -->
    <string name="hide_silent_icons_title">Hide icons from gentle notifications</string>
+7 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 The Android Open Source Project
     Copyright (C) 2021 E FOUNDATION
     Copyright (C) 2021 ECORP

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -115,6 +117,11 @@
            android:title="@string/snooze_options_title"
            settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" />

        <lineageos.preference.HideNotificationSwitchPreference
            android:key="hide_notificationIcon_left_system_icon"
            android:title="@string/mirror_system_icons_title"
            android:summary="@string/mirror_system_icons_summary" />

        <SwitchPreference
            android:key="asst_capabilities_actions_replies"
            android:title="@string/asst_capabilities_actions_replies_title"
+58 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 E FOUNDATION
 * Copyright (C) 2021 ECORP
 *
 * 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 lineageos.providers.LineageSettings;


public class HideNotificationIconsPreferenceController extends TogglePreferenceController {

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

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

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

    @Override
    public boolean isChecked() {
        return Settings.Secure.getInt(mContext.getContentResolver(),
                LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, OFF) == ON;
    }

    @Override
    public boolean setChecked(boolean isChecked) {
        return Settings.Secure.putInt(mContext.getContentResolver(),
                LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, isChecked ? ON : OFF);
    }

}