diff --git a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java new file mode 100644 index 0000000000000000000000000000000000000000..4dc480af32add29e42fa9640b69aa017eb9b3ebe --- /dev/null +++ b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java @@ -0,0 +1,63 @@ +/** + * Copyright (C) 2014-2016 The CyanogenMod Project + * Copyright (C) 2018 The LineageOS 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 lineageos.preference; + +import android.content.Context; +import android.provider.Settings; +import android.util.AttributeSet; +import android.util.Log; +import lineageos.providers.LineageSettings; +import lineageos.providers.LineageSettings.System; + +public class HideNotificationSwitchPreference extends SelfRemovingSwitchPreference { + + public HideNotificationSwitchPreference(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 1"); + } + + public HideNotificationSwitchPreference(Context context, AttributeSet attrs) { + super(context, attrs); + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 2"); + } + + public HideNotificationSwitchPreference(Context context) { + + super(context, null); + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 3"); + } + + @Override + protected boolean isPersisted() { + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 4"); + return LineageSettings.System.getString(getContext().getContentResolver(), getKey()) != null; + } + + @Override + protected void putBoolean(String key, boolean value) { + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 5 key...."+key+"......value....."+value); + LineageSettings.System.putInt(getContext().getContentResolver(), key, value ? 1 : 0); + } + + @Override + protected boolean getBoolean(String key, boolean defaultValue) { + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 6 key...."+key+"......value....."+defaultValue); + return LineageSettings.System.getInt(getContext().getContentResolver(), + key, defaultValue ? 1 : 0) != 0; + } +} diff --git a/sdk/src/java/lineageos/providers/LineageSettings.java b/sdk/src/java/lineageos/providers/LineageSettings.java index 359eddb5b01908b18a58190b7c52bcac86138f8a..be47e7f423025d81bbdeefceccd37018b4ec3540 100644 --- a/sdk/src/java/lineageos/providers/LineageSettings.java +++ b/sdk/src/java/lineageos/providers/LineageSettings.java @@ -1698,10 +1698,24 @@ public final class LineageSettings { public static final String LOCKSCREEN_PIN_SCRAMBLE_LAYOUT = "lockscreen_scramble_pin_layout"; + /** @hide */ public static final Validator LOCKSCREEN_PIN_SCRAMBLE_LAYOUT_VALIDATOR = sBooleanValidator; + + /** + * hide notificationIcon area & move Right to left System iocn area + * 0 = 0ff, 1 = on + */ + public static final String HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON = + "hide_notificationIcon_left_system_icon"; + + /** @hide */ + public static final Validator HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON_VALIDATOR = + sBooleanValidator; + + /** * Whether keyguard will rotate to landscape mode * 0 = false, 1 = true @@ -2178,6 +2192,7 @@ public final class LineageSettings { LineageSettings.System.T9_SEARCH_INPUT_LOCALE, LineageSettings.System.BLUETOOTH_ACCEPT_ALL_FILES, LineageSettings.System.LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, + LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, LineageSettings.System.SHOW_ALARM_ICON, LineageSettings.System.STATUS_BAR_IME_SWITCHER, LineageSettings.System.QS_SHOW_BRIGHTNESS_SLIDER, @@ -2213,6 +2228,7 @@ public final class LineageSettings { LineageSettings.System.HEADSET_CONNECT_PLAYER, LineageSettings.System.ZEN_ALLOW_LIGHTS, LineageSettings.System.TOUCHSCREEN_GESTURE_HAPTIC_FEEDBACK, + }; /** @@ -2324,6 +2340,8 @@ public final class LineageSettings { VALIDATORS.put(BLUETOOTH_ACCEPT_ALL_FILES, BLUETOOTH_ACCEPT_ALL_FILES_VALIDATOR); VALIDATORS.put(LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, LOCKSCREEN_PIN_SCRAMBLE_LAYOUT_VALIDATOR); + VALIDATORS.put(HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, + HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON_VALIDATOR); VALIDATORS.put(LOCKSCREEN_ROTATION, LOCKSCREEN_ROTATION_VALIDATOR); VALIDATORS.put(SHOW_ALARM_ICON, SHOW_ALARM_ICON_VALIDATOR); VALIDATORS.put(STATUS_BAR_IME_SWITCHER, STATUS_BAR_IME_SWITCHER_VALIDATOR);