blob: 7df19f54660d79923114bfc93d1e534a42b5e39f [file] [log] [blame]
Anton Philippovadfec552017-01-25 20:37:36 +00001/*
2 * Copyright (C) 2017 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.backup;
18
Fan Zhang31b21002019-01-16 13:49:47 -080019import android.app.settings.SettingsEnums;
Anton Philippovadfec552017-01-25 20:37:36 +000020import android.content.Context;
21import android.os.Bundle;
Anton Philippovadfec552017-01-25 20:37:36 +000022
Anton Philippovadfec552017-01-25 20:37:36 +000023import com.android.settings.R;
Anton Philippovadfec552017-01-25 20:37:36 +000024import com.android.settings.dashboard.DashboardFragment;
25import com.android.settings.search.BaseSearchIndexProvider;
Raff Tsai966fa012019-09-25 11:19:06 +080026import com.android.settingslib.search.Indexable;
Tony Mantler1d583e12017-06-13 13:09:25 -070027import com.android.settingslib.core.AbstractPreferenceController;
Tony Mantler0fcd6cb2018-03-26 15:17:25 -070028import com.android.settingslib.search.SearchIndexable;
Anton Philippovadfec552017-01-25 20:37:36 +000029
30import java.util.ArrayList;
Anton Philippovadfec552017-01-25 20:37:36 +000031import java.util.List;
32
33/**
34 * Fragment showing the items to launch different backup settings screens.
35 */
Tony Mantler0fcd6cb2018-03-26 15:17:25 -070036@SearchIndexable
Anton Philippovadfec552017-01-25 20:37:36 +000037public class BackupSettingsFragment extends DashboardFragment {
38 private static final String TAG = "BackupSettings";
39
40 @Override
41 public void onCreate(Bundle savedInstanceState) {
42 super.onCreate(savedInstanceState);
43 }
44
45 /**
46 * Get the tag string for logging.
47 */
48 @Override
49 protected String getLogTag() {
50 return TAG;
51 }
52
53 /**
54 * Get the res id for static preference xml for this fragment.
55 */
56 @Override
57 protected int getPreferenceScreenResId() {
58 return R.xml.backup_settings;
59 }
60
61 /**
Tony Mantler1d583e12017-06-13 13:09:25 -070062 * Get a list of {@link AbstractPreferenceController} for this fragment.
Anton Philippovadfec552017-01-25 20:37:36 +000063 */
64 @Override
Fan Zhangf7843ad2018-02-22 13:51:41 -080065 protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
Tony Mantler1d583e12017-06-13 13:09:25 -070066 final List<AbstractPreferenceController> controllers = new ArrayList<>();
Anton Philippovadfec552017-01-25 20:37:36 +000067 controllers.add(new BackupSettingsPreferenceController(context));
68 return controllers;
69 }
70
Chandan Nath0bfef632019-01-28 21:15:13 +000071 // The intention is to index {@link UserBackupSettingsActivity} instead of the fragments,
Anton Philippov9a5220e2017-03-01 21:08:56 +000072 // therefore leaving this index provider empty.
Raff Tsaiac3e0d02019-09-19 17:06:45 +080073 public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
Raff Tsai1f30b1c2019-09-12 10:56:13 +080074 new BaseSearchIndexProvider();
Anton Philippovadfec552017-01-25 20:37:36 +000075
76 @Override
77 public int getMetricsCategory() {
Fan Zhang31b21002019-01-16 13:49:47 -080078 return SettingsEnums.BACKUP_SETTINGS;
Anton Philippovadfec552017-01-25 20:37:36 +000079 }
80}