Add double-tap & lift gestures to display settings
Now they're in both languages & input and display. Change-Id: Ib0d9fa1aa39656662307e2fc8fda70443f1ae8ed Fixes: 36415612 Test: robotests
This commit is contained in:
@@ -56,10 +56,10 @@
|
||||
android:title="@string/display_auto_rotate_title" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="auto_brightness"
|
||||
android:title="@string/auto_brightness_title"
|
||||
settings:keywords="@string/keywords_display_auto_brightness"
|
||||
android:summary="@string/auto_brightness_summary" />
|
||||
android:key="auto_brightness"
|
||||
android:title="@string/auto_brightness_title"
|
||||
settings:keywords="@string/keywords_display_auto_brightness"
|
||||
android:summary="@string/auto_brightness_summary" />
|
||||
|
||||
<Preference
|
||||
android:key="font_size"
|
||||
@@ -87,32 +87,42 @@
|
||||
android:entryValues="@array/night_mode_values" /> -->
|
||||
|
||||
<SwitchPreference
|
||||
android:key="camera_gesture"
|
||||
android:title="@string/camera_gesture_title"
|
||||
android:summary="@string/camera_gesture_desc" />
|
||||
android:key="camera_gesture"
|
||||
android:title="@string/camera_gesture_title"
|
||||
android:summary="@string/camera_gesture_desc" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="lift_to_wake"
|
||||
android:title="@string/lift_to_wake_title" />
|
||||
android:key="lift_to_wake"
|
||||
android:title="@string/lift_to_wake_title" />
|
||||
|
||||
<Preference
|
||||
android:key="gesture_double_tap_screen"
|
||||
android:title="@string/ambient_display_title"
|
||||
android:fragment="com.android.settings.gestures.DoubleTapScreenSettings"/>
|
||||
|
||||
<Preference
|
||||
android:key="gesture_pick_up"
|
||||
android:title="@string/ambient_display_pickup_title"
|
||||
android:fragment="com.android.settings.gestures.PickupGestureSettings"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="doze"
|
||||
android:title="@string/doze_title"
|
||||
android:summary="@string/doze_summary" />
|
||||
android:key="doze"
|
||||
android:title="@string/doze_title"
|
||||
android:summary="@string/doze_summary" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="tap_to_wake"
|
||||
android:title="@string/tap_to_wake"
|
||||
android:summary="@string/tap_to_wake_summary" />
|
||||
android:key="tap_to_wake"
|
||||
android:title="@string/tap_to_wake"
|
||||
android:summary="@string/tap_to_wake_summary" />
|
||||
|
||||
<ListPreference
|
||||
android:key="theme"
|
||||
android:title="@string/device_theme"
|
||||
android:summary="%s" />
|
||||
android:key="theme"
|
||||
android:title="@string/device_theme"
|
||||
android:summary="%s" />
|
||||
|
||||
<DropDownPreference
|
||||
android:key="vr_display_pref"
|
||||
android:summary="%s"
|
||||
android:title="@string/display_vr_pref_title" />
|
||||
android:key="vr_display_pref"
|
||||
android:summary="%s"
|
||||
android:title="@string/display_vr_pref_title" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
@@ -17,10 +17,13 @@
|
||||
package com.android.settings;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.SearchIndexableResource;
|
||||
|
||||
import com.android.internal.hardware.AmbientDisplayConfiguration;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.core.PreferenceController;
|
||||
import com.android.settings.core.lifecycle.Lifecycle;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.display.AutoBrightnessPreferenceController;
|
||||
import com.android.settings.display.AutoRotatePreferenceController;
|
||||
@@ -36,6 +39,8 @@ import com.android.settings.display.ThemePreferenceController;
|
||||
import com.android.settings.display.TimeoutPreferenceController;
|
||||
import com.android.settings.display.VrDisplayPreferenceController;
|
||||
import com.android.settings.display.WallpaperPreferenceController;
|
||||
import com.android.settings.gestures.DoubleTapScreenPreferenceController;
|
||||
import com.android.settings.gestures.PickupGesturePreferenceController;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.search.Indexable;
|
||||
|
||||
@@ -68,7 +73,7 @@ public class DisplaySettings extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
protected List<PreferenceController> getPreferenceControllers(Context context) {
|
||||
return buildPreferenceControllers(context);
|
||||
return buildPreferenceControllers(context, getLifecycle());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,7 +81,8 @@ public class DisplaySettings extends DashboardFragment {
|
||||
return R.string.help_uri_display;
|
||||
}
|
||||
|
||||
private static List<PreferenceController> buildPreferenceControllers(Context context) {
|
||||
private static List<PreferenceController> buildPreferenceControllers(
|
||||
Context context, Lifecycle lifecycle) {
|
||||
final List<PreferenceController> controllers = new ArrayList<>();
|
||||
controllers.add(new AutoBrightnessPreferenceController(context));
|
||||
controllers.add(new AutoRotatePreferenceController(context));
|
||||
@@ -87,6 +93,11 @@ public class DisplaySettings extends DashboardFragment {
|
||||
controllers.add(new NightDisplayPreferenceController(context));
|
||||
controllers.add(new NightModePreferenceController(context));
|
||||
controllers.add(new ScreenSaverPreferenceController(context));
|
||||
AmbientDisplayConfiguration ambientDisplayConfig = new AmbientDisplayConfiguration(context);
|
||||
controllers.add(new PickupGesturePreferenceController(
|
||||
context, lifecycle, ambientDisplayConfig, UserHandle.myUserId()));
|
||||
controllers.add(new DoubleTapScreenPreferenceController(
|
||||
context, lifecycle, ambientDisplayConfig, UserHandle.myUserId()));
|
||||
controllers.add(new TapToWakePreferenceController(context));
|
||||
controllers.add(new TimeoutPreferenceController(context));
|
||||
controllers.add(new VrDisplayPreferenceController(context));
|
||||
@@ -110,7 +121,7 @@ public class DisplaySettings extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
public List<PreferenceController> getPreferenceControllers(Context context) {
|
||||
return buildPreferenceControllers(context);
|
||||
return buildPreferenceControllers(context, null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -250,7 +250,7 @@ public class DatabaseIndexingManagerTest {
|
||||
SearchIndexableResource resource = getFakeResource(R.xml.display_settings);
|
||||
mManager.indexOneSearchIndexableData(mDb, localeStr, resource, new HashMap<>());
|
||||
Cursor cursor = mDb.rawQuery("SELECT * FROM prefs_index", null);
|
||||
assertThat(cursor.getCount()).isEqualTo(16);
|
||||
assertThat(cursor.getCount()).isEqualTo(18);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -265,7 +265,7 @@ public class DatabaseIndexingManagerTest {
|
||||
Cursor cursor = mDb.rawQuery("SELECT * FROM prefs_index WHERE enabled = 0", null);
|
||||
assertThat(cursor.getCount()).isEqualTo(2);
|
||||
cursor = mDb.rawQuery("SELECT * FROM prefs_index WHERE enabled = 1", null);
|
||||
assertThat(cursor.getCount()).isEqualTo(14);
|
||||
assertThat(cursor.getCount()).isEqualTo(16);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user