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

Commit e577ed1b authored by Justin Klaassen's avatar Justin Klaassen Committed by Android (Google) Code Review
Browse files

Merge "Add Night display settings" into nyc-mr1-dev

parents 48aab452 c7cd2982
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
-keep class com.android.settings.overlay.FeatureFactoryImpl
-keep class com.android.settings.accessibility.*FragmentForSetupWizard
-keep class com.android.settings.display.*FragmentForSetupWizard
-keep class com.android.settings.display.NightDisplaySettings

# Keep click responders
-keepclassmembers class com.android.settings.inputmethod.UserDictionaryAddWordActivity {
+34 −0
Original line number Diff line number Diff line
@@ -2133,6 +2133,39 @@
    <!-- Sound & display settings screen, setting option summary to enable adaptive brightness [CHAR LIMIT=100] -->
    <string name="auto_brightness_summary">Optimize brightness level for available light</string>
    <!-- Night display screen, setting option name to enable night display. [CHAR LIMIT=30] -->
    <string name="night_display_title">Night display</string>
    <!-- Night display screen, description of night display feature. [CHAR LIMIT=NONE] -->
    <string name="night_display_text">Night display tints your screen red at night. This makes it easier to look at your screen in dim light and may help you fall asleep more easily.</string>
    <!-- Night display screen, setting option name to configure whether night display turn on/off automatically. [CHAR LIMIT=30] -->
    <string name="night_display_auto_mode_title">Turn on automatically</string>
    <!-- Night display screen, setting option value for night display to *never* turn on/off automatically. [CHAR LIMIT=30] -->
    <string name="night_display_auto_mode_never">Never</string>
    <!-- Night display screen, setting option value for night display to turn on/off automatically according to a user defined schedule. [CHAR LIMIT=30] -->
    <string name="night_display_auto_mode_custom">Custom schedule</string>
    <!-- Night display screen, setting option value for night display to turn on/off automatically at sunset/sunrise. [CHAR LIMIT=30] -->
    <string name="night_display_auto_mode_twilight">Sunset to sunrise</string>
    <!-- Night display screen, setting option name to configure time to automatically turn on night display. [CHAR LIMIT=30] -->
    <string name="night_display_start_time_title">Start time</string>
    <!-- Night display screen, setting option name to configure time to automatically turn off night display. [CHAR LIMIT=30] -->
    <string name="night_display_end_time_title">End time</string>
    <!-- Display settings screen, summary format of night display when off. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_off">Off / <xliff:g name="auto_mode_summary" example="Never turn on automatically">%1$s</xliff:g></string>
    <!-- Display settings screen, summary of night display when off and will *never* turn on automatically. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_off_auto_mode_never">Never turn on automatically</string>
    <!-- Display settings screen, summary format of night display when off and will turn on automatically at a user defined time. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_off_auto_mode_custom">Turn on automatically at <xliff:g name="time" example="6 AM">%1$s</xliff:g></string>
    <!-- Display settings screen, summary of night display when off and will turn on automatically at sunset. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_off_auto_mode_twilight">Turn on automatically at sunset</string>
    <!-- Display settings screen, summary format of night display when on. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_on">On / <xliff:g name="auto_mode_summary" example="Never turn off automatically">%1$s</xliff:g></string>
    <!-- Display settings screen, summary of night display when on and will *never* turn off automatically. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_on_auto_mode_never">Never turn off automatically</string>
    <!-- Display settings screen, summary format of night display when on and will turn off automatically at a user defined time. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_on_auto_mode_custom">Turn off automatically at <xliff:g name="time" example="10 PM">%1$s</xliff:g></string>
    <!-- Display settings screen, summary of night display when on and will turn off automatically at sunrise. [CHAR LIMIT=NONE] -->
    <string name="night_display_summary_on_auto_mode_twilight">Turn off automatically at sunrise</string>
    <!-- Sound & display settings screen, setting option name to change screen timeout -->
    <string name="screen_timeout">Sleep</string>
    <!-- Sound & display settings screen, setting option name to change screen timeout [CHAR LIMIT=30] -->
@@ -5825,6 +5858,7 @@
    <string name="keywords_display">screen, touchscreen</string>
    <string name="keywords_display_brightness_level">dim screen, touchscreen, battery</string>
    <string name="keywords_display_auto_brightness">dim screen, touchscreen, battery</string>
    <string name="keywords_display_night_display">dim screen, night, tint</string>
    <string name="keywords_display_wallpaper">background, personalize, customize display</string>
    <string name="keywords_display_font_size">text size</string>
    <string name="keywords_display_cast_screen">project, cast</string>
+6 −0
Original line number Diff line number Diff line
@@ -32,6 +32,12 @@
                settings:keywords="@string/keywords_display_auto_brightness"
                android:summary="@string/auto_brightness_summary" />

        <com.android.settings.display.NightDisplayPreference
                android:key="night_display"
                android:title="@string/night_display_title"
                android:fragment="com.android.settings.display.NightDisplaySettings"
                settings:keywords="@string/keywords_display_night_display" />

        <!-- Hide night mode for now
        <ListPreference
            android:key="night_mode"
+41 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->

<PreferenceScreen
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:settings="http://schemas.android.com/apk/res-auto"
        android:title="@string/night_display_title">

    <DropDownPreference
            android:key="night_display_auto_mode"
            android:title="@string/night_display_auto_mode_title"
            android:persistent="false"
            android:summary="%s" />

    <Preference
            android:key="night_display_start_time"
            android:title="@string/night_display_start_time_title" />

    <Preference
            android:key="night_display_end_time"
            android:title="@string/night_display_end_time_title" />

    <com.android.settings.fuelgauge.WallOfTextPreference
            android:summary="@string/night_display_text"
            android:selectable="false"
            settings:allowDividerAbove="true" />

</PreferenceScreen>
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import android.support.v7.preference.Preference.OnPreferenceChangeListener;
import android.text.TextUtils;
import android.util.Log;

import com.android.internal.app.NightDisplayController;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.internal.view.RotationPolicy;
@@ -83,6 +84,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
    private static final String KEY_TAP_TO_WAKE = "tap_to_wake";
    private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness";
    private static final String KEY_AUTO_ROTATE = "auto_rotate";
    private static final String KEY_NIGHT_DISPLAY = "night_display";
    private static final String KEY_NIGHT_MODE = "night_mode";
    private static final String KEY_CAMERA_GESTURE = "camera_gesture";
    private static final String KEY_WALLPAPER = "wallpaper";
@@ -129,6 +131,10 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
            removePreference(KEY_AUTO_BRIGHTNESS);
        }

        if (!NightDisplayController.isAvailable(activity)) {
            removePreference(KEY_NIGHT_DISPLAY);
        }

        if (isLiftToWakeAvailable(activity)) {
            mLiftToWakePreference = (SwitchPreference) findPreference(KEY_LIFT_TO_WAKE);
            mLiftToWakePreference.setOnPreferenceChangeListener(this);
@@ -496,6 +502,9 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
                    if (!isAutomaticBrightnessAvailable(context.getResources())) {
                        result.add(KEY_AUTO_BRIGHTNESS);
                    }
                    if (!NightDisplayController.isAvailable(context)) {
                        result.add(KEY_NIGHT_DISPLAY);
                    }
                    if (!isLiftToWakeAvailable(context)) {
                        result.add(KEY_LIFT_TO_WAKE);
                    }
Loading