blob: 773ef0ef68ded4b0a0318761d6cb0e0c86c4f229 [file] [log] [blame]
Lucas Dupin97b8aae2019-01-15 17:45:26 -08001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16
17package com.android.settings.gestures;
18
Edgar Wang37884e92022-12-19 04:58:26 +000019import android.app.settings.SettingsEnums;
Lucas Dupin97b8aae2019-01-15 17:45:26 -080020import android.content.Context;
21import android.content.SharedPreferences;
Issei Suzukifd85a9f2019-02-26 16:16:47 +010022import android.hardware.display.AmbientDisplayConfiguration;
Lucas Dupin97b8aae2019-01-15 17:45:26 -080023
Lucas Dupin97b8aae2019-01-15 17:45:26 -080024import com.android.settings.R;
25import com.android.settings.dashboard.DashboardFragment;
26import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
27import com.android.settings.overlay.FeatureFactory;
28import com.android.settings.search.BaseSearchIndexProvider;
Lucas Dupin97b8aae2019-01-15 17:45:26 -080029import com.android.settingslib.search.SearchIndexable;
30
Lucas Dupin97b8aae2019-01-15 17:45:26 -080031@SearchIndexable
32public class TapScreenGestureSettings extends DashboardFragment {
33 private static final String TAG = "TapScreenGestureSettings";
34
35 public static final String PREF_KEY_SUGGESTION_COMPLETE =
36 "pref_tap_gesture_suggestion_complete";
37
38 @Override
39 public void onAttach(Context context) {
40 super.onAttach(context);
Chaohui Wang80a11a22022-03-29 11:49:34 +080041 SuggestionFeatureProvider suggestionFeatureProvider =
Chaohui Wang8e2ae542023-08-04 15:42:43 +080042 FeatureFactory.getFeatureFactory().getSuggestionFeatureProvider();
Lucas Dupin97b8aae2019-01-15 17:45:26 -080043 SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
44 prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
45
46 use(TapScreenGesturePreferenceController.class)
47 .setConfig(new AmbientDisplayConfiguration(context));
48 }
49
50 @Override
51 public int getMetricsCategory() {
Edgar Wang37884e92022-12-19 04:58:26 +000052 return SettingsEnums.SETTINGS_GESTURE_TAP_SCREEN;
Lucas Dupin97b8aae2019-01-15 17:45:26 -080053 }
54
55 @Override
56 protected String getLogTag() {
57 return TAG;
58 }
59
60 @Override
61 protected int getPreferenceScreenResId() {
62 return R.xml.tap_screen_gesture_settings;
63 }
64
Raff Tsaiac3e0d02019-09-19 17:06:45 +080065 public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
Raff Tsai1f30b1c2019-09-12 10:56:13 +080066 new BaseSearchIndexProvider(R.xml.tap_screen_gesture_settings);
Lucas Dupin97b8aae2019-01-15 17:45:26 -080067}