<string name="help_url_font_size" translatable="false"></string>
<!-- Help URL, Display size [DO NOT TRANSLATE] -->
<string name="help_url_display_size" translatable="false"></string>
+ <!-- Help URL, Auto brightness [DO NOT TRANSLATE] -->
+ <string name="help_url_auto_brightness" translatable="false" />
<string name="help_url_network_dashboard" translatable="false"></string>
<string name="help_url_connected_devices" translatable="false"></string>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2018 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:key="auto_brightness_detail"
+ android:title="@string/auto_brightness_title"
+ settings:keywords="@string/keywords_display_auto_brightness">
+
+ <com.android.settings.widget.VideoPreference
+ android:key="auto_brightness_video"
+ settings:animation="@raw/aab_brightness"
+ settings:preview="@drawable/aab_brightness"/>
+
+ <!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
+ <com.android.settingslib.RestrictedSwitchPreference
+ android:key="auto_brightness"
+ android:title="@string/auto_brightness_title"
+ settings:controller="com.android.settings.display.AutoBrightnessPreferenceController"
+ settings:useAdminDisabledSummary="true"
+ settings:userRestriction="no_config_brightness" />
+
+</PreferenceScreen>
\ No newline at end of file
settings:widgetLayout="@null"
settings:keywords="@string/keywords_display_night_display" />
- <!-- Cross-listed item, if you change this, also change it in power_usage_summary.xml -->
- <com.android.settingslib.RestrictedSwitchPreference
- android:key="auto_brightness"
+ <Preference
+ android:key="auto_brightness_entry"
android:title="@string/auto_brightness_title"
android:summary="@string/auto_brightness_summary"
- settings:keywords="@string/keywords_display_auto_brightness"
- settings:controller="com.android.settings.display.AutoBrightnessPreferenceController"
- settings:useAdminDisabledSummary="true"
- settings:userRestriction="no_config_brightness" />
+ android:fragment="com.android.settings.display.AutoBrightnessSettings"
+ settings:controller="com.android.settings.display.AutoBrightnessPreferenceController" />
<com.android.settingslib.RestrictedPreference
android:key="wallpaper"
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.display.AmbientDisplayPreferenceController;
-import com.android.settings.display.AutoRotatePreferenceController;
import com.android.settings.display.BrightnessLevelPreferenceController;
import com.android.settings.display.CameraGesturePreferenceController;
import com.android.settings.display.ColorModePreferenceController;
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
private static final String KEY_AMBIENT_DISPLAY = "ambient_display";
-
+ private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness_entry";
private static final String KEY_NIGHT_DISPLAY = "night_display";
@Override
keys.add(KEY_DISPLAY_SIZE);
keys.add(WallpaperPreferenceController.KEY_WALLPAPER);
keys.add(KEY_NIGHT_DISPLAY);
+ keys.add(KEY_AUTO_BRIGHTNESS);
return keys;
}
--- /dev/null
+/*
+ * Copyright (C) 2018 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.
+ */
+
+package com.android.settings.display;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.provider.SearchIndexableResource;
+
+import com.android.internal.logging.nano.MetricsProto;
+import com.android.settings.R;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.search.BaseSearchIndexProvider;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class AutoBrightnessSettings extends DashboardFragment {
+
+ private static final String TAG = "AutoBrightnessSettings";
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ mFooterPreferenceMixin.createFooterPreference()
+ .setTitle(R.string.auto_brightness_description);
+ }
+
+ @Override
+ protected int getPreferenceScreenResId() {
+ return R.xml.auto_brightness_detail;
+ }
+
+ @Override
+ protected String getLogTag() {
+ return TAG;
+ }
+
+ @Override
+ public int getMetricsCategory() {
+ return MetricsProto.MetricsEvent.SETTINGS_AUTO_BRIGHTNESS;
+ }
+
+ @Override
+ public int getHelpResource() {
+ return R.string.help_url_auto_brightness;
+ }
+
+ public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+ new BaseSearchIndexProvider() {
+ @Override
+ public List<SearchIndexableResource> getXmlResourcesToIndex(
+ Context context, boolean enabled) {
+ final SearchIndexableResource sir = new SearchIndexableResource(context);
+ sir.xmlResId = R.xml.auto_brightness_detail;
+ return Arrays.asList(sir);
+ }
+ };
+}
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
-import com.android.settingslib.widget.FooterPreferenceMixin;
import java.util.ArrayList;
import java.util.Arrays;
public class SmartBatterySettings extends DashboardFragment {
public static final String TAG = "SmartBatterySettings";
- private final FooterPreferenceMixin mFooterPreferenceMixin =
- new FooterPreferenceMixin(this, getLifecycle());
-
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
}
@Override
- public List<String> getNonIndexableKeys(Context context) {
- return super.getNonIndexableKeys(context);
- }
-
- @Override
public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null, null);
import com.android.settings.deviceinfo.StorageDashboardFragment;
import com.android.settings.deviceinfo.StorageSettings;
import com.android.settings.display.AmbientDisplaySettings;
+import com.android.settings.display.AutoBrightnessSettings;
import com.android.settings.display.NightDisplaySettings;
import com.android.settings.display.ScreenZoomSettings;
import com.android.settings.dream.DreamSettings;
addIndex(DataUsageSummaryLegacy.class);
addIndex(ScreenZoomSettings.class);
addIndex(DisplaySettings.class);
+ addIndex(AutoBrightnessSettings.class);
addIndex(AmbientDisplaySettings.class);
addIndex(WallpaperTypeSettings.class);
addIndex(AppAndNotificationDashboardFragment.class);