2 * Copyright (C) 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.settings.core.gateway;
19 import com.android.settings.ApnEditor;
20 import com.android.settings.ApnSettings;
21 import com.android.settings.ChooseLockPassword;
22 import com.android.settings.ChooseLockPattern;
23 import com.android.settings.CryptKeeperSettings;
24 import com.android.settings.DateTimeSettings;
25 import com.android.settings.DevelopmentSettings;
26 import com.android.settings.DeviceAdminSettings;
27 import com.android.settings.DeviceInfoSettings;
28 import com.android.settings.DisplaySettings;
29 import com.android.settings.DreamSettings;
30 import com.android.settings.HomeSettings;
31 import com.android.settings.IccLockSettings;
32 import com.android.settings.MasterClear;
33 import com.android.settings.PrivacySettings;
34 import com.android.settings.SecuritySettings;
35 import com.android.settings.Settings;
36 import com.android.settings.TestingSettings;
37 import com.android.settings.TetherSettings;
38 import com.android.settings.TrustedCredentialsSettings;
39 import com.android.settings.UserDictionarySettings;
40 import com.android.settings.WallpaperTypeSettings;
41 import com.android.settings.WifiCallingSettings;
42 import com.android.settings.WirelessSettings;
43 import com.android.settings.accessibility.AccessibilitySettings;
44 import com.android.settings.accessibility.AccessibilitySettingsForSetupWizard;
45 import com.android.settings.accessibility.CaptionPropertiesFragment;
46 import com.android.settings.accessibility.ToggleDaltonizerPreferenceFragment;
47 import com.android.settings.accounts.AccountSettings;
48 import com.android.settings.accounts.AccountSyncSettings;
49 import com.android.settings.accounts.ChooseAccountActivity;
50 import com.android.settings.accounts.ManagedProfileSettings;
51 import com.android.settings.accounts.UserAndAccountDashboardFragment;
52 import com.android.settings.applications.AdvancedAppSettings;
53 import com.android.settings.applications.AppAndNotificationDashboardFragment;
54 import com.android.settings.applications.DrawOverlayDetails;
55 import com.android.settings.applications.InstalledAppDetails;
56 import com.android.settings.applications.ManageApplications;
57 import com.android.settings.applications.assist.ManageAssist;
58 import com.android.settings.applications.ManageDomainUrls;
59 import com.android.settings.applications.NotificationApps;
60 import com.android.settings.applications.PictureInPictureSettings;
61 import com.android.settings.applications.ProcessStatsSummary;
62 import com.android.settings.applications.ProcessStatsUi;
63 import com.android.settings.applications.UsageAccessDetails;
64 import com.android.settings.applications.VrListenerSettings;
65 import com.android.settings.applications.WriteSettingsDetails;
66 import com.android.settings.bluetooth.BluetoothSettings;
67 import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
68 import com.android.settings.dashboard.SupportFragment;
69 import com.android.settings.datausage.DataUsageSummary;
70 import com.android.settings.deletionhelper.AutomaticStorageManagerSettings;
71 import com.android.settings.deviceinfo.ImeiInformation;
72 import com.android.settings.deviceinfo.PrivateVolumeForget;
73 import com.android.settings.deviceinfo.PrivateVolumeSettings;
74 import com.android.settings.deviceinfo.PublicVolumeSettings;
75 import com.android.settings.deviceinfo.SimStatus;
76 import com.android.settings.deviceinfo.Status;
77 import com.android.settings.deviceinfo.StorageDashboardFragment;
78 import com.android.settings.deviceinfo.StorageSettings;
79 import com.android.settings.display.NightDisplaySettings;
80 import com.android.settings.enterprise.EnterprisePrivacySettings;
81 import com.android.settings.fuelgauge.BatterySaverSettings;
82 import com.android.settings.fuelgauge.PowerUsageDetail;
83 import com.android.settings.fuelgauge.PowerUsageSummary;
84 import com.android.settings.gestures.AssistGestureSettings;
85 import com.android.settings.gestures.DoubleTapPowerSettings;
86 import com.android.settings.gestures.DoubleTapScreenSettings;
87 import com.android.settings.gestures.DoubleTwistGestureSettings;
88 import com.android.settings.gestures.GestureSettings;
89 import com.android.settings.gestures.PickupGestureSettings;
90 import com.android.settings.gestures.SwipeToNotificationSettings;
91 import com.android.settings.inputmethod.AvailableVirtualKeyboardFragment;
92 import com.android.settings.inputmethod.InputMethodAndLanguageSettings;
93 import com.android.settings.inputmethod.KeyboardLayoutPickerFragment;
94 import com.android.settings.inputmethod.PhysicalKeyboardFragment;
95 import com.android.settings.inputmethod.SpellCheckersSettings;
96 import com.android.settings.inputmethod.UserDictionaryList;
97 import com.android.settings.language.LanguageAndInputSettings;
98 import com.android.settings.localepicker.LocaleListEditor;
99 import com.android.settings.location.LocationSettings;
100 import com.android.settings.network.NetworkDashboardFragment;
101 import com.android.settings.nfc.AndroidBeam;
102 import com.android.settings.nfc.PaymentSettings;
103 import com.android.settings.notification.AppNotificationSettings;
104 import com.android.settings.notification.ChannelNotificationSettings;
105 import com.android.settings.notification.ConfigureNotificationSettings;
106 import com.android.settings.notification.NotificationAccessSettings;
107 import com.android.settings.notification.NotificationStation;
108 import com.android.settings.notification.OtherSoundSettings;
109 import com.android.settings.notification.SoundSettings;
110 import com.android.settings.notification.ZenAccessSettings;
111 import com.android.settings.notification.ZenModeAutomationSettings;
112 import com.android.settings.notification.ZenModeEventRuleSettings;
113 import com.android.settings.notification.ZenModePrioritySettings;
114 import com.android.settings.notification.ZenModeScheduleRuleSettings;
115 import com.android.settings.notification.ZenModeSettings;
116 import com.android.settings.notification.ZenModeVisualInterruptionSettings;
117 import com.android.settings.print.PrintJobSettingsFragment;
118 import com.android.settings.print.PrintSettingsFragment;
119 import com.android.settings.sim.SimSettings;
120 import com.android.settings.system.SystemDashboardFragment;
121 import com.android.settings.tts.TextToSpeechSettings;
122 import com.android.settings.users.UserSettings;
123 import com.android.settings.vpn2.VpnSettings;
124 import com.android.settings.webview.WebViewAppPicker;
125 import com.android.settings.wfd.WifiDisplaySettings;
126 import com.android.settings.wifi.ConfigureWifiSettings;
127 import com.android.settings.wifi.SavedAccessPointsWifiSettings;
128 import com.android.settings.wifi.WifiAPITest;
129 import com.android.settings.wifi.WifiInfo;
130 import com.android.settings.wifi.WifiSettings;
131 import com.android.settings.wifi.p2p.WifiP2pSettings;
133 public class SettingsGateway {
136 * A list of fragment that can be hosted by SettingsActivity. SettingsActivity will throw a
137 * security exception if the fragment it needs to display is not in this list.
139 public static final String[] ENTRY_FRAGMENTS = {
140 WirelessSettings.class.getName(),
141 WifiSettings.class.getName(),
142 ConfigureWifiSettings.class.getName(),
143 SavedAccessPointsWifiSettings.class.getName(),
144 BluetoothSettings.class.getName(),
145 SimSettings.class.getName(),
146 TetherSettings.class.getName(),
147 WifiP2pSettings.class.getName(),
148 VpnSettings.class.getName(),
149 DateTimeSettings.class.getName(),
150 LocaleListEditor.class.getName(),
151 InputMethodAndLanguageSettings.class.getName(),
152 AvailableVirtualKeyboardFragment.class.getName(),
153 LanguageAndInputSettings.class.getName(),
154 SpellCheckersSettings.class.getName(),
155 UserDictionaryList.class.getName(),
156 UserDictionarySettings.class.getName(),
157 HomeSettings.class.getName(),
158 DisplaySettings.class.getName(),
159 DeviceInfoSettings.class.getName(),
160 ManageApplications.class.getName(),
161 NotificationApps.class.getName(),
162 ManageAssist.class.getName(),
163 ProcessStatsUi.class.getName(),
164 NotificationStation.class.getName(),
165 LocationSettings.class.getName(),
166 SecuritySettings.class.getName(),
167 UsageAccessDetails.class.getName(),
168 PrivacySettings.class.getName(),
169 DeviceAdminSettings.class.getName(),
170 AccessibilitySettings.class.getName(),
171 AccessibilitySettingsForSetupWizard.class.getName(),
172 CaptionPropertiesFragment.class.getName(),
173 ToggleDaltonizerPreferenceFragment.class.getName(),
174 TextToSpeechSettings.class.getName(),
175 StorageSettings.class.getName(),
176 PrivateVolumeForget.class.getName(),
177 PrivateVolumeSettings.class.getName(),
178 PublicVolumeSettings.class.getName(),
179 DevelopmentSettings.class.getName(),
180 AndroidBeam.class.getName(),
181 WifiDisplaySettings.class.getName(),
182 PowerUsageSummary.class.getName(),
183 AccountSyncSettings.class.getName(),
184 AccountSettings.class.getName(),
185 GestureSettings.class.getName(),
186 AssistGestureSettings.class.getName(),
187 SwipeToNotificationSettings.class.getName(),
188 DoubleTapPowerSettings.class.getName(),
189 DoubleTapScreenSettings.class.getName(),
190 PickupGestureSettings.class.getName(),
191 DoubleTwistGestureSettings.class.getName(),
192 CryptKeeperSettings.class.getName(),
193 DataUsageSummary.class.getName(),
194 DreamSettings.class.getName(),
195 UserSettings.class.getName(),
196 NotificationAccessSettings.class.getName(),
197 ZenAccessSettings.class.getName(),
198 PrintSettingsFragment.class.getName(),
199 PrintJobSettingsFragment.class.getName(),
200 TrustedCredentialsSettings.class.getName(),
201 PaymentSettings.class.getName(),
202 KeyboardLayoutPickerFragment.class.getName(),
203 PhysicalKeyboardFragment.class.getName(),
204 ZenModeSettings.class.getName(),
205 SoundSettings.class.getName(),
206 ConfigureNotificationSettings.class.getName(),
207 ChooseLockPassword.ChooseLockPasswordFragment.class.getName(),
208 ChooseLockPattern.ChooseLockPatternFragment.class.getName(),
209 InstalledAppDetails.class.getName(),
210 BatterySaverSettings.class.getName(),
211 AppNotificationSettings.class.getName(),
212 ChannelNotificationSettings.class.getName(),
213 OtherSoundSettings.class.getName(),
214 ApnSettings.class.getName(),
215 ApnEditor.class.getName(),
216 WifiCallingSettings.class.getName(),
217 ZenModePrioritySettings.class.getName(),
218 ZenModeAutomationSettings.class.getName(),
219 ZenModeScheduleRuleSettings.class.getName(),
220 ZenModeEventRuleSettings.class.getName(),
221 ZenModeVisualInterruptionSettings.class.getName(),
222 ProcessStatsUi.class.getName(),
223 PowerUsageDetail.class.getName(),
224 ProcessStatsSummary.class.getName(),
225 DrawOverlayDetails.class.getName(),
226 WriteSettingsDetails.class.getName(),
227 AdvancedAppSettings.class.getName(),
228 WallpaperTypeSettings.class.getName(),
229 VrListenerSettings.class.getName(),
230 PictureInPictureSettings.class.getName(),
231 ManagedProfileSettings.class.getName(),
232 ChooseAccountActivity.class.getName(),
233 IccLockSettings.class.getName(),
234 ImeiInformation.class.getName(),
235 SimStatus.class.getName(),
236 Status.class.getName(),
237 TestingSettings.class.getName(),
238 WifiAPITest.class.getName(),
239 WifiInfo.class.getName(),
240 MasterClear.class.getName(),
241 NightDisplaySettings.class.getName(),
242 ManageDomainUrls.class.getName(),
243 AutomaticStorageManagerSettings.class.getName(),
244 SupportFragment.class.getName(),
245 StorageDashboardFragment.class.getName(),
246 SystemDashboardFragment.class.getName(),
247 NetworkDashboardFragment.class.getName(),
248 ConnectedDeviceDashboardFragment.class.getName(),
249 AppAndNotificationDashboardFragment.class.getName(),
250 UserAndAccountDashboardFragment.class.getName(),
251 EnterprisePrivacySettings.class.getName(),
252 WebViewAppPicker.class.getName(),
255 public static final String[] SETTINGS_FOR_RESTRICTED = {
257 Settings.WifiSettingsActivity.class.getName(),
258 Settings.BluetoothSettingsActivity.class.getName(),
259 Settings.DataUsageSummaryActivity.class.getName(),
260 Settings.SimSettingsActivity.class.getName(),
261 Settings.WirelessSettingsActivity.class.getName(),
263 Settings.SoundSettingsActivity.class.getName(),
264 Settings.DisplaySettingsActivity.class.getName(),
265 Settings.StorageSettingsActivity.class.getName(),
266 Settings.ManageApplicationsActivity.class.getName(),
267 Settings.PowerUsageSummaryActivity.class.getName(),
268 Settings.GestureSettingsActivity.class.getName(),
270 Settings.LocationSettingsActivity.class.getName(),
271 Settings.SecuritySettingsActivity.class.getName(),
272 Settings.InputMethodAndLanguageSettingsActivity.class.getName(),
273 Settings.UserSettingsActivity.class.getName(),
274 Settings.AccountSettingsActivity.class.getName(),
276 Settings.DateTimeSettingsActivity.class.getName(),
277 Settings.DeviceInfoSettingsActivity.class.getName(),
278 Settings.AccessibilitySettingsActivity.class.getName(),
279 Settings.PrintSettingsActivity.class.getName(),
280 Settings.PaymentSettingsActivity.class.getName(),
281 Settings.EnterprisePrivacySettingsActivity.class.getName(),
285 Settings.NetworkDashboardActivity.class.getName(),
286 Settings.ConnectedDeviceDashboardActivity.class.getName(),
287 Settings.AppAndNotificationDashboardActivity.class.getName(),
288 "com.android.settings.BatteryDashboardAlias",
289 "com.android.settings.DisplayDashboardAlias",
290 "com.android.settings.SoundDashboardAlias",
291 "com.android.settings.SecurityDashboardAlias",
292 "com.android.settings.UsersDashboardAlias",
293 Settings.UserAndAccountDashboardActivity.class.getName(),
294 Settings.SystemDashboardActivity.class.getName(),
295 Settings.SupportDashboardActivity.class.getName(),
296 // Home page > Apps & Notifications
297 "com.android.settings.ManageApplicationsDashboardAlias",
298 "com.android.settings.PaymentSettingsDashboardAlias",
299 // Home page > Network & Internet
300 "com.android.settings.DataUsageDashboardAlias",
301 // Home page > System
302 Settings.LanguageAndInputSettingsActivity.class.getName(),
303 "com.android.settings.DateTimeDashboardAlias",
304 "com.android.settings.AccessibilityDashboardAlias",
305 "com.android.settings.AboutDeviceDashboardAlias",
306 "com.android.settings.EnterprisePrivacyDashboardAlias",