blob: d94103e8f7f505b39d18142d73fad427969d6d9b [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 Yamasanib810a0d2012-03-25 10:12:26 -070019import com.android.internal.util.ArrayUtils;
Adam Powella5f67622012-10-13 01:20:28 -070020import com.android.settings.ChooseLockGeneric.ChooseLockGenericFragment;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070021import com.android.settings.accounts.AccountSyncSettings;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070022import com.android.settings.accounts.AuthenticatorHelper;
23import com.android.settings.accounts.ManageAccountsSettings;
Adam Powell7474bc32012-09-30 18:21:14 -070024import com.android.settings.applications.InstalledAppDetails;
Adam Powellfaba7e42012-03-26 17:28:38 -070025import com.android.settings.applications.ManageApplications;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070026import com.android.settings.bluetooth.BluetoothEnabler;
Jeff Sharkey11d30122012-03-19 16:54:07 -070027import com.android.settings.deviceinfo.Memory;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070028import com.android.settings.fuelgauge.PowerUsageSummary;
Jeff Sharkey9fd7ac12012-08-25 00:06:08 -070029import com.android.settings.vpn2.VpnSettings;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070030import com.android.settings.wifi.WifiEnabler;
31
Amith Yamasani56821db2012-06-05 13:20:45 -070032import android.accounts.Account;
33import android.accounts.AccountManager;
34import android.accounts.OnAccountsUpdateListener;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080035import android.content.ComponentName;
Gilles Debunnee78c1872011-06-20 15:00:07 -070036import android.content.Context;
Amith Yamasani379d9b02010-09-27 12:03:59 -070037import android.content.Intent;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -070038import android.content.SharedPreferences;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070039import android.content.pm.ActivityInfo;
40import android.content.pm.PackageManager;
41import android.content.pm.PackageManager.NameNotFoundException;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070042import android.graphics.drawable.Drawable;
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -070043import android.os.Bundle;
Jeff Sharkey34e964d2012-04-21 15:41:48 -070044import android.os.INetworkManagementService;
45import android.os.RemoteException;
46import android.os.ServiceManager;
Dianne Hackbornbb06a422012-08-16 11:01:57 -070047import android.os.UserHandle;
Jeff Sharkey44202462012-09-19 13:13:45 -070048import android.os.UserManager;
Amith Yamasania4379d62011-07-22 10:34:58 -070049import android.preference.Preference;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070050import android.preference.PreferenceActivity;
Amith Yamasania4379d62011-07-22 10:34:58 -070051import android.preference.PreferenceFragment;
Gilles Debunnee78c1872011-06-20 15:00:07 -070052import android.text.TextUtils;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080053import android.util.Log;
Gilles Debunnee78c1872011-06-20 15:00:07 -070054import android.view.LayoutInflater;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080055import android.view.View;
56import android.view.View.OnClickListener;
Gilles Debunnee78c1872011-06-20 15:00:07 -070057import android.view.ViewGroup;
58import android.widget.ArrayAdapter;
Amith Yamasani9e3a4702011-01-11 09:09:26 -080059import android.widget.Button;
Gilles Debunnee78c1872011-06-20 15:00:07 -070060import android.widget.ImageView;
61import android.widget.ListAdapter;
62import android.widget.Switch;
63import android.widget.TextView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080064
Gilles Debunnee78c1872011-06-20 15:00:07 -070065import java.util.ArrayList;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070066import java.util.Collections;
67import java.util.Comparator;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070068import java.util.HashMap;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070069import java.util.List;
Amith Yamasanid7993472010-08-18 13:59:28 -070070
71/**
72 * Top-level settings activity to handle single pane and double pane UI layout.
73 */
Amith Yamasani56821db2012-06-05 13:20:45 -070074public class Settings extends PreferenceActivity
75 implements ButtonBarHandler, OnAccountsUpdateListener {
Amith Yamasanid7993472010-08-18 13:59:28 -070076
Gilles Debunnee78c1872011-06-20 15:00:07 -070077 private static final String LOG_TAG = "Settings";
Amith Yamasaniea7b28c2012-06-20 13:51:40 -070078
Amith Yamasani5203bdf2010-11-04 09:59:44 -070079 private static final String META_DATA_KEY_HEADER_ID =
Gilles Debunnee78c1872011-06-20 15:00:07 -070080 "com.android.settings.TOP_LEVEL_HEADER_ID";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070081 private static final String META_DATA_KEY_FRAGMENT_CLASS =
Gilles Debunnee78c1872011-06-20 15:00:07 -070082 "com.android.settings.FRAGMENT_CLASS";
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080083 private static final String META_DATA_KEY_PARENT_TITLE =
84 "com.android.settings.PARENT_FRAGMENT_TITLE";
85 private static final String META_DATA_KEY_PARENT_FRAGMENT_CLASS =
86 "com.android.settings.PARENT_FRAGMENT_CLASS";
87
Jeff Sharkey54d0af52011-08-11 18:26:57 -070088 private static final String EXTRA_CLEAR_UI_OPTIONS = "settings:remove_ui_options";
Jeff Sharkey9fab0da2011-07-09 17:52:31 -070089
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080090 private static final String SAVE_KEY_CURRENT_HEADER = "com.android.settings.CURRENT_HEADER";
91 private static final String SAVE_KEY_PARENT_HEADER = "com.android.settings.PARENT_HEADER";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070092
93 private String mFragmentClass;
94 private int mTopLevelHeaderId;
Amith Yamasani3965ae62010-11-15 14:45:19 -080095 private Header mFirstHeader;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080096 private Header mCurrentHeader;
97 private Header mParentHeader;
98 private boolean mInLocalHeaderSwitch;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070099
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700100 // Show only these settings for restricted users
101 private int[] SETTINGS_FOR_RESTRICTED = {
Amith Yamasani32630392012-08-10 19:31:39 -0700102 R.id.wireless_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700103 R.id.wifi_settings,
104 R.id.bluetooth_settings,
Jeff Sharkey38305fb2012-09-14 16:26:51 -0700105 R.id.data_usage_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700106 R.id.wireless_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700107 R.id.device_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700108 R.id.sound_settings,
109 R.id.display_settings,
Jeff Sharkey90c8b202012-08-30 15:20:10 -0700110 R.id.storage_settings,
Dianne Hackborn271c8b02012-08-20 17:24:39 -0700111 R.id.application_settings,
Dianne Hackborn52e56a22012-09-12 17:02:23 -0700112 R.id.battery_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700113 R.id.personal_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700114 R.id.location_settings,
Amith Yamasani3deeeb72012-04-05 14:44:48 -0700115 R.id.security_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700116 R.id.language_settings,
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700117 R.id.user_settings,
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700118 R.id.account_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700119 R.id.account_add,
120 R.id.system_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700121 R.id.date_time_settings,
Jeff Brown9e143f52012-09-19 20:46:07 -0700122 R.id.about_settings,
Svetoslav Ganov46045d82012-09-20 15:04:55 -0700123 R.id.accessibility_settings
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700124 };
125
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700126 private SharedPreferences mDevelopmentPreferences;
127 private SharedPreferences.OnSharedPreferenceChangeListener mDevelopmentPreferencesListener;
128
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700129 // TODO: Update Call Settings based on airplane mode state.
Amith Yamasanib61cf512010-09-12 08:17:50 -0700130
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700131 protected HashMap<Integer, Integer> mHeaderIndexMap = new HashMap<Integer, Integer>();
132
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700133 private AuthenticatorHelper mAuthenticatorHelper;
134 private Header mLastHeader;
Amith Yamasani86708a82012-06-06 20:23:08 -0700135 private boolean mListeningToAccountUpdates;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700136
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700137 @Override
138 protected void onCreate(Bundle savedInstanceState) {
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700139 if (getIntent().getBooleanExtra(EXTRA_CLEAR_UI_OPTIONS, false)) {
140 getWindow().setUiOptions(0);
141 }
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700142
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700143 mAuthenticatorHelper = new AuthenticatorHelper();
144 mAuthenticatorHelper.updateAuthDescriptions(this);
145 mAuthenticatorHelper.onAccountsUpdated(this, null);
146
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700147 mDevelopmentPreferences = getSharedPreferences(DevelopmentSettings.PREF_FILE,
148 Context.MODE_PRIVATE);
149
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700150 getMetaData();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800151 mInLocalHeaderSwitch = true;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700152 super.onCreate(savedInstanceState);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800153 mInLocalHeaderSwitch = false;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700154
Gilles Debunne3661b622011-06-27 11:19:16 -0700155 if (!onIsHidingHeaders() && onIsMultiPane()) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700156 highlightHeader(mTopLevelHeaderId);
Amith Yamasani72aa19d2010-12-09 06:07:12 -0800157 // Force the title so that it doesn't get overridden by a direct launch of
158 // a specific settings screen.
159 setTitle(R.string.settings_label);
160 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800161
162 // Retrieve any saved state
163 if (savedInstanceState != null) {
164 mCurrentHeader = savedInstanceState.getParcelable(SAVE_KEY_CURRENT_HEADER);
165 mParentHeader = savedInstanceState.getParcelable(SAVE_KEY_PARENT_HEADER);
166 }
167
168 // If the current header was saved, switch to it
169 if (savedInstanceState != null && mCurrentHeader != null) {
170 //switchToHeaderLocal(mCurrentHeader);
171 showBreadCrumbs(mCurrentHeader.title, null);
172 }
173
174 if (mParentHeader != null) {
175 setParentTitle(mParentHeader.title, null, new OnClickListener() {
176 public void onClick(View v) {
177 switchToParent(mParentHeader.fragment);
178 }
179 });
180 }
Gilles Debunnedc7101f2011-06-27 12:00:49 -0700181
Amith Yamasani3d384f42012-05-11 15:22:04 -0700182 // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
183 if (onIsMultiPane()) {
184 getActionBar().setDisplayHomeAsUpEnabled(false);
185 getActionBar().setHomeButtonEnabled(false);
186 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800187 }
188
189 @Override
190 protected void onSaveInstanceState(Bundle outState) {
191 super.onSaveInstanceState(outState);
192
193 // Save the current fragment, if it is the same as originally launched
194 if (mCurrentHeader != null) {
195 outState.putParcelable(SAVE_KEY_CURRENT_HEADER, mCurrentHeader);
196 }
197 if (mParentHeader != null) {
198 outState.putParcelable(SAVE_KEY_PARENT_HEADER, mParentHeader);
199 }
200 }
201
Gilles Debunnee78c1872011-06-20 15:00:07 -0700202 @Override
203 public void onResume() {
204 super.onResume();
205
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700206 mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
207 @Override
208 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
209 invalidateHeaders();
210 }
211 };
212 mDevelopmentPreferences.registerOnSharedPreferenceChangeListener(
213 mDevelopmentPreferencesListener);
214
Gilles Debunnee78c1872011-06-20 15:00:07 -0700215 ListAdapter listAdapter = getListAdapter();
216 if (listAdapter instanceof HeaderAdapter) {
217 ((HeaderAdapter) listAdapter).resume();
218 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700219 invalidateHeaders();
Gilles Debunnee78c1872011-06-20 15:00:07 -0700220 }
221
222 @Override
223 public void onPause() {
224 super.onPause();
225
226 ListAdapter listAdapter = getListAdapter();
227 if (listAdapter instanceof HeaderAdapter) {
228 ((HeaderAdapter) listAdapter).pause();
Amith Yamasani86708a82012-06-06 20:23:08 -0700229 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700230
231 mDevelopmentPreferences.unregisterOnSharedPreferenceChangeListener(
232 mDevelopmentPreferencesListener);
233 mDevelopmentPreferencesListener = null;
Amith Yamasani86708a82012-06-06 20:23:08 -0700234 }
235
236 @Override
237 public void onDestroy() {
238 super.onDestroy();
239 if (mListeningToAccountUpdates) {
Amith Yamasani56821db2012-06-05 13:20:45 -0700240 AccountManager.get(this).removeOnAccountsUpdatedListener(this);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700241 }
242 }
243
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800244 private void switchToHeaderLocal(Header header) {
245 mInLocalHeaderSwitch = true;
246 switchToHeader(header);
247 mInLocalHeaderSwitch = false;
248 }
249
250 @Override
251 public void switchToHeader(Header header) {
252 if (!mInLocalHeaderSwitch) {
253 mCurrentHeader = null;
254 mParentHeader = null;
255 }
256 super.switchToHeader(header);
257 }
258
259 /**
260 * Switch to parent fragment and store the grand parent's info
Jake Hamby2748fc22011-01-12 15:06:28 -0800261 * @param className name of the activity wrapper for the parent fragment.
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800262 */
263 private void switchToParent(String className) {
264 final ComponentName cn = new ComponentName(this, className);
265 try {
266 final PackageManager pm = getPackageManager();
267 final ActivityInfo parentInfo = pm.getActivityInfo(cn, PackageManager.GET_META_DATA);
268
269 if (parentInfo != null && parentInfo.metaData != null) {
270 String fragmentClass = parentInfo.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
271 CharSequence fragmentTitle = parentInfo.loadLabel(pm);
272 Header parentHeader = new Header();
273 parentHeader.fragment = fragmentClass;
274 parentHeader.title = fragmentTitle;
275 mCurrentHeader = parentHeader;
276
277 switchToHeaderLocal(parentHeader);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700278 highlightHeader(mTopLevelHeaderId);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800279
280 mParentHeader = new Header();
281 mParentHeader.fragment
282 = parentInfo.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
283 mParentHeader.title = parentInfo.metaData.getString(META_DATA_KEY_PARENT_TITLE);
284 }
285 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700286 Log.w(LOG_TAG, "Could not find parent activity : " + className);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800287 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700288 }
289
Amith Yamasani3965ae62010-11-15 14:45:19 -0800290 @Override
291 public void onNewIntent(Intent intent) {
292 super.onNewIntent(intent);
293
294 // If it is not launched from history, then reset to top-level
Amith Yamasanief617232012-10-09 16:57:25 -0700295 if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
296 if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
297 switchToHeaderLocal(mFirstHeader);
298 }
299 getListView().setSelectionFromTop(0, 0);
Amith Yamasani3965ae62010-11-15 14:45:19 -0800300 }
301 }
302
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700303 private void highlightHeader(int id) {
304 if (id != 0) {
305 Integer index = mHeaderIndexMap.get(id);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700306 if (index != null) {
307 getListView().setItemChecked(index, true);
Amith Yamasanief617232012-10-09 16:57:25 -0700308 if (isMultiPane()) {
309 getListView().smoothScrollToPosition(index);
310 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700311 }
312 }
313 }
314
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700315 @Override
316 public Intent getIntent() {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700317 Intent superIntent = super.getIntent();
318 String startingFragment = getStartingFragmentClass(superIntent);
Gilles Debunne3661b622011-06-27 11:19:16 -0700319 // This is called from super.onCreate, isMultiPane() is not yet reliable
320 // Do not use onIsHidingHeaders either, which relies itself on this method
321 if (startingFragment != null && !onIsMultiPane()) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700322 Intent modIntent = new Intent(superIntent);
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700323 modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700324 Bundle args = superIntent.getExtras();
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700325 if (args != null) {
326 args = new Bundle(args);
327 } else {
328 args = new Bundle();
329 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700330 args.putParcelable("intent", superIntent);
331 modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, superIntent.getExtras());
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700332 return modIntent;
333 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700334 return superIntent;
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700335 }
336
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700337 /**
Amith Yamasani379d9b02010-09-27 12:03:59 -0700338 * Checks if the component name in the intent is different from the Settings class and
339 * returns the class name to load as a fragment.
340 */
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700341 protected String getStartingFragmentClass(Intent intent) {
342 if (mFragmentClass != null) return mFragmentClass;
343
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700344 String intentClass = intent.getComponent().getClassName();
Amith Yamasani379d9b02010-09-27 12:03:59 -0700345 if (intentClass.equals(getClass().getName())) return null;
346
Dianne Hackbornee293792010-11-01 12:32:33 -0700347 if ("com.android.settings.ManageApplications".equals(intentClass)
348 || "com.android.settings.RunningServices".equals(intentClass)
349 || "com.android.settings.applications.StorageUse".equals(intentClass)) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700350 // Old names of manage apps.
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700351 intentClass = com.android.settings.applications.ManageApplications.class.getName();
352 }
353
Amith Yamasani379d9b02010-09-27 12:03:59 -0700354 return intentClass;
355 }
356
357 /**
358 * Override initial header when an activity-alias is causing Settings to be launched
359 * for a specific fragment encoded in the android:name parameter.
360 */
361 @Override
362 public Header onGetInitialHeader() {
363 String fragmentClass = getStartingFragmentClass(super.getIntent());
364 if (fragmentClass != null) {
365 Header header = new Header();
366 header.fragment = fragmentClass;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800367 header.title = getTitle();
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700368 header.fragmentArguments = getIntent().getExtras();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800369 mCurrentHeader = header;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700370 return header;
371 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700372
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700373 return mFirstHeader;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700374 }
375
Dianne Hackbornb7258182011-03-15 16:23:55 -0700376 @Override
Dianne Hackborn48147dc2011-03-18 12:29:41 -0700377 public Intent onBuildStartFragmentIntent(String fragmentName, Bundle args,
378 int titleRes, int shortTitleRes) {
379 Intent intent = super.onBuildStartFragmentIntent(fragmentName, args,
380 titleRes, shortTitleRes);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700381
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700382 // some fragments want to avoid split actionbar
Gilles Debunne162e5412011-07-11 14:13:31 -0700383 if (DataUsageSummary.class.getName().equals(fragmentName) ||
384 PowerUsageSummary.class.getName().equals(fragmentName) ||
Gilles Debunnecd8e5242011-07-25 11:36:15 -0700385 AccountSyncSettings.class.getName().equals(fragmentName) ||
Jeff Sharkey11d30122012-03-19 16:54:07 -0700386 UserDictionarySettings.class.getName().equals(fragmentName) ||
Adam Powellfaba7e42012-03-26 17:28:38 -0700387 Memory.class.getName().equals(fragmentName) ||
Jeff Sharkeya339cba2012-05-08 11:42:49 -0700388 ManageApplications.class.getName().equals(fragmentName) ||
389 WirelessSettings.class.getName().equals(fragmentName) ||
390 SoundSettings.class.getName().equals(fragmentName) ||
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700391 PrivacySettings.class.getName().equals(fragmentName) ||
Jeff Sharkey9fd7ac12012-08-25 00:06:08 -0700392 ManageAccountsSettings.class.getName().equals(fragmentName) ||
rich cannings93c0ee52012-09-30 13:54:26 -0700393 VpnSettings.class.getName().equals(fragmentName) ||
Adam Powell7474bc32012-09-30 18:21:14 -0700394 SecuritySettings.class.getName().equals(fragmentName) ||
Adam Powella5f67622012-10-13 01:20:28 -0700395 InstalledAppDetails.class.getName().equals(fragmentName) ||
Jeff Sharkeyc2b43db2012-11-28 17:09:19 -0800396 ChooseLockGenericFragment.class.getName().equals(fragmentName) ||
397 TetherSettings.class.getName().equals(fragmentName) ||
398 ApnSettings.class.getName().equals(fragmentName) ||
399 LocationSettings.class.getName().equals(fragmentName) ||
400 ZonePicker.class.getName().equals(fragmentName)) {
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700401 intent.putExtra(EXTRA_CLEAR_UI_OPTIONS, true);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700402 }
403
Dianne Hackbornb7258182011-03-15 16:23:55 -0700404 intent.setClass(this, SubSettings.class);
405 return intent;
406 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700407
Amith Yamasani379d9b02010-09-27 12:03:59 -0700408 /**
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700409 * Populate the activity with the top-level headers.
410 */
Amith Yamasanid7993472010-08-18 13:59:28 -0700411 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700412 public void onBuildHeaders(List<Header> headers) {
413 loadHeadersFromResource(R.xml.settings_headers, headers);
Amith Yamasanid7993472010-08-18 13:59:28 -0700414
Gilles Debunnee78c1872011-06-20 15:00:07 -0700415 updateHeaderList(headers);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700416 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700417
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700418 private void updateHeaderList(List<Header> target) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700419 final boolean showDev = mDevelopmentPreferences.getBoolean(
420 DevelopmentSettings.PREF_SHOW,
421 android.os.Build.TYPE.equals("eng"));
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700422 int i = 0;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700423
424 mHeaderIndexMap.clear();
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700425 while (i < target.size()) {
426 Header header = target.get(i);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700427 // Ids are integers, so downcasting
428 int id = (int) header.id;
Chris Wren2bc32ae2012-09-24 14:23:46 -0400429 if (id == R.id.operator_settings || id == R.id.manufacturer_settings) {
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700430 Utils.updateHeaderToSpecificActivityFromMetaDataOrRemove(this, target, header);
Gilles Debunne2454f492011-06-21 16:16:06 -0700431 } else if (id == R.id.wifi_settings) {
432 // Remove WiFi Settings if WiFi service is not available.
433 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700434 target.remove(i);
Gilles Debunne2454f492011-06-21 16:16:06 -0700435 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700436 } else if (id == R.id.bluetooth_settings) {
437 // Remove Bluetooth Settings if Bluetooth service is not available.
Gilles Debunne2454f492011-06-21 16:16:06 -0700438 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700439 target.remove(i);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700440 }
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700441 } else if (id == R.id.data_usage_settings) {
442 // Remove data usage when kernel module not enabled
443 final INetworkManagementService netManager = INetworkManagementService.Stub
444 .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
445 try {
446 if (!netManager.isBandwidthControlEnabled()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700447 target.remove(i);
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700448 }
449 } catch (RemoteException e) {
450 // ignored
451 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700452 } else if (id == R.id.account_settings) {
453 int headerIndex = i + 1;
454 i = insertAccountsHeaders(target, headerIndex);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700455 } else if (id == R.id.user_settings) {
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700456 if (!UserHandle.MU_ENABLED
Jeff Sharkey44202462012-09-19 13:13:45 -0700457 || !UserManager.supportsMultipleUsers()
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700458 || Utils.isMonkeyRunning()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700459 target.remove(i);
460 }
461 } else if (id == R.id.development_settings) {
462 if (!showDev) {
463 target.remove(i);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700464 }
465 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700466
Amith Yamasanib99f8642012-10-10 21:41:12 -0700467 if (target.get(i) == header
468 && UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700469 && !ArrayUtils.contains(SETTINGS_FOR_RESTRICTED, id)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700470 target.remove(i);
Amith Yamasanid7993472010-08-18 13:59:28 -0700471 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700472
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700473 // Increment if the current one wasn't removed by the Utils code.
474 if (target.get(i) == header) {
Amith Yamasani3965ae62010-11-15 14:45:19 -0800475 // Hold on to the first header, when we need to reset to the top-level
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700476 if (mFirstHeader == null &&
477 HeaderAdapter.getHeaderType(header) != HeaderAdapter.HEADER_TYPE_CATEGORY) {
478 mFirstHeader = header;
479 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700480 mHeaderIndexMap.put(id, i);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700481 i++;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700482 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700483 }
484 }
485
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700486 private int insertAccountsHeaders(List<Header> target, int headerIndex) {
487 String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
488 List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length);
489 for (String accountType : accountTypes) {
490 CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType);
Brian Muramatsuc28af522012-06-28 14:25:14 -0700491 if (label == null) {
492 continue;
493 }
494
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700495 Account[] accounts = AccountManager.get(this).getAccountsByType(accountType);
496 boolean skipToAccount = accounts.length == 1
497 && !mAuthenticatorHelper.hasAccountPreferences(accountType);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700498 Header accHeader = new Header();
499 accHeader.title = label;
500 if (accHeader.extras == null) {
501 accHeader.extras = new Bundle();
502 }
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700503 if (skipToAccount) {
504 accHeader.breadCrumbTitleRes = R.string.account_sync_settings_title;
505 accHeader.breadCrumbShortTitleRes = R.string.account_sync_settings_title;
506 accHeader.fragment = AccountSyncSettings.class.getName();
507 accHeader.fragmentArguments = new Bundle();
508 // Need this for the icon
509 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
510 accHeader.extras.putParcelable(AccountSyncSettings.ACCOUNT_KEY, accounts[0]);
511 accHeader.fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
512 accounts[0]);
513 } else {
514 accHeader.breadCrumbTitle = label;
515 accHeader.breadCrumbShortTitle = label;
516 accHeader.fragment = ManageAccountsSettings.class.getName();
517 accHeader.fragmentArguments = new Bundle();
518 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
519 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE,
520 accountType);
521 if (!isMultiPane()) {
522 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
523 label.toString());
524 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700525 }
526 accountHeaders.add(accHeader);
527 }
528
529 // Sort by label
530 Collections.sort(accountHeaders, new Comparator<Header>() {
531 @Override
532 public int compare(Header h1, Header h2) {
533 return h1.title.toString().compareTo(h2.title.toString());
534 }
535 });
536
537 for (Header header : accountHeaders) {
538 target.add(headerIndex++, header);
539 }
Amith Yamasani86708a82012-06-06 20:23:08 -0700540 if (!mListeningToAccountUpdates) {
541 AccountManager.get(this).addOnAccountsUpdatedListener(this, null, true);
542 mListeningToAccountUpdates = true;
543 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700544 return headerIndex;
545 }
546
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700547 private void getMetaData() {
548 try {
549 ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
550 PackageManager.GET_META_DATA);
551 if (ai == null || ai.metaData == null) return;
552 mTopLevelHeaderId = ai.metaData.getInt(META_DATA_KEY_HEADER_ID);
553 mFragmentClass = ai.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700554
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800555 // Check if it has a parent specified and create a Header object
556 final int parentHeaderTitleRes = ai.metaData.getInt(META_DATA_KEY_PARENT_TITLE);
557 String parentFragmentClass = ai.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
558 if (parentFragmentClass != null) {
559 mParentHeader = new Header();
560 mParentHeader.fragment = parentFragmentClass;
561 if (parentHeaderTitleRes != 0) {
562 mParentHeader.title = getResources().getString(parentHeaderTitleRes);
563 }
564 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700565 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700566 // No recovery
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700567 }
568 }
569
Amith Yamasani9e3a4702011-01-11 09:09:26 -0800570 @Override
571 public boolean hasNextButton() {
572 return super.hasNextButton();
573 }
574
575 @Override
576 public Button getNextButton() {
577 return super.getNextButton();
578 }
579
Gilles Debunnee78c1872011-06-20 15:00:07 -0700580 private static class HeaderAdapter extends ArrayAdapter<Header> {
581 static final int HEADER_TYPE_CATEGORY = 0;
582 static final int HEADER_TYPE_NORMAL = 1;
583 static final int HEADER_TYPE_SWITCH = 2;
584 private static final int HEADER_TYPE_COUNT = HEADER_TYPE_SWITCH + 1;
585
586 private final WifiEnabler mWifiEnabler;
587 private final BluetoothEnabler mBluetoothEnabler;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700588 private AuthenticatorHelper mAuthHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700589
590 private static class HeaderViewHolder {
591 ImageView icon;
592 TextView title;
593 TextView summary;
594 Switch switch_;
595 }
596
597 private LayoutInflater mInflater;
598
599 static int getHeaderType(Header header) {
600 if (header.fragment == null && header.intent == null) {
601 return HEADER_TYPE_CATEGORY;
602 } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
603 return HEADER_TYPE_SWITCH;
604 } else {
605 return HEADER_TYPE_NORMAL;
606 }
607 }
608
609 @Override
610 public int getItemViewType(int position) {
611 Header header = getItem(position);
612 return getHeaderType(header);
613 }
614
615 @Override
616 public boolean areAllItemsEnabled() {
617 return false; // because of categories
618 }
619
620 @Override
621 public boolean isEnabled(int position) {
622 return getItemViewType(position) != HEADER_TYPE_CATEGORY;
623 }
624
625 @Override
626 public int getViewTypeCount() {
627 return HEADER_TYPE_COUNT;
628 }
629
630 @Override
631 public boolean hasStableIds() {
632 return true;
633 }
634
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700635 public HeaderAdapter(Context context, List<Header> objects,
636 AuthenticatorHelper authenticatorHelper) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700637 super(context, 0, objects);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700638
639 mAuthHelper = authenticatorHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700640 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700641
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700642 // Temp Switches provided as placeholder until the adapter replaces these with actual
Gilles Debunnee78c1872011-06-20 15:00:07 -0700643 // Switches inflated from their layouts. Must be done before adapter is set in super
644 mWifiEnabler = new WifiEnabler(context, new Switch(context));
645 mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
646 }
647
648 @Override
649 public View getView(int position, View convertView, ViewGroup parent) {
650 HeaderViewHolder holder;
651 Header header = getItem(position);
652 int headerType = getHeaderType(header);
653 View view = null;
654
655 if (convertView == null) {
656 holder = new HeaderViewHolder();
657 switch (headerType) {
658 case HEADER_TYPE_CATEGORY:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700659 view = new TextView(getContext(), null,
660 android.R.attr.listSeparatorTextViewStyle);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700661 holder.title = (TextView) view;
662 break;
663
664 case HEADER_TYPE_SWITCH:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700665 view = mInflater.inflate(R.layout.preference_header_switch_item, parent,
666 false);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700667 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700668 holder.title = (TextView)
669 view.findViewById(com.android.internal.R.id.title);
670 holder.summary = (TextView)
671 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700672 holder.switch_ = (Switch) view.findViewById(R.id.switchWidget);
673 break;
674
675 case HEADER_TYPE_NORMAL:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700676 view = mInflater.inflate(
Amith Yamasanic8a93172012-06-08 13:35:47 -0700677 R.layout.preference_header_item, parent,
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700678 false);
Amith Yamasanic8a93172012-06-08 13:35:47 -0700679 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700680 holder.title = (TextView)
681 view.findViewById(com.android.internal.R.id.title);
682 holder.summary = (TextView)
683 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700684 break;
685 }
686 view.setTag(holder);
687 } else {
688 view = convertView;
689 holder = (HeaderViewHolder) view.getTag();
690 }
691
692 // All view fields must be updated every time, because the view may be recycled
693 switch (headerType) {
694 case HEADER_TYPE_CATEGORY:
695 holder.title.setText(header.getTitle(getContext().getResources()));
696 break;
697
698 case HEADER_TYPE_SWITCH:
699 // Would need a different treatment if the main menu had more switches
700 if (header.id == R.id.wifi_settings) {
701 mWifiEnabler.setSwitch(holder.switch_);
702 } else {
703 mBluetoothEnabler.setSwitch(holder.switch_);
704 }
705 // No break, fall through on purpose to update common fields
706
707 //$FALL-THROUGH$
708 case HEADER_TYPE_NORMAL:
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700709 if (header.extras != null
710 && header.extras.containsKey(ManageAccountsSettings.KEY_ACCOUNT_TYPE)) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700711 String accType = header.extras.getString(
712 ManageAccountsSettings.KEY_ACCOUNT_TYPE);
713 ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
714 lp.width = getContext().getResources().getDimensionPixelSize(
715 R.dimen.header_icon_width);
716 lp.height = lp.width;
717 holder.icon.setLayoutParams(lp);
718 Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
719 holder.icon.setImageDrawable(icon);
720 } else {
721 holder.icon.setImageResource(header.iconRes);
722 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700723 holder.title.setText(header.getTitle(getContext().getResources()));
724 CharSequence summary = header.getSummary(getContext().getResources());
725 if (!TextUtils.isEmpty(summary)) {
726 holder.summary.setVisibility(View.VISIBLE);
727 holder.summary.setText(summary);
728 } else {
729 holder.summary.setVisibility(View.GONE);
730 }
731 break;
732 }
733
734 return view;
735 }
736
737 public void resume() {
738 mWifiEnabler.resume();
739 mBluetoothEnabler.resume();
740 }
Brian Muramatsuc28af522012-06-28 14:25:14 -0700741
Gilles Debunnee78c1872011-06-20 15:00:07 -0700742 public void pause() {
743 mWifiEnabler.pause();
744 mBluetoothEnabler.pause();
745 }
746 }
747
748 @Override
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700749 public void onHeaderClick(Header header, int position) {
750 boolean revert = false;
751 if (header.id == R.id.account_add) {
752 revert = true;
753 }
754
755 super.onHeaderClick(header, position);
756
757 if (revert && mLastHeader != null) {
758 highlightHeader((int) mLastHeader.id);
759 } else {
760 mLastHeader = header;
761 }
762 }
763
764 @Override
Amith Yamasania4379d62011-07-22 10:34:58 -0700765 public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
766 // Override the fragment title for Wallpaper settings
Amith Yamasanidfb65432011-11-29 16:38:14 -0800767 int titleRes = pref.getTitleRes();
Amith Yamasania4379d62011-07-22 10:34:58 -0700768 if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
Amith Yamasanidfb65432011-11-29 16:38:14 -0800769 titleRes = R.string.wallpaper_settings_fragment_title;
Amith Yamasani8666b9e2012-09-27 14:50:13 -0700770 } else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
771 && UserHandle.myUserId() != UserHandle.USER_OWNER) {
772 titleRes = R.string.user_info_settings_title;
Amith Yamasania4379d62011-07-22 10:34:58 -0700773 }
Jean Chalard7dabe452012-05-10 18:08:07 +0900774 startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
775 null, 0);
Amith Yamasania4379d62011-07-22 10:34:58 -0700776 return true;
777 }
778
Amith Yamasani3d384f42012-05-11 15:22:04 -0700779 public boolean shouldUpRecreateTask(Intent targetIntent) {
780 return super.shouldUpRecreateTask(new Intent(this, Settings.class));
781 }
782
Amith Yamasania4379d62011-07-22 10:34:58 -0700783 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700784 public void setListAdapter(ListAdapter adapter) {
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700785 if (adapter == null) {
786 super.setListAdapter(null);
787 } else {
788 super.setListAdapter(new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper));
Gilles Debunnee78c1872011-06-20 15:00:07 -0700789 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700790 }
791
Amith Yamasani56821db2012-06-05 13:20:45 -0700792 @Override
793 public void onAccountsUpdated(Account[] accounts) {
Jeff Sharkey9ff79c12012-10-03 16:48:17 -0700794 // TODO: watch for package upgrades to invalidate cache; see 7206643
795 mAuthenticatorHelper.updateAuthDescriptions(this);
Amith Yamasani56821db2012-06-05 13:20:45 -0700796 mAuthenticatorHelper.onAccountsUpdated(this, accounts);
797 invalidateHeaders();
798 }
799
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700800 /*
801 * Settings subclasses for launching independently.
802 */
Gilles Debunnee78c1872011-06-20 15:00:07 -0700803 public static class BluetoothSettingsActivity extends Settings { /* empty */ }
804 public static class WirelessSettingsActivity extends Settings { /* empty */ }
805 public static class TetherSettingsActivity extends Settings { /* empty */ }
806 public static class VpnSettingsActivity extends Settings { /* empty */ }
807 public static class DateTimeSettingsActivity extends Settings { /* empty */ }
808 public static class StorageSettingsActivity extends Settings { /* empty */ }
809 public static class WifiSettingsActivity extends Settings { /* empty */ }
repo syncb98463f2011-06-30 10:58:43 -0700810 public static class WifiP2pSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700811 public static class InputMethodAndLanguageSettingsActivity extends Settings { /* empty */ }
Jeff Browne46c5f32012-04-05 11:42:18 -0700812 public static class KeyboardLayoutPickerActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700813 public static class InputMethodAndSubtypeEnablerActivity extends Settings { /* empty */ }
satoke077d2b2011-07-25 09:38:11 +0900814 public static class SpellCheckersSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700815 public static class LocalePickerActivity extends Settings { /* empty */ }
816 public static class UserDictionarySettingsActivity extends Settings { /* empty */ }
817 public static class SoundSettingsActivity extends Settings { /* empty */ }
818 public static class DisplaySettingsActivity extends Settings { /* empty */ }
819 public static class DeviceInfoSettingsActivity extends Settings { /* empty */ }
820 public static class ApplicationSettingsActivity extends Settings { /* empty */ }
821 public static class ManageApplicationsActivity extends Settings { /* empty */ }
822 public static class StorageUseActivity extends Settings { /* empty */ }
823 public static class DevelopmentSettingsActivity extends Settings { /* empty */ }
824 public static class AccessibilitySettingsActivity extends Settings { /* empty */ }
825 public static class SecuritySettingsActivity extends Settings { /* empty */ }
Gilles Debunnea6a8a142011-06-09 11:56:17 -0700826 public static class LocationSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700827 public static class PrivacySettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700828 public static class RunningServicesActivity extends Settings { /* empty */ }
829 public static class ManageAccountsSettingsActivity extends Settings { /* empty */ }
830 public static class PowerUsageSummaryActivity extends Settings { /* empty */ }
831 public static class AccountSyncSettingsActivity extends Settings { /* empty */ }
832 public static class AccountSyncSettingsInAddAccountActivity extends Settings { /* empty */ }
833 public static class CryptKeeperSettingsActivity extends Settings { /* empty */ }
834 public static class DeviceAdminSettingsActivity extends Settings { /* empty */ }
835 public static class DataUsageSummaryActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700836 public static class AdvancedWifiSettingsActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700837 public static class TextToSpeechSettingsActivity extends Settings { /* empty */ }
Jeff Hamilton3d670de2011-09-21 16:44:36 -0500838 public static class AndroidBeamSettingsActivity extends Settings { /* empty */ }
Jeff Brown9e143f52012-09-19 20:46:07 -0700839 public static class WifiDisplaySettingsActivity extends Settings { /* empty */ }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800840}