Cherish: Only allow edge lights on AOD when AOD is enabled [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -874,6 +874,7 @@
|
||||
<string name="pulse_ambient_light_repeat_direction_restart">Restart</string>
|
||||
<string name="pulse_ambient_light_repeat_direction_reverse">Reverse</string>
|
||||
<string name="ambient_notification_light_enabled_title">Show on always on</string>
|
||||
<string name="aod_disabled">AOD is disabled</string>
|
||||
<string name="ambient_notification_light_enabled_summary">Show light pulse on new notification using always on</string>
|
||||
<string name="ambient_notification_light_color_title">Custom color</string>
|
||||
<string name="ambient_notification_light_color_summary">Default color for light pulse</string>
|
||||
|
||||
@@ -163,7 +163,8 @@
|
||||
android:key="ambient_notification_light_enabled"
|
||||
android:title="@string/ambient_notification_light_enabled_title"
|
||||
android:summary="@string/ambient_notification_light_enabled_summary"
|
||||
android:defaultValue="false" />
|
||||
android:defaultValue="false"
|
||||
android:persistent="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="ambient_notification_light_hide_aod"
|
||||
|
||||
@@ -2,7 +2,14 @@ package com.cherish.settings.fragments;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.content.ContentResolver;
|
||||
import com.android.settings.R;
|
||||
import android.content.res.Resources;
|
||||
@@ -30,6 +37,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
private static final String AMBIENT_LIGHT_REPEAT_COUNT = "ambient_light_repeat_count";
|
||||
private static final String PULSE_COLOR_MODE_PREF = "ambient_notification_light_color_mode";
|
||||
private static final String INCALL_VIB_OPTIONS = "incall_vib_options";
|
||||
private static final String KEY_AMBIENT = "ambient_notification_light_enabled";
|
||||
|
||||
private Preference mChargingLeds;
|
||||
private ColorPickerPreference mEdgeLightColorPreference;
|
||||
@@ -37,7 +45,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
private SystemSettingSeekBarPreference mEdgeLightRepeatCountPreference;
|
||||
private ListPreference mColorMode;
|
||||
private SystemSettingListPreference mAmbientLightLayout;
|
||||
|
||||
private SystemSettingSwitchPreference mAmbientPref;
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
@@ -58,6 +66,15 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
prefScreen.removePreference(incallVibCategory);
|
||||
}
|
||||
|
||||
mAmbientPref = (SystemSettingSwitchPreference) findPreference(KEY_AMBIENT);
|
||||
boolean aodEnabled = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.DOZE_ALWAYS_ON, 0, UserHandle.USER_CURRENT) == 1;
|
||||
if (!aodEnabled) {
|
||||
mAmbientPref.setChecked(false);
|
||||
mAmbientPref.setEnabled(false);
|
||||
mAmbientPref.setSummary(R.string.aod_disabled);
|
||||
}
|
||||
|
||||
mEdgeLightRepeatCountPreference = (SystemSettingSeekBarPreference) findPreference(AMBIENT_LIGHT_REPEAT_COUNT);
|
||||
mEdgeLightRepeatCountPreference.setOnPreferenceChangeListener(this);
|
||||
int rCount = Settings.System.getInt(getContentResolver(),
|
||||
|
||||
Reference in New Issue
Block a user