Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | |
| 17 | package com.android.settings.search; |
| 18 | |
Jason Monk | 91e2f89 | 2016-02-23 15:31:09 -0500 | [diff] [blame] | 19 | import android.provider.SearchIndexableResource; |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 20 | import android.support.annotation.DrawableRes; |
| 21 | import android.support.annotation.VisibleForTesting; |
| 22 | import android.support.annotation.XmlRes; |
Matthew Fritze | 473b6b4 | 2017-06-29 09:54:20 -0700 | [diff] [blame] | 23 | import android.text.TextUtils; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 24 | import com.android.settings.DateTimeSettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 25 | import com.android.settings.DeviceInfoSettings; |
| 26 | import com.android.settings.DisplaySettings; |
Doris Ling | 8161054 | 2017-02-15 17:49:18 -0800 | [diff] [blame] | 27 | import com.android.settings.EncryptionAndCredential; |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 28 | import com.android.settings.LegalSettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 29 | import com.android.settings.R; |
John Spurlock | 45fa140 | 2015-04-09 12:50:04 -0400 | [diff] [blame] | 30 | import com.android.settings.ScreenPinningSettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 31 | import com.android.settings.SecuritySettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 32 | import com.android.settings.accessibility.AccessibilitySettings; |
Phil Weaver | 296b726 | 2017-03-16 14:52:31 -0700 | [diff] [blame] | 33 | import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment; |
Casey Burkhardt | 9c7143c | 2017-03-22 18:19:19 -0700 | [diff] [blame] | 34 | import com.android.settings.accessibility.MagnificationPreferenceFragment; |
Fan Zhang | 6e88635 | 2016-12-05 14:42:49 -0800 | [diff] [blame] | 35 | import com.android.settings.accounts.UserAndAccountDashboardFragment; |
Fan Zhang | 6e88635 | 2016-12-05 14:42:49 -0800 | [diff] [blame] | 36 | import com.android.settings.applications.AppAndNotificationDashboardFragment; |
Fan Zhang | 2ea6700 | 2017-07-11 16:26:58 -0700 | [diff] [blame] | 37 | import com.android.settings.applications.DefaultAppSettings; |
Jason Monk | 91e2f89 | 2016-02-23 15:31:09 -0500 | [diff] [blame] | 38 | import com.android.settings.applications.SpecialAccessSettings; |
Fan Zhang | dfce62c | 2017-02-16 15:00:53 -0800 | [diff] [blame] | 39 | import com.android.settings.applications.assist.ManageAssist; |
Anton Philippov | 9a5220e | 2017-03-01 21:08:56 +0000 | [diff] [blame] | 40 | import com.android.settings.backup.BackupSettingsActivity; |
Anton Philippov | adfec55 | 2017-01-25 20:37:36 +0000 | [diff] [blame] | 41 | import com.android.settings.backup.BackupSettingsFragment; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 42 | import com.android.settings.bluetooth.BluetoothSettings; |
Fan Zhang | 762b496 | 2016-11-30 15:56:17 -0800 | [diff] [blame] | 43 | import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment; |
Rajeev Kumar | e19cd48 | 2017-07-14 19:40:56 -0700 | [diff] [blame] | 44 | import com.android.settings.datausage.DataPlanUsageSummary; |
Jason Monk | b37e288 | 2016-01-11 14:27:20 -0500 | [diff] [blame] | 45 | import com.android.settings.datausage.DataUsageMeteredSettings; |
| 46 | import com.android.settings.datausage.DataUsageSummary; |
Fan Zhang | 11d2d68 | 2017-03-17 16:19:26 -0700 | [diff] [blame] | 47 | import com.android.settings.development.DevelopmentSettings; |
Fan Zhang | 31a2853 | 2016-10-04 17:48:32 -0700 | [diff] [blame] | 48 | import com.android.settings.deviceinfo.StorageDashboardFragment; |
Jeff Sharkey | 42833b2 | 2015-04-11 21:27:33 -0700 | [diff] [blame] | 49 | import com.android.settings.deviceinfo.StorageSettings; |
Adrian Roos | e349ec3 | 2017-05-25 15:49:35 -0700 | [diff] [blame] | 50 | import com.android.settings.display.AmbientDisplaySettings; |
Alan Viverette | 01a04f1 | 2015-12-10 14:07:51 -0500 | [diff] [blame] | 51 | import com.android.settings.display.ScreenZoomSettings; |
Evan Laird | 227affa | 2017-03-22 11:36:18 -0400 | [diff] [blame] | 52 | import com.android.settings.dream.DreamSettings; |
Bartosz Fabianowski | 05061fc | 2016-11-14 12:04:49 +0100 | [diff] [blame] | 53 | import com.android.settings.enterprise.EnterprisePrivacySettings; |
John Spurlock | c7f8e8c | 2014-06-04 19:11:22 -0400 | [diff] [blame] | 54 | import com.android.settings.fuelgauge.BatterySaverSettings; |
jackqdyulei | a224b01 | 2017-01-27 16:11:13 -0800 | [diff] [blame] | 55 | import com.android.settings.fuelgauge.PowerUsageAdvanced; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 56 | import com.android.settings.fuelgauge.PowerUsageSummary; |
Philip Quinn | a9831d4 | 2017-02-13 20:07:09 -0800 | [diff] [blame] | 57 | import com.android.settings.gestures.AssistGestureSettings; |
Fan Zhang | ee52440 | 2016-12-05 12:58:03 -0800 | [diff] [blame] | 58 | import com.android.settings.gestures.DoubleTapPowerSettings; |
| 59 | import com.android.settings.gestures.DoubleTapScreenSettings; |
| 60 | import com.android.settings.gestures.DoubleTwistGestureSettings; |
Doris Ling | 204ca74 | 2017-07-18 15:43:26 -0700 | [diff] [blame^] | 61 | import com.android.settings.gestures.GestureSettings; |
Fan Zhang | ee52440 | 2016-12-05 12:58:03 -0800 | [diff] [blame] | 62 | import com.android.settings.gestures.PickupGestureSettings; |
| 63 | import com.android.settings.gestures.SwipeToNotificationSettings; |
Tadashi G. Takaoka | e776821 | 2017-01-10 15:47:19 +0900 | [diff] [blame] | 64 | import com.android.settings.inputmethod.AvailableVirtualKeyboardFragment; |
Tadashi G. Takaoka | 7bbc632 | 2017-01-10 15:02:22 +0900 | [diff] [blame] | 65 | import com.android.settings.inputmethod.PhysicalKeyboardFragment; |
Tadashi G. Takaoka | e776821 | 2017-01-10 15:47:19 +0900 | [diff] [blame] | 66 | import com.android.settings.inputmethod.VirtualKeyboardFragment; |
Doris Ling | 34cfd2e | 2017-02-03 16:16:42 -0800 | [diff] [blame] | 67 | import com.android.settings.language.LanguageAndInputSettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 68 | import com.android.settings.location.LocationSettings; |
Lifu Tang | ff6d489 | 2015-03-26 17:56:52 -0700 | [diff] [blame] | 69 | import com.android.settings.location.ScanningSettings; |
Fan Zhang | 6e88635 | 2016-12-05 14:42:49 -0800 | [diff] [blame] | 70 | import com.android.settings.network.NetworkDashboardFragment; |
Ruchi Kandoi | 4302dfa | 2017-01-03 14:02:23 -0800 | [diff] [blame] | 71 | import com.android.settings.nfc.PaymentSettings; |
Julia Reynolds | 38c16a9 | 2017-04-21 08:27:06 -0400 | [diff] [blame] | 72 | import com.android.settings.notification.ChannelImportanceSettings; |
Julia Reynolds | 8c0a423 | 2015-11-24 10:08:14 -0500 | [diff] [blame] | 73 | import com.android.settings.notification.ConfigureNotificationSettings; |
Julia Reynolds | 8c0a423 | 2015-11-24 10:08:14 -0500 | [diff] [blame] | 74 | import com.android.settings.notification.SoundSettings; |
John Spurlock | 48bbd5d | 2015-04-03 13:51:03 -0400 | [diff] [blame] | 75 | import com.android.settings.notification.ZenModePrioritySettings; |
John Spurlock | 4a35051 | 2014-04-08 14:08:21 -0400 | [diff] [blame] | 76 | import com.android.settings.notification.ZenModeSettings; |
Julia Reynolds | 5555d26 | 2015-11-09 10:52:17 -0500 | [diff] [blame] | 77 | import com.android.settings.notification.ZenModeVisualInterruptionSettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 78 | import com.android.settings.print.PrintSettingsFragment; |
Doris Ling | 9358299 | 2017-03-16 13:20:15 -0700 | [diff] [blame] | 79 | import com.android.settings.security.LockscreenDashboardFragment; |
PauloftheWest | 3815561 | 2014-06-30 10:02:36 -0700 | [diff] [blame] | 80 | import com.android.settings.sim.SimSettings; |
Fan Zhang | 2ea6700 | 2017-07-11 16:26:58 -0700 | [diff] [blame] | 81 | import com.android.settings.support.SupportDashboardActivity; |
Fan Zhang | 51059c5 | 2017-03-24 13:43:11 -0700 | [diff] [blame] | 82 | import com.android.settings.system.ResetDashboardFragment; |
Fan Zhang | c6540cf | 2016-10-03 17:11:11 -0700 | [diff] [blame] | 83 | import com.android.settings.system.SystemDashboardFragment; |
Niels Egberts | e5017dc | 2016-12-12 13:29:41 +0000 | [diff] [blame] | 84 | import com.android.settings.tts.TtsEnginePreferenceFragment; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 85 | import com.android.settings.users.UserSettings; |
Fan Zhang | 2907f86 | 2017-03-17 15:05:14 -0700 | [diff] [blame] | 86 | import com.android.settings.wallpaper.WallpaperTypeSettings; |
Amin Shaikh | 3aa547b | 2017-01-06 18:31:41 -0800 | [diff] [blame] | 87 | import com.android.settings.wifi.ConfigureWifiSettings; |
PauloftheWest | 7837b99 | 2014-06-24 07:42:27 -0700 | [diff] [blame] | 88 | import com.android.settings.wifi.SavedAccessPointsWifiSettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 89 | import com.android.settings.wifi.WifiSettings; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 90 | import java.util.Collection; |
| 91 | import java.util.HashMap; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 92 | |
| 93 | public final class SearchIndexableResources { |
| 94 | |
Matthew Fritze | 473b6b4 | 2017-06-29 09:54:20 -0700 | [diff] [blame] | 95 | /** |
| 96 | * Identifies subsettings which have an {@link SearchIndexableResource#intentAction} but |
| 97 | * whose intents should still be treated as subsettings inside of Settings. |
| 98 | */ |
| 99 | public static final String SUBSETTING_TARGET_PACKAGE = "subsetting_target_package"; |
| 100 | |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 101 | @XmlRes |
| 102 | public static final int NO_DATA_RES_ID = 0; |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 103 | |
Fan Zhang | 2ea6700 | 2017-07-11 16:26:58 -0700 | [diff] [blame] | 104 | @VisibleForTesting |
Matthew Fritze | 2108f91 | 2017-01-24 10:45:11 -0800 | [diff] [blame] | 105 | static final HashMap<String, SearchIndexableResource> sResMap = new HashMap<>(); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 106 | |
| 107 | @VisibleForTesting |
| 108 | static void addIndex(Class<?> indexClass, @XmlRes int xmlResId, |
| 109 | @DrawableRes int iconResId) { |
Matthew Fritze | 473b6b4 | 2017-06-29 09:54:20 -0700 | [diff] [blame] | 110 | addIndex(indexClass, xmlResId, iconResId, null /* targetAction */); |
| 111 | } |
| 112 | |
| 113 | @VisibleForTesting |
| 114 | static void addIndex(Class<?> indexClass, @XmlRes int xmlResId, |
| 115 | @DrawableRes int iconResId, String targetAction) { |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 116 | String className = indexClass.getName(); |
Matthew Fritze | 473b6b4 | 2017-06-29 09:54:20 -0700 | [diff] [blame] | 117 | SearchIndexableResource resource = |
| 118 | new SearchIndexableResource(0, xmlResId, className, iconResId); |
| 119 | |
| 120 | if (!TextUtils.isEmpty(targetAction)) { |
| 121 | resource.intentAction = targetAction; |
| 122 | resource.intentTargetPackage = SUBSETTING_TARGET_PACKAGE; |
| 123 | } |
| 124 | |
| 125 | sResMap.put(className, resource); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 126 | } |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 127 | |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 128 | static { |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 129 | addIndex(WifiSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_wireless); |
Fan Zhang | 6e88635 | 2016-12-05 14:42:49 -0800 | [diff] [blame] | 130 | addIndex(NetworkDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_wireless); |
Amin Shaikh | 3aa547b | 2017-01-06 18:31:41 -0800 | [diff] [blame] | 131 | addIndex(ConfigureWifiSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_wireless); |
| 132 | addIndex(SavedAccessPointsWifiSettings.class, NO_DATA_RES_ID, |
| 133 | R.drawable.ic_settings_wireless); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 134 | addIndex(BluetoothSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_bluetooth); |
| 135 | addIndex(SimSettings.class, NO_DATA_RES_ID, R.drawable.ic_sim_sd); |
Rajeev Kumar | e19cd48 | 2017-07-14 19:40:56 -0700 | [diff] [blame] | 136 | addIndex(DataPlanUsageSummary.class, NO_DATA_RES_ID, R.drawable.ic_settings_data_usage); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 137 | addIndex(DataUsageSummary.class, NO_DATA_RES_ID, R.drawable.ic_settings_data_usage); |
| 138 | addIndex(DataUsageMeteredSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_data_usage); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 139 | addIndex(ScreenZoomSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_display); |
Matthew Fritze | 473b6b4 | 2017-06-29 09:54:20 -0700 | [diff] [blame] | 140 | addIndex(DisplaySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_display, |
| 141 | "android.settings.DISPLAY_SETTINGS"); |
Adrian Roos | e349ec3 | 2017-05-25 15:49:35 -0700 | [diff] [blame] | 142 | addIndex(AmbientDisplaySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_display); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 143 | addIndex(WallpaperTypeSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_display); |
| 144 | addIndex(ConfigureNotificationSettings.class, |
Fan Zhang | 762b496 | 2016-11-30 15:56:17 -0800 | [diff] [blame] | 145 | R.xml.configure_notification_settings, R.drawable.ic_settings_notifications); |
Fan Zhang | 6e88635 | 2016-12-05 14:42:49 -0800 | [diff] [blame] | 146 | addIndex(AppAndNotificationDashboardFragment.class, NO_DATA_RES_ID, |
| 147 | R.drawable.ic_settings_applications); |
Matthew Fritze | 473b6b4 | 2017-06-29 09:54:20 -0700 | [diff] [blame] | 148 | addIndex(SoundSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_sound, |
| 149 | "android.settings.SOUND_SETTINGS"); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 150 | addIndex(ZenModeSettings.class, |
Fan Zhang | 762b496 | 2016-11-30 15:56:17 -0800 | [diff] [blame] | 151 | R.xml.zen_mode_settings, R.drawable.ic_settings_notifications); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 152 | addIndex(ZenModePrioritySettings.class, |
Fan Zhang | 762b496 | 2016-11-30 15:56:17 -0800 | [diff] [blame] | 153 | R.xml.zen_mode_priority_settings, R.drawable.ic_settings_notifications); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 154 | addIndex(StorageSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_storage); |
| 155 | addIndex(PowerUsageSummary.class, |
Fan Zhang | 762b496 | 2016-11-30 15:56:17 -0800 | [diff] [blame] | 156 | R.xml.power_usage_summary, R.drawable.ic_settings_battery); |
jackqdyulei | a224b01 | 2017-01-27 16:11:13 -0800 | [diff] [blame] | 157 | addIndex(PowerUsageAdvanced.class, NO_DATA_RES_ID, R.drawable.ic_settings_battery); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 158 | addIndex(BatterySaverSettings.class, |
Fan Zhang | 762b496 | 2016-11-30 15:56:17 -0800 | [diff] [blame] | 159 | R.xml.battery_saver_settings, R.drawable.ic_settings_battery); |
Fan Zhang | 2ea6700 | 2017-07-11 16:26:58 -0700 | [diff] [blame] | 160 | addIndex(DefaultAppSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_applications); |
Fan Zhang | dfce62c | 2017-02-16 15:00:53 -0800 | [diff] [blame] | 161 | addIndex(ManageAssist.class, NO_DATA_RES_ID, R.drawable.ic_settings_applications); |
Fan Zhang | 9834bd8 | 2017-05-15 11:28:25 -0700 | [diff] [blame] | 162 | addIndex(SpecialAccessSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_applications); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 163 | addIndex(UserSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_multiuser); |
Philip Quinn | a9831d4 | 2017-02-13 20:07:09 -0800 | [diff] [blame] | 164 | addIndex(AssistGestureSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures); |
Fan Zhang | ee52440 | 2016-12-05 12:58:03 -0800 | [diff] [blame] | 165 | addIndex(PickupGestureSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures); |
| 166 | addIndex(DoubleTapScreenSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures); |
| 167 | addIndex(DoubleTapPowerSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures); |
| 168 | addIndex(DoubleTwistGestureSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures); |
| 169 | addIndex(SwipeToNotificationSettings.class, NO_DATA_RES_ID, |
| 170 | R.drawable.ic_settings_gestures); |
Doris Ling | 204ca74 | 2017-07-18 15:43:26 -0700 | [diff] [blame^] | 171 | addIndex(GestureSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures); |
Doris Ling | 34cfd2e | 2017-02-03 16:16:42 -0800 | [diff] [blame] | 172 | addIndex(LanguageAndInputSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_language); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 173 | addIndex(LocationSettings.class, R.xml.location_settings, R.drawable.ic_settings_location); |
| 174 | addIndex(ScanningSettings.class, R.xml.location_scanning, R.drawable.ic_settings_location); |
| 175 | addIndex(SecuritySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_security); |
Doris Ling | 8161054 | 2017-02-15 17:49:18 -0800 | [diff] [blame] | 176 | addIndex(EncryptionAndCredential.class, R.xml.encryption_and_credential, |
| 177 | R.drawable.ic_settings_security); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 178 | addIndex(ScreenPinningSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_security); |
Fan Zhang | 6e88635 | 2016-12-05 14:42:49 -0800 | [diff] [blame] | 179 | addIndex(UserAndAccountDashboardFragment.class, NO_DATA_RES_ID, |
| 180 | R.drawable.ic_settings_accounts); |
Tadashi G. Takaoka | e776821 | 2017-01-10 15:47:19 +0900 | [diff] [blame] | 181 | addIndex(VirtualKeyboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_language); |
| 182 | addIndex(AvailableVirtualKeyboardFragment.class, |
| 183 | NO_DATA_RES_ID, R.drawable.ic_settings_language); |
Tadashi G. Takaoka | 7bbc632 | 2017-01-10 15:02:22 +0900 | [diff] [blame] | 184 | addIndex(PhysicalKeyboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_language); |
Anton Philippov | 9a5220e | 2017-03-01 21:08:56 +0000 | [diff] [blame] | 185 | addIndex(BackupSettingsActivity.class, NO_DATA_RES_ID, R.drawable.ic_settings_backup); |
Anton Philippov | adfec55 | 2017-01-25 20:37:36 +0000 | [diff] [blame] | 186 | addIndex(BackupSettingsFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_backup); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 187 | addIndex(DateTimeSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_date_time); |
| 188 | addIndex(AccessibilitySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_accessibility); |
| 189 | addIndex(PrintSettingsFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_print); |
| 190 | addIndex(DevelopmentSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_development); |
| 191 | addIndex(DeviceInfoSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_about); |
| 192 | addIndex(LegalSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_about); |
| 193 | addIndex(ZenModeVisualInterruptionSettings.class, |
Fan Zhang | 762b496 | 2016-11-30 15:56:17 -0800 | [diff] [blame] | 194 | R.xml.zen_mode_visual_interruptions_settings, |
| 195 | R.drawable.ic_settings_notifications); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 196 | addIndex(SystemDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_about); |
Fan Zhang | 51059c5 | 2017-03-24 13:43:11 -0700 | [diff] [blame] | 197 | addIndex(ResetDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_restore); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 198 | addIndex(StorageDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_storage); |
Fan Zhang | 11d2d68 | 2017-03-17 16:19:26 -0700 | [diff] [blame] | 199 | addIndex(ConnectedDeviceDashboardFragment.class, NO_DATA_RES_ID, |
| 200 | R.drawable.ic_devices_other); |
Tadashi G. Takaoka | b51f6bf | 2016-11-22 23:53:36 +0900 | [diff] [blame] | 201 | addIndex(EnterprisePrivacySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_about); |
Ruchi Kandoi | 4302dfa | 2017-01-03 14:02:23 -0800 | [diff] [blame] | 202 | addIndex(PaymentSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_nfc_payment); |
Niels Egberts | e5017dc | 2016-12-12 13:29:41 +0000 | [diff] [blame] | 203 | addIndex( |
| 204 | TtsEnginePreferenceFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_language); |
Doris Ling | 9358299 | 2017-03-16 13:20:15 -0700 | [diff] [blame] | 205 | addIndex(LockscreenDashboardFragment.class, R.xml.security_lockscreen_settings, |
Fan Zhang | 2ea6700 | 2017-07-11 16:26:58 -0700 | [diff] [blame] | 206 | R.drawable.ic_settings_security); |
Casey Burkhardt | 9c7143c | 2017-03-22 18:19:19 -0700 | [diff] [blame] | 207 | addIndex(MagnificationPreferenceFragment.class, NO_DATA_RES_ID, |
| 208 | R.drawable.ic_settings_accessibility); |
Phil Weaver | 296b726 | 2017-03-16 14:52:31 -0700 | [diff] [blame] | 209 | addIndex(AccessibilityShortcutPreferenceFragment.class, NO_DATA_RES_ID, |
| 210 | R.drawable.ic_settings_accessibility); |
Julia Reynolds | 38c16a9 | 2017-04-21 08:27:06 -0400 | [diff] [blame] | 211 | addIndex(ChannelImportanceSettings.class, NO_DATA_RES_ID, |
| 212 | R.drawable.ic_settings_notifications); |
Evan Laird | 227affa | 2017-03-22 11:36:18 -0400 | [diff] [blame] | 213 | addIndex(DreamSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_display); |
Fan Zhang | b473730 | 2017-05-31 12:43:48 -0700 | [diff] [blame] | 214 | addIndex(SupportDashboardActivity.class, NO_DATA_RES_ID, R.drawable.ic_help); |
Fabrice Di Meglio | 51bfee5 | 2014-03-20 19:52:29 -0700 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | private SearchIndexableResources() { |
| 218 | } |
| 219 | |
| 220 | public static int size() { |
| 221 | return sResMap.size(); |
| 222 | } |
| 223 | |
| 224 | public static SearchIndexableResource getResourceByName(String className) { |
| 225 | return sResMap.get(className); |
| 226 | } |
| 227 | |
| 228 | public static Collection<SearchIndexableResource> values() { |
| 229 | return sResMap.values(); |
| 230 | } |
| 231 | } |