blob: 64a7d7f7590af59ec93bbd161824a7b8f9b91594 [file] [log] [blame]
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001/*
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
17package com.android.settings;
18
Amith Yamasani56821db2012-06-05 13:20:45 -070019import android.accounts.Account;
20import android.accounts.AccountManager;
21import android.accounts.OnAccountsUpdateListener;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080022import android.content.ComponentName;
Gilles Debunnee78c1872011-06-20 15:00:07 -070023import android.content.Context;
Amith Yamasani379d9b02010-09-27 12:03:59 -070024import android.content.Intent;
Amith Yamasani233592b2013-03-01 17:05:23 -080025import android.content.RestrictionEntry;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -070026import android.content.SharedPreferences;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070027import android.content.pm.ActivityInfo;
28import android.content.pm.PackageManager;
29import android.content.pm.PackageManager.NameNotFoundException;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070030import android.graphics.drawable.Drawable;
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -070031import android.os.Bundle;
Jeff Sharkey34e964d2012-04-21 15:41:48 -070032import android.os.INetworkManagementService;
33import android.os.RemoteException;
34import android.os.ServiceManager;
Dianne Hackbornbb06a422012-08-16 11:01:57 -070035import android.os.UserHandle;
Jeff Sharkey44202462012-09-19 13:13:45 -070036import android.os.UserManager;
Amith Yamasania4379d62011-07-22 10:34:58 -070037import android.preference.Preference;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070038import android.preference.PreferenceActivity;
Amith Yamasania4379d62011-07-22 10:34:58 -070039import android.preference.PreferenceFragment;
Gilles Debunnee78c1872011-06-20 15:00:07 -070040import android.text.TextUtils;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080041import android.util.Log;
Gilles Debunnee78c1872011-06-20 15:00:07 -070042import android.view.LayoutInflater;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080043import android.view.View;
44import android.view.View.OnClickListener;
Gilles Debunnee78c1872011-06-20 15:00:07 -070045import android.view.ViewGroup;
46import android.widget.ArrayAdapter;
Amith Yamasani9e3a4702011-01-11 09:09:26 -080047import android.widget.Button;
Gilles Debunnee78c1872011-06-20 15:00:07 -070048import android.widget.ImageView;
49import android.widget.ListAdapter;
50import android.widget.Switch;
51import android.widget.TextView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080052
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080053import com.android.internal.util.ArrayUtils;
54import com.android.settings.AccessibilitySettings.ToggleAccessibilityServicePreferenceFragment;
55import com.android.settings.accounts.AccountSyncSettings;
56import com.android.settings.accounts.AuthenticatorHelper;
57import com.android.settings.accounts.ManageAccountsSettings;
58import com.android.settings.bluetooth.BluetoothEnabler;
59import com.android.settings.bluetooth.BluetoothSettings;
Amith Yamasani233592b2013-03-01 17:05:23 -080060import com.android.settings.users.RestrictionsReceiver;
Jeff Sharkey0c3634c2013-02-20 12:35:16 -080061import com.android.settings.wfd.WifiDisplaySettings;
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080062import com.android.settings.wifi.WifiEnabler;
63import com.android.settings.wifi.WifiSettings;
64import com.android.settings.wifi.p2p.WifiP2pSettings;
65
Gilles Debunnee78c1872011-06-20 15:00:07 -070066import java.util.ArrayList;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070067import java.util.Collections;
68import java.util.Comparator;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070069import java.util.HashMap;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070070import java.util.List;
Amith Yamasanid7993472010-08-18 13:59:28 -070071
72/**
73 * Top-level settings activity to handle single pane and double pane UI layout.
74 */
Amith Yamasani56821db2012-06-05 13:20:45 -070075public class Settings extends PreferenceActivity
76 implements ButtonBarHandler, OnAccountsUpdateListener {
Amith Yamasanid7993472010-08-18 13:59:28 -070077
Gilles Debunnee78c1872011-06-20 15:00:07 -070078 private static final String LOG_TAG = "Settings";
Amith Yamasaniea7b28c2012-06-20 13:51:40 -070079
Amith Yamasani5203bdf2010-11-04 09:59:44 -070080 private static final String META_DATA_KEY_HEADER_ID =
Gilles Debunnee78c1872011-06-20 15:00:07 -070081 "com.android.settings.TOP_LEVEL_HEADER_ID";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070082 private static final String META_DATA_KEY_FRAGMENT_CLASS =
Gilles Debunnee78c1872011-06-20 15:00:07 -070083 "com.android.settings.FRAGMENT_CLASS";
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080084 private static final String META_DATA_KEY_PARENT_TITLE =
85 "com.android.settings.PARENT_FRAGMENT_TITLE";
86 private static final String META_DATA_KEY_PARENT_FRAGMENT_CLASS =
87 "com.android.settings.PARENT_FRAGMENT_CLASS";
88
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080089 private static final String EXTRA_UI_OPTIONS = "settings:ui_options";
Jeff Sharkey9fab0da2011-07-09 17:52:31 -070090
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080091 private static final String SAVE_KEY_CURRENT_HEADER = "com.android.settings.CURRENT_HEADER";
92 private static final String SAVE_KEY_PARENT_HEADER = "com.android.settings.PARENT_HEADER";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070093
94 private String mFragmentClass;
95 private int mTopLevelHeaderId;
Amith Yamasani3965ae62010-11-15 14:45:19 -080096 private Header mFirstHeader;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080097 private Header mCurrentHeader;
98 private Header mParentHeader;
99 private boolean mInLocalHeaderSwitch;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700100
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700101 // Show only these settings for restricted users
102 private int[] SETTINGS_FOR_RESTRICTED = {
Amith Yamasani32630392012-08-10 19:31:39 -0700103 R.id.wireless_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700104 R.id.wifi_settings,
105 R.id.bluetooth_settings,
Jeff Sharkey38305fb2012-09-14 16:26:51 -0700106 R.id.data_usage_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700107 R.id.wireless_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700108 R.id.device_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700109 R.id.sound_settings,
110 R.id.display_settings,
Jeff Sharkey90c8b202012-08-30 15:20:10 -0700111 R.id.storage_settings,
Dianne Hackborn271c8b02012-08-20 17:24:39 -0700112 R.id.application_settings,
Dianne Hackborn52e56a22012-09-12 17:02:23 -0700113 R.id.battery_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700114 R.id.personal_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700115 R.id.location_settings,
Amith Yamasani3deeeb72012-04-05 14:44:48 -0700116 R.id.security_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700117 R.id.language_settings,
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700118 R.id.user_settings,
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700119 R.id.account_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700120 R.id.account_add,
121 R.id.system_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700122 R.id.date_time_settings,
Jeff Brown9e143f52012-09-19 20:46:07 -0700123 R.id.about_settings,
Svetoslav Ganov46045d82012-09-20 15:04:55 -0700124 R.id.accessibility_settings
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700125 };
126
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700127 private SharedPreferences mDevelopmentPreferences;
128 private SharedPreferences.OnSharedPreferenceChangeListener mDevelopmentPreferencesListener;
129
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700130 // TODO: Update Call Settings based on airplane mode state.
Amith Yamasanib61cf512010-09-12 08:17:50 -0700131
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700132 protected HashMap<Integer, Integer> mHeaderIndexMap = new HashMap<Integer, Integer>();
133
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700134 private AuthenticatorHelper mAuthenticatorHelper;
135 private Header mLastHeader;
Amith Yamasani86708a82012-06-06 20:23:08 -0700136 private boolean mListeningToAccountUpdates;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700137
Amith Yamasani233592b2013-03-01 17:05:23 -0800138 private List<RestrictionEntry> mAppRestrictions;
139
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700140 @Override
141 protected void onCreate(Bundle savedInstanceState) {
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800142 if (getIntent().hasExtra(EXTRA_UI_OPTIONS)) {
143 getWindow().setUiOptions(getIntent().getIntExtra(EXTRA_UI_OPTIONS, 0));
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700144 }
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700145
Amith Yamasani233592b2013-03-01 17:05:23 -0800146 mAppRestrictions = getApplicationRestrictions();
147
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700148 mAuthenticatorHelper = new AuthenticatorHelper();
149 mAuthenticatorHelper.updateAuthDescriptions(this);
150 mAuthenticatorHelper.onAccountsUpdated(this, null);
151
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700152 mDevelopmentPreferences = getSharedPreferences(DevelopmentSettings.PREF_FILE,
153 Context.MODE_PRIVATE);
154
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700155 getMetaData();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800156 mInLocalHeaderSwitch = true;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700157 super.onCreate(savedInstanceState);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800158 mInLocalHeaderSwitch = false;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700159
Gilles Debunne3661b622011-06-27 11:19:16 -0700160 if (!onIsHidingHeaders() && onIsMultiPane()) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700161 highlightHeader(mTopLevelHeaderId);
Amith Yamasani72aa19d2010-12-09 06:07:12 -0800162 // Force the title so that it doesn't get overridden by a direct launch of
163 // a specific settings screen.
164 setTitle(R.string.settings_label);
165 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800166
167 // Retrieve any saved state
168 if (savedInstanceState != null) {
169 mCurrentHeader = savedInstanceState.getParcelable(SAVE_KEY_CURRENT_HEADER);
170 mParentHeader = savedInstanceState.getParcelable(SAVE_KEY_PARENT_HEADER);
171 }
172
173 // If the current header was saved, switch to it
174 if (savedInstanceState != null && mCurrentHeader != null) {
175 //switchToHeaderLocal(mCurrentHeader);
176 showBreadCrumbs(mCurrentHeader.title, null);
177 }
178
179 if (mParentHeader != null) {
180 setParentTitle(mParentHeader.title, null, new OnClickListener() {
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400181 @Override
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800182 public void onClick(View v) {
183 switchToParent(mParentHeader.fragment);
184 }
185 });
186 }
Gilles Debunnedc7101f2011-06-27 12:00:49 -0700187
Amith Yamasani3d384f42012-05-11 15:22:04 -0700188 // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
189 if (onIsMultiPane()) {
190 getActionBar().setDisplayHomeAsUpEnabled(false);
191 getActionBar().setHomeButtonEnabled(false);
192 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800193 }
194
195 @Override
196 protected void onSaveInstanceState(Bundle outState) {
197 super.onSaveInstanceState(outState);
198
199 // Save the current fragment, if it is the same as originally launched
200 if (mCurrentHeader != null) {
201 outState.putParcelable(SAVE_KEY_CURRENT_HEADER, mCurrentHeader);
202 }
203 if (mParentHeader != null) {
204 outState.putParcelable(SAVE_KEY_PARENT_HEADER, mParentHeader);
205 }
206 }
207
Gilles Debunnee78c1872011-06-20 15:00:07 -0700208 @Override
209 public void onResume() {
210 super.onResume();
211
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700212 mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
213 @Override
214 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
215 invalidateHeaders();
216 }
217 };
218 mDevelopmentPreferences.registerOnSharedPreferenceChangeListener(
219 mDevelopmentPreferencesListener);
220
Gilles Debunnee78c1872011-06-20 15:00:07 -0700221 ListAdapter listAdapter = getListAdapter();
222 if (listAdapter instanceof HeaderAdapter) {
223 ((HeaderAdapter) listAdapter).resume();
224 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700225 invalidateHeaders();
Gilles Debunnee78c1872011-06-20 15:00:07 -0700226 }
227
228 @Override
229 public void onPause() {
230 super.onPause();
231
232 ListAdapter listAdapter = getListAdapter();
233 if (listAdapter instanceof HeaderAdapter) {
234 ((HeaderAdapter) listAdapter).pause();
Amith Yamasani86708a82012-06-06 20:23:08 -0700235 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700236
237 mDevelopmentPreferences.unregisterOnSharedPreferenceChangeListener(
238 mDevelopmentPreferencesListener);
239 mDevelopmentPreferencesListener = null;
Amith Yamasani86708a82012-06-06 20:23:08 -0700240 }
241
242 @Override
243 public void onDestroy() {
244 super.onDestroy();
245 if (mListeningToAccountUpdates) {
Amith Yamasani56821db2012-06-05 13:20:45 -0700246 AccountManager.get(this).removeOnAccountsUpdatedListener(this);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700247 }
248 }
249
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800250 private void switchToHeaderLocal(Header header) {
251 mInLocalHeaderSwitch = true;
252 switchToHeader(header);
253 mInLocalHeaderSwitch = false;
254 }
255
256 @Override
257 public void switchToHeader(Header header) {
258 if (!mInLocalHeaderSwitch) {
259 mCurrentHeader = null;
260 mParentHeader = null;
261 }
262 super.switchToHeader(header);
263 }
264
265 /**
266 * Switch to parent fragment and store the grand parent's info
Jake Hamby2748fc22011-01-12 15:06:28 -0800267 * @param className name of the activity wrapper for the parent fragment.
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800268 */
269 private void switchToParent(String className) {
270 final ComponentName cn = new ComponentName(this, className);
271 try {
272 final PackageManager pm = getPackageManager();
273 final ActivityInfo parentInfo = pm.getActivityInfo(cn, PackageManager.GET_META_DATA);
274
275 if (parentInfo != null && parentInfo.metaData != null) {
276 String fragmentClass = parentInfo.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
277 CharSequence fragmentTitle = parentInfo.loadLabel(pm);
278 Header parentHeader = new Header();
279 parentHeader.fragment = fragmentClass;
280 parentHeader.title = fragmentTitle;
281 mCurrentHeader = parentHeader;
282
283 switchToHeaderLocal(parentHeader);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700284 highlightHeader(mTopLevelHeaderId);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800285
286 mParentHeader = new Header();
287 mParentHeader.fragment
288 = parentInfo.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
289 mParentHeader.title = parentInfo.metaData.getString(META_DATA_KEY_PARENT_TITLE);
290 }
291 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700292 Log.w(LOG_TAG, "Could not find parent activity : " + className);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800293 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700294 }
295
Amith Yamasani3965ae62010-11-15 14:45:19 -0800296 @Override
297 public void onNewIntent(Intent intent) {
298 super.onNewIntent(intent);
299
300 // If it is not launched from history, then reset to top-level
Amith Yamasanief617232012-10-09 16:57:25 -0700301 if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
302 if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
303 switchToHeaderLocal(mFirstHeader);
304 }
305 getListView().setSelectionFromTop(0, 0);
Amith Yamasani3965ae62010-11-15 14:45:19 -0800306 }
307 }
308
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700309 private void highlightHeader(int id) {
310 if (id != 0) {
311 Integer index = mHeaderIndexMap.get(id);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700312 if (index != null) {
313 getListView().setItemChecked(index, true);
Amith Yamasanief617232012-10-09 16:57:25 -0700314 if (isMultiPane()) {
315 getListView().smoothScrollToPosition(index);
316 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700317 }
318 }
319 }
320
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700321 @Override
322 public Intent getIntent() {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700323 Intent superIntent = super.getIntent();
324 String startingFragment = getStartingFragmentClass(superIntent);
Gilles Debunne3661b622011-06-27 11:19:16 -0700325 // This is called from super.onCreate, isMultiPane() is not yet reliable
326 // Do not use onIsHidingHeaders either, which relies itself on this method
327 if (startingFragment != null && !onIsMultiPane()) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700328 Intent modIntent = new Intent(superIntent);
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700329 modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700330 Bundle args = superIntent.getExtras();
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700331 if (args != null) {
332 args = new Bundle(args);
333 } else {
334 args = new Bundle();
335 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700336 args.putParcelable("intent", superIntent);
337 modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, superIntent.getExtras());
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700338 return modIntent;
339 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700340 return superIntent;
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700341 }
342
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700343 /**
Amith Yamasani379d9b02010-09-27 12:03:59 -0700344 * Checks if the component name in the intent is different from the Settings class and
345 * returns the class name to load as a fragment.
346 */
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700347 protected String getStartingFragmentClass(Intent intent) {
348 if (mFragmentClass != null) return mFragmentClass;
349
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700350 String intentClass = intent.getComponent().getClassName();
Amith Yamasani379d9b02010-09-27 12:03:59 -0700351 if (intentClass.equals(getClass().getName())) return null;
352
Dianne Hackbornee293792010-11-01 12:32:33 -0700353 if ("com.android.settings.ManageApplications".equals(intentClass)
354 || "com.android.settings.RunningServices".equals(intentClass)
355 || "com.android.settings.applications.StorageUse".equals(intentClass)) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700356 // Old names of manage apps.
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700357 intentClass = com.android.settings.applications.ManageApplications.class.getName();
358 }
359
Amith Yamasani379d9b02010-09-27 12:03:59 -0700360 return intentClass;
361 }
362
363 /**
364 * Override initial header when an activity-alias is causing Settings to be launched
365 * for a specific fragment encoded in the android:name parameter.
366 */
367 @Override
368 public Header onGetInitialHeader() {
369 String fragmentClass = getStartingFragmentClass(super.getIntent());
370 if (fragmentClass != null) {
371 Header header = new Header();
372 header.fragment = fragmentClass;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800373 header.title = getTitle();
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700374 header.fragmentArguments = getIntent().getExtras();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800375 mCurrentHeader = header;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700376 return header;
377 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700378
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700379 return mFirstHeader;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700380 }
381
Dianne Hackbornb7258182011-03-15 16:23:55 -0700382 @Override
Dianne Hackborn48147dc2011-03-18 12:29:41 -0700383 public Intent onBuildStartFragmentIntent(String fragmentName, Bundle args,
384 int titleRes, int shortTitleRes) {
385 Intent intent = super.onBuildStartFragmentIntent(fragmentName, args,
386 titleRes, shortTitleRes);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700387
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800388 // Some fragments want split ActionBar; these should stay in sync with
389 // uiOptions for fragments also defined as activities in manifest.
390 if (WifiSettings.class.getName().equals(fragmentName) ||
391 WifiP2pSettings.class.getName().equals(fragmentName) ||
Jeff Sharkey0c3634c2013-02-20 12:35:16 -0800392 WifiDisplaySettings.class.getName().equals(fragmentName) ||
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800393 BluetoothSettings.class.getName().equals(fragmentName) ||
394 DreamSettings.class.getName().equals(fragmentName) ||
395 ToggleAccessibilityServicePreferenceFragment.class.getName().equals(fragmentName)) {
396 intent.putExtra(EXTRA_UI_OPTIONS, ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700397 }
398
Dianne Hackbornb7258182011-03-15 16:23:55 -0700399 intent.setClass(this, SubSettings.class);
400 return intent;
401 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700402
Amith Yamasani379d9b02010-09-27 12:03:59 -0700403 /**
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700404 * Populate the activity with the top-level headers.
405 */
Amith Yamasanid7993472010-08-18 13:59:28 -0700406 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700407 public void onBuildHeaders(List<Header> headers) {
408 loadHeadersFromResource(R.xml.settings_headers, headers);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700409 updateHeaderList(headers);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700410 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700411
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700412 private void updateHeaderList(List<Header> target) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700413 final boolean showDev = mDevelopmentPreferences.getBoolean(
414 DevelopmentSettings.PREF_SHOW,
415 android.os.Build.TYPE.equals("eng"));
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700416 int i = 0;
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400417
418 final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700419 mHeaderIndexMap.clear();
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700420 while (i < target.size()) {
421 Header header = target.get(i);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700422 // Ids are integers, so downcasting
423 int id = (int) header.id;
Chris Wren2bc32ae2012-09-24 14:23:46 -0400424 if (id == R.id.operator_settings || id == R.id.manufacturer_settings) {
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700425 Utils.updateHeaderToSpecificActivityFromMetaDataOrRemove(this, target, header);
Gilles Debunne2454f492011-06-21 16:16:06 -0700426 } else if (id == R.id.wifi_settings) {
427 // Remove WiFi Settings if WiFi service is not available.
428 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700429 target.remove(i);
Gilles Debunne2454f492011-06-21 16:16:06 -0700430 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700431 } else if (id == R.id.bluetooth_settings) {
432 // Remove Bluetooth Settings if Bluetooth service is not available.
Gilles Debunne2454f492011-06-21 16:16:06 -0700433 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700434 target.remove(i);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700435 }
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700436 } else if (id == R.id.data_usage_settings) {
437 // Remove data usage when kernel module not enabled
438 final INetworkManagementService netManager = INetworkManagementService.Stub
439 .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
440 try {
441 if (!netManager.isBandwidthControlEnabled()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700442 target.remove(i);
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700443 }
444 } catch (RemoteException e) {
445 // ignored
446 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700447 } else if (id == R.id.account_settings) {
448 int headerIndex = i + 1;
449 i = insertAccountsHeaders(target, headerIndex);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700450 } else if (id == R.id.user_settings) {
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700451 if (!UserHandle.MU_ENABLED
Jeff Sharkey44202462012-09-19 13:13:45 -0700452 || !UserManager.supportsMultipleUsers()
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700453 || Utils.isMonkeyRunning()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700454 target.remove(i);
455 }
456 } else if (id == R.id.development_settings) {
457 if (!showDev) {
458 target.remove(i);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700459 }
Amith Yamasani233592b2013-03-01 17:05:23 -0800460 } else if (id == R.id.application_settings) {
461 if (mAppRestrictions != null) {
462 for (RestrictionEntry entry : mAppRestrictions) {
463 if (entry.key.equals(RestrictionsReceiver.KEY_ENABLE_APPS)
464 && !entry.getBooleanValue()) {
465 target.remove(i);
466 }
467 }
468 }
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400469 } else if (id == R.id.account_add) {
470 if (um.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS)) {
471 target.remove(i);
472 }
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700473 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700474
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900475 if (i < target.size() && target.get(i) == header
Amith Yamasanib99f8642012-10-10 21:41:12 -0700476 && UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700477 && !ArrayUtils.contains(SETTINGS_FOR_RESTRICTED, id)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700478 target.remove(i);
Amith Yamasanid7993472010-08-18 13:59:28 -0700479 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700480
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700481 // Increment if the current one wasn't removed by the Utils code.
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900482 if (i < target.size() && target.get(i) == header) {
Amith Yamasani3965ae62010-11-15 14:45:19 -0800483 // Hold on to the first header, when we need to reset to the top-level
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700484 if (mFirstHeader == null &&
485 HeaderAdapter.getHeaderType(header) != HeaderAdapter.HEADER_TYPE_CATEGORY) {
486 mFirstHeader = header;
487 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700488 mHeaderIndexMap.put(id, i);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700489 i++;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700490 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700491 }
492 }
493
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700494 private int insertAccountsHeaders(List<Header> target, int headerIndex) {
495 String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
496 List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length);
497 for (String accountType : accountTypes) {
498 CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType);
Brian Muramatsuc28af522012-06-28 14:25:14 -0700499 if (label == null) {
500 continue;
501 }
502
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700503 Account[] accounts = AccountManager.get(this).getAccountsByType(accountType);
504 boolean skipToAccount = accounts.length == 1
505 && !mAuthenticatorHelper.hasAccountPreferences(accountType);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700506 Header accHeader = new Header();
507 accHeader.title = label;
508 if (accHeader.extras == null) {
509 accHeader.extras = new Bundle();
510 }
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700511 if (skipToAccount) {
512 accHeader.breadCrumbTitleRes = R.string.account_sync_settings_title;
513 accHeader.breadCrumbShortTitleRes = R.string.account_sync_settings_title;
514 accHeader.fragment = AccountSyncSettings.class.getName();
515 accHeader.fragmentArguments = new Bundle();
516 // Need this for the icon
517 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
518 accHeader.extras.putParcelable(AccountSyncSettings.ACCOUNT_KEY, accounts[0]);
519 accHeader.fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
520 accounts[0]);
521 } else {
522 accHeader.breadCrumbTitle = label;
523 accHeader.breadCrumbShortTitle = label;
524 accHeader.fragment = ManageAccountsSettings.class.getName();
525 accHeader.fragmentArguments = new Bundle();
526 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
527 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE,
528 accountType);
529 if (!isMultiPane()) {
530 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
531 label.toString());
532 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700533 }
534 accountHeaders.add(accHeader);
535 }
536
537 // Sort by label
538 Collections.sort(accountHeaders, new Comparator<Header>() {
539 @Override
540 public int compare(Header h1, Header h2) {
541 return h1.title.toString().compareTo(h2.title.toString());
542 }
543 });
544
545 for (Header header : accountHeaders) {
546 target.add(headerIndex++, header);
547 }
Amith Yamasani86708a82012-06-06 20:23:08 -0700548 if (!mListeningToAccountUpdates) {
549 AccountManager.get(this).addOnAccountsUpdatedListener(this, null, true);
550 mListeningToAccountUpdates = true;
551 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700552 return headerIndex;
553 }
554
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700555 private void getMetaData() {
556 try {
557 ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
558 PackageManager.GET_META_DATA);
559 if (ai == null || ai.metaData == null) return;
560 mTopLevelHeaderId = ai.metaData.getInt(META_DATA_KEY_HEADER_ID);
561 mFragmentClass = ai.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700562
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800563 // Check if it has a parent specified and create a Header object
564 final int parentHeaderTitleRes = ai.metaData.getInt(META_DATA_KEY_PARENT_TITLE);
565 String parentFragmentClass = ai.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
566 if (parentFragmentClass != null) {
567 mParentHeader = new Header();
568 mParentHeader.fragment = parentFragmentClass;
569 if (parentHeaderTitleRes != 0) {
570 mParentHeader.title = getResources().getString(parentHeaderTitleRes);
571 }
572 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700573 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700574 // No recovery
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700575 }
576 }
577
Amith Yamasani9e3a4702011-01-11 09:09:26 -0800578 @Override
579 public boolean hasNextButton() {
580 return super.hasNextButton();
581 }
582
583 @Override
584 public Button getNextButton() {
585 return super.getNextButton();
586 }
587
Gilles Debunnee78c1872011-06-20 15:00:07 -0700588 private static class HeaderAdapter extends ArrayAdapter<Header> {
589 static final int HEADER_TYPE_CATEGORY = 0;
590 static final int HEADER_TYPE_NORMAL = 1;
591 static final int HEADER_TYPE_SWITCH = 2;
592 private static final int HEADER_TYPE_COUNT = HEADER_TYPE_SWITCH + 1;
593
594 private final WifiEnabler mWifiEnabler;
595 private final BluetoothEnabler mBluetoothEnabler;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700596 private AuthenticatorHelper mAuthHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700597
598 private static class HeaderViewHolder {
599 ImageView icon;
600 TextView title;
601 TextView summary;
602 Switch switch_;
603 }
604
605 private LayoutInflater mInflater;
606
607 static int getHeaderType(Header header) {
608 if (header.fragment == null && header.intent == null) {
609 return HEADER_TYPE_CATEGORY;
610 } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
611 return HEADER_TYPE_SWITCH;
612 } else {
613 return HEADER_TYPE_NORMAL;
614 }
615 }
616
617 @Override
618 public int getItemViewType(int position) {
619 Header header = getItem(position);
620 return getHeaderType(header);
621 }
622
623 @Override
624 public boolean areAllItemsEnabled() {
625 return false; // because of categories
626 }
627
628 @Override
629 public boolean isEnabled(int position) {
630 return getItemViewType(position) != HEADER_TYPE_CATEGORY;
631 }
632
633 @Override
634 public int getViewTypeCount() {
635 return HEADER_TYPE_COUNT;
636 }
637
638 @Override
639 public boolean hasStableIds() {
640 return true;
641 }
642
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700643 public HeaderAdapter(Context context, List<Header> objects,
644 AuthenticatorHelper authenticatorHelper) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700645 super(context, 0, objects);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700646
647 mAuthHelper = authenticatorHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700648 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700649
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700650 // Temp Switches provided as placeholder until the adapter replaces these with actual
Gilles Debunnee78c1872011-06-20 15:00:07 -0700651 // Switches inflated from their layouts. Must be done before adapter is set in super
652 mWifiEnabler = new WifiEnabler(context, new Switch(context));
653 mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
654 }
655
656 @Override
657 public View getView(int position, View convertView, ViewGroup parent) {
658 HeaderViewHolder holder;
659 Header header = getItem(position);
660 int headerType = getHeaderType(header);
661 View view = null;
662
663 if (convertView == null) {
664 holder = new HeaderViewHolder();
665 switch (headerType) {
666 case HEADER_TYPE_CATEGORY:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700667 view = new TextView(getContext(), null,
668 android.R.attr.listSeparatorTextViewStyle);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700669 holder.title = (TextView) view;
670 break;
671
672 case HEADER_TYPE_SWITCH:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700673 view = mInflater.inflate(R.layout.preference_header_switch_item, parent,
674 false);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700675 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700676 holder.title = (TextView)
677 view.findViewById(com.android.internal.R.id.title);
678 holder.summary = (TextView)
679 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700680 holder.switch_ = (Switch) view.findViewById(R.id.switchWidget);
681 break;
682
683 case HEADER_TYPE_NORMAL:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700684 view = mInflater.inflate(
Amith Yamasanic8a93172012-06-08 13:35:47 -0700685 R.layout.preference_header_item, parent,
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700686 false);
Amith Yamasanic8a93172012-06-08 13:35:47 -0700687 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700688 holder.title = (TextView)
689 view.findViewById(com.android.internal.R.id.title);
690 holder.summary = (TextView)
691 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700692 break;
693 }
694 view.setTag(holder);
695 } else {
696 view = convertView;
697 holder = (HeaderViewHolder) view.getTag();
698 }
699
700 // All view fields must be updated every time, because the view may be recycled
701 switch (headerType) {
702 case HEADER_TYPE_CATEGORY:
703 holder.title.setText(header.getTitle(getContext().getResources()));
704 break;
705
706 case HEADER_TYPE_SWITCH:
707 // Would need a different treatment if the main menu had more switches
708 if (header.id == R.id.wifi_settings) {
709 mWifiEnabler.setSwitch(holder.switch_);
710 } else {
711 mBluetoothEnabler.setSwitch(holder.switch_);
712 }
713 // No break, fall through on purpose to update common fields
714
715 //$FALL-THROUGH$
716 case HEADER_TYPE_NORMAL:
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700717 if (header.extras != null
718 && header.extras.containsKey(ManageAccountsSettings.KEY_ACCOUNT_TYPE)) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700719 String accType = header.extras.getString(
720 ManageAccountsSettings.KEY_ACCOUNT_TYPE);
721 ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
722 lp.width = getContext().getResources().getDimensionPixelSize(
723 R.dimen.header_icon_width);
724 lp.height = lp.width;
725 holder.icon.setLayoutParams(lp);
726 Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
727 holder.icon.setImageDrawable(icon);
728 } else {
729 holder.icon.setImageResource(header.iconRes);
730 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700731 holder.title.setText(header.getTitle(getContext().getResources()));
732 CharSequence summary = header.getSummary(getContext().getResources());
733 if (!TextUtils.isEmpty(summary)) {
734 holder.summary.setVisibility(View.VISIBLE);
735 holder.summary.setText(summary);
736 } else {
737 holder.summary.setVisibility(View.GONE);
738 }
739 break;
740 }
741
742 return view;
743 }
744
745 public void resume() {
746 mWifiEnabler.resume();
747 mBluetoothEnabler.resume();
748 }
Brian Muramatsuc28af522012-06-28 14:25:14 -0700749
Gilles Debunnee78c1872011-06-20 15:00:07 -0700750 public void pause() {
751 mWifiEnabler.pause();
752 mBluetoothEnabler.pause();
753 }
754 }
755
756 @Override
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700757 public void onHeaderClick(Header header, int position) {
758 boolean revert = false;
759 if (header.id == R.id.account_add) {
760 revert = true;
761 }
762
763 super.onHeaderClick(header, position);
764
765 if (revert && mLastHeader != null) {
766 highlightHeader((int) mLastHeader.id);
767 } else {
768 mLastHeader = header;
769 }
770 }
771
772 @Override
Amith Yamasania4379d62011-07-22 10:34:58 -0700773 public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
774 // Override the fragment title for Wallpaper settings
Amith Yamasanidfb65432011-11-29 16:38:14 -0800775 int titleRes = pref.getTitleRes();
Amith Yamasania4379d62011-07-22 10:34:58 -0700776 if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
Amith Yamasanidfb65432011-11-29 16:38:14 -0800777 titleRes = R.string.wallpaper_settings_fragment_title;
Amith Yamasani8666b9e2012-09-27 14:50:13 -0700778 } else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
779 && UserHandle.myUserId() != UserHandle.USER_OWNER) {
780 titleRes = R.string.user_info_settings_title;
Amith Yamasania4379d62011-07-22 10:34:58 -0700781 }
Jean Chalard7dabe452012-05-10 18:08:07 +0900782 startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
783 null, 0);
Amith Yamasania4379d62011-07-22 10:34:58 -0700784 return true;
785 }
786
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400787 @Override
Amith Yamasani3d384f42012-05-11 15:22:04 -0700788 public boolean shouldUpRecreateTask(Intent targetIntent) {
789 return super.shouldUpRecreateTask(new Intent(this, Settings.class));
790 }
791
Amith Yamasania4379d62011-07-22 10:34:58 -0700792 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700793 public void setListAdapter(ListAdapter adapter) {
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700794 if (adapter == null) {
795 super.setListAdapter(null);
796 } else {
797 super.setListAdapter(new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper));
Gilles Debunnee78c1872011-06-20 15:00:07 -0700798 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700799 }
800
Amith Yamasani56821db2012-06-05 13:20:45 -0700801 @Override
802 public void onAccountsUpdated(Account[] accounts) {
Jeff Sharkey9ff79c12012-10-03 16:48:17 -0700803 // TODO: watch for package upgrades to invalidate cache; see 7206643
804 mAuthenticatorHelper.updateAuthDescriptions(this);
Amith Yamasani56821db2012-06-05 13:20:45 -0700805 mAuthenticatorHelper.onAccountsUpdated(this, accounts);
806 invalidateHeaders();
807 }
808
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700809 /*
810 * Settings subclasses for launching independently.
811 */
Gilles Debunnee78c1872011-06-20 15:00:07 -0700812 public static class BluetoothSettingsActivity extends Settings { /* empty */ }
813 public static class WirelessSettingsActivity extends Settings { /* empty */ }
814 public static class TetherSettingsActivity extends Settings { /* empty */ }
815 public static class VpnSettingsActivity extends Settings { /* empty */ }
816 public static class DateTimeSettingsActivity extends Settings { /* empty */ }
817 public static class StorageSettingsActivity extends Settings { /* empty */ }
818 public static class WifiSettingsActivity extends Settings { /* empty */ }
repo syncb98463f2011-06-30 10:58:43 -0700819 public static class WifiP2pSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700820 public static class InputMethodAndLanguageSettingsActivity extends Settings { /* empty */ }
Jeff Browne46c5f32012-04-05 11:42:18 -0700821 public static class KeyboardLayoutPickerActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700822 public static class InputMethodAndSubtypeEnablerActivity extends Settings { /* empty */ }
satoke077d2b2011-07-25 09:38:11 +0900823 public static class SpellCheckersSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700824 public static class LocalePickerActivity extends Settings { /* empty */ }
825 public static class UserDictionarySettingsActivity extends Settings { /* empty */ }
826 public static class SoundSettingsActivity extends Settings { /* empty */ }
827 public static class DisplaySettingsActivity extends Settings { /* empty */ }
828 public static class DeviceInfoSettingsActivity extends Settings { /* empty */ }
829 public static class ApplicationSettingsActivity extends Settings { /* empty */ }
830 public static class ManageApplicationsActivity extends Settings { /* empty */ }
Dianne Hackborna522a8e2013-01-15 19:02:05 -0800831 public static class AppOpsSummaryActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700832 public static class StorageUseActivity extends Settings { /* empty */ }
833 public static class DevelopmentSettingsActivity extends Settings { /* empty */ }
834 public static class AccessibilitySettingsActivity extends Settings { /* empty */ }
835 public static class SecuritySettingsActivity extends Settings { /* empty */ }
Gilles Debunnea6a8a142011-06-09 11:56:17 -0700836 public static class LocationSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700837 public static class PrivacySettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700838 public static class RunningServicesActivity extends Settings { /* empty */ }
839 public static class ManageAccountsSettingsActivity extends Settings { /* empty */ }
840 public static class PowerUsageSummaryActivity extends Settings { /* empty */ }
841 public static class AccountSyncSettingsActivity extends Settings { /* empty */ }
842 public static class AccountSyncSettingsInAddAccountActivity extends Settings { /* empty */ }
843 public static class CryptKeeperSettingsActivity extends Settings { /* empty */ }
844 public static class DeviceAdminSettingsActivity extends Settings { /* empty */ }
845 public static class DataUsageSummaryActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700846 public static class AdvancedWifiSettingsActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700847 public static class TextToSpeechSettingsActivity extends Settings { /* empty */ }
Jeff Hamilton3d670de2011-09-21 16:44:36 -0500848 public static class AndroidBeamSettingsActivity extends Settings { /* empty */ }
Jeff Brown9e143f52012-09-19 20:46:07 -0700849 public static class WifiDisplaySettingsActivity extends Settings { /* empty */ }
Daniel Sandler7dee75c2012-11-27 22:41:30 -0500850 public static class DreamSettingsActivity extends Settings { /* empty */ }
Daniel Sandler328e2d22013-01-17 13:14:02 -0500851 public static class NotificationStationActivity extends Settings { /* empty */ }
Amith Yamasani233592b2013-03-01 17:05:23 -0800852 public static class UserSettingsActivity extends Settings { /* empty */ }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800853}