• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 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;
18 
19 import android.content.Context;
20 import android.content.Intent;
21 import android.os.Bundle;
22 import android.text.TextUtils;
23 import android.util.FeatureFlagUtils;
24 
25 import com.android.internal.annotations.VisibleForTesting;
26 import com.android.settings.core.FeatureFlags;
27 import com.android.settings.enterprise.EnterprisePrivacySettings;
28 import com.android.settings.overlay.FeatureFactory;
29 import com.android.settings.security.SecuritySettingsFeatureProvider;
30 
31 import com.google.android.setupdesign.util.ThemeHelper;
32 
33 /**
34  * Top-level Settings activity
35  */
36 public class Settings extends SettingsActivity {
37 
38     /*
39     * Settings subclasses for launching independently.
40     */
41     public static class AssistGestureSettingsActivity extends SettingsActivity { /* empty */}
42     public static class BluetoothSettingsActivity extends SettingsActivity { /* empty */ }
43     public static class CreateShortcutActivity extends SettingsActivity { /* empty */ }
44     public static class FaceSettingsActivity extends SettingsActivity { /* empty */ }
45     public static class FingerprintSettingsActivity extends SettingsActivity { /* empty */ }
46     public static class CombinedBiometricSettingsActivity extends SettingsActivity { /* empty */ }
47     public static class CombinedBiometricProfileSettingsActivity extends SettingsActivity { /* empty */ }
48     public static class TetherSettingsActivity extends SettingsActivity {
49         // TODO(b/147675042): Clean the override up when we enable the new Fragment persistently.
50         @Override
getIntent()51         public Intent getIntent() {
52             return wrapIntentWithAllInOneTetherSettingsIfNeeded(
53                     getApplicationContext(), super.getIntent());
54         }
55     }
56     public static class WifiTetherSettingsActivity extends SettingsActivity {
57         // TODO(b/147675042): Clean the override up when we enable the new Fragment persistently.
58         @Override
getIntent()59         public Intent getIntent() {
60             return wrapIntentWithAllInOneTetherSettingsIfNeeded(
61                     getApplicationContext(), super.getIntent());
62         }
63     }
64 
wrapIntentWithAllInOneTetherSettingsIfNeeded( Context context, Intent superIntent)65     private static Intent wrapIntentWithAllInOneTetherSettingsIfNeeded(
66             Context context, Intent superIntent) {
67         if (!FeatureFlagUtils.isEnabled(context, FeatureFlags.TETHER_ALL_IN_ONE)) {
68             return superIntent;
69         }
70 
71         final Intent modIntent = new Intent(superIntent);
72         modIntent.putExtra(EXTRA_SHOW_FRAGMENT,
73                 AllInOneTetherSettings.class.getCanonicalName());
74         Bundle args = superIntent.getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS);
75         if (args != null) {
76             args = new Bundle(args);
77         } else {
78             args = new Bundle();
79         }
80         args.putParcelable("intent", superIntent);
81         modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, args);
82         return modIntent;
83     }
84 
85     public static class VpnSettingsActivity extends SettingsActivity { /* empty */ }
86     public static class DataSaverSummaryActivity extends SettingsActivity{ /* empty */ }
87     public static class DateTimeSettingsActivity extends SettingsActivity { /* empty */ }
88     public static class PrivateVolumeForgetActivity extends SettingsActivity { /* empty */ }
89     public static class PublicVolumeSettingsActivity extends SettingsActivity { /* empty */ }
90     public static class WifiSettingsActivity extends SettingsActivity { /* empty */ }
91     public static class WifiSettings2Activity extends SettingsActivity { /* empty */ }
92     public static class NetworkProviderSettingsActivity extends SettingsActivity { /* empty */ }
93     public static class WifiP2pSettingsActivity extends SettingsActivity { /* empty */ }
94     public static class AvailableVirtualKeyboardActivity extends SettingsActivity { /* empty */ }
95     public static class KeyboardLayoutPickerActivity extends SettingsActivity { /* empty */ }
96     public static class PhysicalKeyboardActivity extends SettingsActivity { /* empty */ }
97     public static class InputMethodAndSubtypeEnablerActivity extends SettingsActivity { /* empty */ }
98     public static class SpellCheckersSettingsActivity extends SettingsActivity { /* empty */ }
99     public static class LocalePickerActivity extends SettingsActivity { /* empty */ }
100     public static class LanguageAndInputSettingsActivity extends SettingsActivity { /* empty */ }
101     public static class UserDictionarySettingsActivity extends SettingsActivity { /* empty */ }
102     public static class DarkThemeSettingsActivity extends SettingsActivity { /* empty */ }
103     public static class DisplaySettingsActivity extends SettingsActivity { /* empty */ }
104     public static class NightDisplaySettingsActivity extends SettingsActivity { /* empty */ }
105     public static class NightDisplaySuggestionActivity extends NightDisplaySettingsActivity { /* empty */ }
106     public static class SmartAutoRotateSettingsActivity extends SettingsActivity { /* empty */ }
107     public static class MyDeviceInfoActivity extends SettingsActivity { /* empty */ }
108     public static class ModuleLicensesActivity extends SettingsActivity { /* empty */ }
109     public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
110     public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ }
111     public static class ManageAssistActivity extends SettingsActivity { /* empty */ }
112     public static class HighPowerApplicationsActivity extends SettingsActivity { /* empty */ }
113     public static class BackgroundCheckSummaryActivity extends SettingsActivity { /* empty */ }
114     public static class StorageUseActivity extends SettingsActivity { /* empty */ }
115     public static class DevelopmentSettingsDashboardActivity extends SettingsActivity { /* empty */ }
116     public static class AccessibilitySettingsActivity extends SettingsActivity { /* empty */ }
117     public static class AccessibilityDetailsSettingsActivity extends SettingsActivity { /* empty */ }
118     public static class CaptioningSettingsActivity extends SettingsActivity { /* empty */ }
119     public static class AccessibilityInversionSettingsActivity extends SettingsActivity { /* empty */ }
120     public static class AccessibilityContrastSettingsActivity extends SettingsActivity { /* empty */ }
121     public static class AccessibilityDaltonizerSettingsActivity extends SettingsActivity { /* empty */ }
122     /**
123      * Activity for lockscreen settings.
124      */
125     public static class LockScreenSettingsActivity extends SettingsActivity { /* empty */ }
126     /**
127      * Activity for Reduce Bright Colors.
128      */
129     public static class ReduceBrightColorsSettingsActivity extends SettingsActivity { /* empty */ }
130     /** Activity for the security dashboard. */
131     public static class SecurityDashboardActivity extends SettingsActivity {
132 
133         /** Whether the given fragment is allowed. */
134         @VisibleForTesting
135         @Override
isValidFragment(String fragmentName)136         public boolean isValidFragment(String fragmentName) {
137             return super.isValidFragment(fragmentName)
138                     || (fragmentName != null
139                             && TextUtils.equals(fragmentName, getAlternativeFragmentName()));
140         }
141 
142         @Override
getInitialFragmentName(Intent intent)143         public String getInitialFragmentName(Intent intent) {
144             final String alternativeFragmentName = getAlternativeFragmentName();
145             if (alternativeFragmentName != null) {
146                 return alternativeFragmentName;
147             }
148 
149             return super.getInitialFragmentName(intent);
150         }
151 
getAlternativeFragmentName()152         private String getAlternativeFragmentName() {
153             String alternativeFragmentClassname = null;
154             final SecuritySettingsFeatureProvider securitySettingsFeatureProvider =
155                     FeatureFactory.getFactory(this).getSecuritySettingsFeatureProvider();
156             if (securitySettingsFeatureProvider.hasAlternativeSecuritySettingsFragment()) {
157                 alternativeFragmentClassname = securitySettingsFeatureProvider
158                         .getAlternativeSecuritySettingsFragmentClassname();
159             }
160             return alternativeFragmentClassname;
161         }
162     }
163     public static class UsageAccessSettingsActivity extends SettingsActivity { /* empty */ }
164     public static class AppUsageAccessSettingsActivity extends SettingsActivity { /* empty */ }
165     public static class LocationSettingsActivity extends SettingsActivity { /* empty */ }
166     public static class ScanningSettingsActivity extends SettingsActivity { /* empty */ }
167     public static class PrivacyDashboardActivity extends SettingsActivity { /* empty */ }
168     public static class PrivacySettingsActivity extends SettingsActivity { /* empty */ }
169     public static class FactoryResetActivity extends SettingsActivity {
170         @Override
onCreate(Bundle savedState)171         protected void onCreate(Bundle savedState) {
172             setTheme(SetupWizardUtils.getTheme(this, getIntent()));
173             ThemeHelper.trySetDynamicColor(this);
174             super.onCreate(savedState);
175         }
176 
177         @Override
isToolbarEnabled()178         protected boolean isToolbarEnabled() {
179             return false;
180         }
181     }
182     public static class FactoryResetConfirmActivity extends SettingsActivity {
183         @Override
onCreate(Bundle savedState)184         protected void onCreate(Bundle savedState) {
185             setTheme(SetupWizardUtils.getTheme(this, getIntent()));
186             ThemeHelper.trySetDynamicColor(this);
187             super.onCreate(savedState);
188         }
189 
190         @Override
isToolbarEnabled()191         protected boolean isToolbarEnabled() {
192             return false;
193         }
194     }
195     public static class RunningServicesActivity extends SettingsActivity { /* empty */ }
196     public static class BatterySaverSettingsActivity extends SettingsActivity { /* empty */ }
197     public static class BatterySaverScheduleSettingsActivity extends SettingsActivity { /* empty */ }
198     public static class AccountSyncSettingsActivity extends SettingsActivity { /* empty */ }
199     public static class AccountSyncSettingsInAddAccountActivity extends SettingsActivity { /* empty */ }
200     public static class CryptKeeperSettingsActivity extends SettingsActivity { /* empty */ }
201     public static class DeviceAdminSettingsActivity extends SettingsActivity { /* empty */ }
202     public static class DataUsageSummaryActivity extends SettingsActivity { /* empty */ }
203     public static class MobileDataUsageListActivity extends SettingsActivity { /* empty */ }
204     public static class ConfigureWifiSettingsActivity extends SettingsActivity { /* empty */ }
205     public static class SavedAccessPointsSettingsActivity extends SettingsActivity { /* empty */ }
206     public static class TextToSpeechSettingsActivity extends SettingsActivity { /* empty */ }
207     public static class AndroidBeamSettingsActivity extends SettingsActivity { /* empty */ }
208     public static class WifiDisplaySettingsActivity extends SettingsActivity { /* empty */ }
209     public static class DreamSettingsActivity extends SettingsActivity { /* empty */ }
210     public static class NotificationStationActivity extends SettingsActivity { /* empty */ }
211     public static class UserSettingsActivity extends SettingsActivity { /* empty */ }
212     public static class NotificationAccessSettingsActivity extends SettingsActivity { /* empty */ }
213     public static class NotificationAccessDetailsActivity extends SettingsActivity { /* empty */ }
214     public static class VrListenersSettingsActivity extends SettingsActivity { /* empty */ }
215     public static class PremiumSmsAccessActivity extends SettingsActivity { /* empty */ }
216     public static class PictureInPictureSettingsActivity extends SettingsActivity { /* empty */ }
217     public static class AppPictureInPictureSettingsActivity extends SettingsActivity { /* empty */ }
218     public static class ZenAccessSettingsActivity extends SettingsActivity { /* empty */ }
219     public static class ZenAccessDetailSettingsActivity extends SettingsActivity {}
220     public static class ConditionProviderSettingsActivity extends SettingsActivity { /* empty */ }
221     public static class UsbSettingsActivity extends SettingsActivity { /* empty */ }
222     public static class UsbDetailsActivity extends SettingsActivity { /* empty */ }
223     public static class TrustedCredentialsSettingsActivity extends SettingsActivity { /* empty */ }
224     public static class PaymentSettingsActivity extends SettingsActivity { /* empty */ }
225     public static class PrintSettingsActivity extends SettingsActivity { /* empty */ }
226     public static class PrintJobSettingsActivity extends SettingsActivity { /* empty */ }
227     public static class ZenModeSettingsActivity extends SettingsActivity { /* empty */ }
228     public static class ZenModeBehaviorSettingsActivity extends SettingsActivity { /* empty */ }
229     public static class ZenModeBlockedEffectsSettingsActivity extends SettingsActivity { /* empty */ }
230     public static class ZenModeAutomationSettingsActivity extends SettingsActivity { /* empty */ }
231     public static class ZenModeScheduleRuleSettingsActivity extends SettingsActivity { /* empty */ }
232     public static class ZenModeEventRuleSettingsActivity extends SettingsActivity { /* empty */ }
233     public static class SoundSettingsActivity extends SettingsActivity { /* empty */ }
234     public static class ConfigureNotificationSettingsActivity extends SettingsActivity { /* empty */ }
235     public static class ConversationListSettingsActivity extends SettingsActivity { /* empty */ }
236     public static class AppBubbleNotificationSettingsActivity extends SettingsActivity { /* empty */ }
237     public static class NotificationAssistantSettingsActivity extends SettingsActivity{ /* empty */ }
238     public static class NotificationAppListActivity extends SettingsActivity { /* empty */ }
239     public static class AppNotificationSettingsActivity extends SettingsActivity { /* empty */ }
240     public static class ChannelNotificationSettingsActivity extends SettingsActivity { /* empty */ }
241     public static class ChannelGroupNotificationSettingsActivity extends SettingsActivity { /* empty */ }
242     public static class ManageDomainUrlsActivity extends SettingsActivity { /* empty */ }
243     public static class AutomaticStorageManagerSettingsActivity extends SettingsActivity { /* empty */ }
244     public static class GamesStorageActivity extends SettingsActivity { /* empty */ }
245     public static class GestureNavigationSettingsActivity extends SettingsActivity { /* empty */ }
246     public static class InteractAcrossProfilesSettingsActivity extends SettingsActivity {
247         /* empty */
248     }
249     public static class AppInteractAcrossProfilesSettingsActivity extends SettingsActivity {
250         /* empty */
251     }
252 
253     public static class ApnSettingsActivity extends SettingsActivity { /* empty */ }
254     public static class WifiCallingSettingsActivity extends SettingsActivity { /* empty */ }
255     public static class MemorySettingsActivity extends SettingsActivity { /* empty */ }
256     public static class AppMemoryUsageActivity extends SettingsActivity { /* empty */ }
257     public static class OverlaySettingsActivity extends SettingsActivity { /* empty */ }
258     public static class ManageExternalStorageActivity extends SettingsActivity { /* empty */ }
259     public static class AppManageExternalStorageActivity extends SettingsActivity { /* empty */ }
260     public static class MediaManagementAppsActivity extends SettingsActivity { /* empty */ }
261     public static class AppMediaManagementAppsActivity extends SettingsActivity { /* empty */ }
262     public static class WriteSettingsActivity extends SettingsActivity { /* empty */ }
263     public static class ChangeWifiStateActivity extends SettingsActivity { /* empty */ }
264     public static class AppDrawOverlaySettingsActivity extends SettingsActivity { /* empty */ }
265     public static class AppWriteSettingsActivity extends SettingsActivity { /* empty */ }
266 
267     public static class ManageExternalSourcesActivity extends SettingsActivity {/* empty */ }
268     public static class ManageAppExternalSourcesActivity extends SettingsActivity { /* empty */ }
269     public static class WallpaperSettingsActivity extends SettingsActivity { /* empty */ }
270     public static class ManagedProfileSettingsActivity extends SettingsActivity { /* empty */ }
271     public static class DeletionHelperActivity extends SettingsActivity { /* empty */ }
272 
273     /** Actviity to manage apps with {@link android.Manifest.permission#SCHEDULE_EXACT_ALARM} */
274     public static class AlarmsAndRemindersActivity extends SettingsActivity {/* empty */ }
275     /** App specific version of {@link AlarmsAndRemindersActivity} */
276     public static class AlarmsAndRemindersAppActivity extends SettingsActivity {/* empty */ }
277 
278     public static class ApnEditorActivity extends SettingsActivity { /* empty */ }
279     public static class ChooseAccountActivity extends SettingsActivity { /* empty */ }
280     public static class IccLockSettingsActivity extends SettingsActivity { /* empty */ }
281     public static class TestingSettingsActivity extends SettingsActivity { /* empty */ }
282     public static class WifiAPITestActivity extends SettingsActivity { /* empty */ }
283     public static class WifiInfoActivity extends SettingsActivity { /* empty */ }
284     public static class EnterprisePrivacySettingsActivity extends SettingsActivity {
285         @Override
onCreate(Bundle savedInstanceState)286         public void onCreate(Bundle savedInstanceState) {
287             super.onCreate(savedInstanceState);
288             if (FeatureFactory.getFactory(this)
289                     .getEnterprisePrivacyFeatureProvider(this)
290                     .showParentalControls()) {
291                 finish();
292             } else if (!EnterprisePrivacySettings.isPageEnabled(this)) {
293                 finish();
294             }
295         }
296     }
297     public static class WebViewAppPickerActivity extends SettingsActivity { /* empty */ }
298     public static class AdvancedConnectedDeviceActivity extends SettingsActivity { /* empty */ }
299     public static class BluetoothDeviceDetailActivity extends SettingsActivity { /* empty */ }
300     public static class WifiCallingDisclaimerActivity extends SettingsActivity { /* empty */ }
301     public static class MobileNetworkListActivity extends SettingsActivity {}
302     public static class PowerMenuSettingsActivity extends SettingsActivity {}
303     /**
304      * Activity for BugReportHandlerPicker.
305      */
306     public static class BugReportHandlerPickerActivity extends SettingsActivity { /* empty */ }
307 
308     // Top level categories for new IA
309     public static class NetworkDashboardActivity extends SettingsActivity {}
310     public static class ConnectedDeviceDashboardActivity extends SettingsActivity {}
311     public static class PowerUsageSummaryActivity extends SettingsActivity { /* empty */ }
312     public static class StorageDashboardActivity extends SettingsActivity {}
313     public static class AccountDashboardActivity extends SettingsActivity {}
314     public static class SystemDashboardActivity extends SettingsActivity {}
315 
316     /**
317      * Activity for MediaControlsSettings
318      */
319     public static class MediaControlsSettingsActivity extends SettingsActivity {}
320 
321     /**
322      * Activity for AppDashboard.
323      */
324     public static class AppDashboardActivity extends SettingsActivity {}
325 }
326