129d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright/*
229d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * Copyright (C) 2018 The Android Open Source Project
329d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright *
429d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * Licensed under the Apache License, Version 2.0 (the "License");
529d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * you may not use this file except in compliance with the License.
629d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * You may obtain a copy of the License at
729d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright *
829d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright *      http://www.apache.org/licenses/LICENSE-2.0
929d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright *
1029d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * Unless required by applicable law or agreed to in writing, software
1129d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * distributed under the License is distributed on an "AS IS" BASIS,
1229d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1329d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * See the License for the specific language governing permissions and
1429d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright * limitations under the License.
1529d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright */
1629d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
1729d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightpackage com.android.settings.accessibility;
1829d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
1929d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightimport android.content.Context;
2029d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightimport android.provider.SearchIndexableResource;
2129d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
2229d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightimport com.android.internal.logging.nano.MetricsProto.MetricsEvent;
2329d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightimport com.android.settings.R;
246ccc81818d954032ad38484f4df4d2636898e97dFan Zhangimport com.android.settings.dashboard.DashboardFragment;
2529d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightimport com.android.settings.search.BaseSearchIndexProvider;
2629d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
2729d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightimport java.util.ArrayList;
2829d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wrightimport java.util.List;
2929d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
3029d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright/**
316ccc81818d954032ad38484f4df4d2636898e97dFan Zhang * Accessibility settings for the vibration.
3229d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright */
336ccc81818d954032ad38484f4df4d2636898e97dFan Zhangpublic class VibrationSettings extends DashboardFragment {
3429d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
356ccc81818d954032ad38484f4df4d2636898e97dFan Zhang    private static final String TAG = "VibrationSettings";
3629d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
3729d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    @Override
3829d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    public int getMetricsCategory() {
3929d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright        return MetricsEvent.ACCESSIBILITY_VIBRATION;
4029d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    }
4129d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
4229d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    @Override
436ccc81818d954032ad38484f4df4d2636898e97dFan Zhang    protected int getPreferenceScreenResId() {
446ccc81818d954032ad38484f4df4d2636898e97dFan Zhang        return R.xml.accessibility_vibration_settings;
4529d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    }
4629d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
4729d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    @Override
486ccc81818d954032ad38484f4df4d2636898e97dFan Zhang    protected String getLogTag() {
496ccc81818d954032ad38484f4df4d2636898e97dFan Zhang        return TAG;
5029d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    }
5129d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright
5229d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
5329d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright            new BaseSearchIndexProvider() {
5429d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                @Override
5529d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
5629d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                        boolean enabled) {
5729d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                    List<SearchIndexableResource> indexables = new ArrayList<>();
5829d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                    SearchIndexableResource indexable = new SearchIndexableResource(context);
5929d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                    indexable.xmlResId = R.xml.accessibility_vibration_settings;
6029d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                    indexables.add(indexable);
6129d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                    return indexables;
6229d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright                }
6329d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright            };
6429d526719ade4fc0f8ac69fac0e961f7fea35b25Michael Wright}
65