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

Commit f4ace6fe authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Remove night mode from developer settings" into nyc-dev

parents 7893931a 686f9843
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -5710,7 +5710,6 @@
    <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_mode">dark theme, night mode, dim screen, invert brightness</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>
+0 −7
Original line number Diff line number Diff line
@@ -60,13 +60,6 @@
        android:summary="@string/runningservices_settings_summary"
        android:fragment="com.android.settings.applications.RunningServices" />

    <DropDownPreference
        android:key="night_mode"
        android:title="@string/night_mode_title"
        android:summary="%s"
        android:entries="@array/night_mode_entries"
        android:entryValues="@array/night_mode_values" />

    <PreferenceScreen
        android:key="convert_to_file_encryption"
        android:title="@string/convert_to_file_encryption"
+0 −24
Original line number Diff line number Diff line
@@ -202,7 +202,6 @@ public class DevelopmentSettings extends RestrictedSettingsFragment

    private static final String TERMINAL_APP_PACKAGE = "com.android.terminal";

    private static final String KEY_NIGHT_MODE = "night_mode";
    private static final String KEY_CONVERT_FBE = "convert_to_file_encryption";

    private static final String OTA_DISABLE_AUTOMATIC_UPDATE_KEY = "ota_disable_automatic_update";
@@ -292,8 +291,6 @@ public class DevelopmentSettings extends RestrictedSettingsFragment

    private SwitchPreference mShowAllANRs;

    private DropDownPreference mNightModePreference;

    private ColorModePreference mColorModePreference;

    private SwitchPreference mForceResizable;
@@ -479,27 +476,6 @@ public class DevelopmentSettings extends RestrictedSettingsFragment

        mOtaDisableAutomaticUpdate = findAndInitSwitchPref(OTA_DISABLE_AUTOMATIC_UPDATE_KEY);

        mNightModePreference = (DropDownPreference) findPreference(KEY_NIGHT_MODE);
        final UiModeManager uiManager = (UiModeManager) getSystemService(
                Context.UI_MODE_SERVICE);
        final int currentNightMode = uiManager.getNightMode();
        mNightModePreference.setValue(String.valueOf(currentNightMode));
        mNightModePreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
            @Override
            public boolean onPreferenceChange(Preference preference, Object newValue) {
                try {
                    final int value = Integer.parseInt((String) newValue);
                    final UiModeManager uiManager = (UiModeManager) getSystemService(
                            Context.UI_MODE_SERVICE);
                    uiManager.setNightMode(value);
                    return true;
                } catch (NumberFormatException e) {
                    Log.e(TAG, "could not persist night mode setting", e);
                    return false;
                }
            }
        });

        mColorModePreference = (ColorModePreference) findPreference(KEY_COLOR_MODE);
        mColorModePreference.updateCurrentAndSupported();
        if (mColorModePreference.getTransformsCount() < 2) {