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