blob: 02769e10f8795f10de0993322a79eb148caae0a6 [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;
Jeff Sharkey0c3634c2013-02-20 12:35:16 -080060import com.android.settings.wfd.WifiDisplaySettings;
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080061import com.android.settings.wifi.WifiEnabler;
62import com.android.settings.wifi.WifiSettings;
63import com.android.settings.wifi.p2p.WifiP2pSettings;
64
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 Sharkeycc0d26b2012-11-27 16:42:27 -080088 private static final String EXTRA_UI_OPTIONS = "settings: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 Sharkeycc0d26b2012-11-27 16:42:27 -0800139 if (getIntent().hasExtra(EXTRA_UI_OPTIONS)) {
140 getWindow().setUiOptions(getIntent().getIntExtra(EXTRA_UI_OPTIONS, 0));
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700141 }
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() {
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400176 @Override
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800177 public void onClick(View v) {
178 switchToParent(mParentHeader.fragment);
179 }
180 });
181 }
Gilles Debunnedc7101f2011-06-27 12:00:49 -0700182
Amith Yamasani3d384f42012-05-11 15:22:04 -0700183 // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
184 if (onIsMultiPane()) {
185 getActionBar().setDisplayHomeAsUpEnabled(false);
186 getActionBar().setHomeButtonEnabled(false);
187 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800188 }
189
190 @Override
191 protected void onSaveInstanceState(Bundle outState) {
192 super.onSaveInstanceState(outState);
193
194 // Save the current fragment, if it is the same as originally launched
195 if (mCurrentHeader != null) {
196 outState.putParcelable(SAVE_KEY_CURRENT_HEADER, mCurrentHeader);
197 }
198 if (mParentHeader != null) {
199 outState.putParcelable(SAVE_KEY_PARENT_HEADER, mParentHeader);
200 }
201 }
202
Gilles Debunnee78c1872011-06-20 15:00:07 -0700203 @Override
204 public void onResume() {
205 super.onResume();
206
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700207 mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
208 @Override
209 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
210 invalidateHeaders();
211 }
212 };
213 mDevelopmentPreferences.registerOnSharedPreferenceChangeListener(
214 mDevelopmentPreferencesListener);
215
Gilles Debunnee78c1872011-06-20 15:00:07 -0700216 ListAdapter listAdapter = getListAdapter();
217 if (listAdapter instanceof HeaderAdapter) {
218 ((HeaderAdapter) listAdapter).resume();
219 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700220 invalidateHeaders();
Gilles Debunnee78c1872011-06-20 15:00:07 -0700221 }
222
223 @Override
224 public void onPause() {
225 super.onPause();
226
227 ListAdapter listAdapter = getListAdapter();
228 if (listAdapter instanceof HeaderAdapter) {
229 ((HeaderAdapter) listAdapter).pause();
Amith Yamasani86708a82012-06-06 20:23:08 -0700230 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700231
232 mDevelopmentPreferences.unregisterOnSharedPreferenceChangeListener(
233 mDevelopmentPreferencesListener);
234 mDevelopmentPreferencesListener = null;
Amith Yamasani86708a82012-06-06 20:23:08 -0700235 }
236
237 @Override
238 public void onDestroy() {
239 super.onDestroy();
240 if (mListeningToAccountUpdates) {
Amith Yamasani56821db2012-06-05 13:20:45 -0700241 AccountManager.get(this).removeOnAccountsUpdatedListener(this);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700242 }
243 }
244
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800245 private void switchToHeaderLocal(Header header) {
246 mInLocalHeaderSwitch = true;
247 switchToHeader(header);
248 mInLocalHeaderSwitch = false;
249 }
250
251 @Override
252 public void switchToHeader(Header header) {
253 if (!mInLocalHeaderSwitch) {
254 mCurrentHeader = null;
255 mParentHeader = null;
256 }
257 super.switchToHeader(header);
258 }
259
260 /**
261 * Switch to parent fragment and store the grand parent's info
Jake Hamby2748fc22011-01-12 15:06:28 -0800262 * @param className name of the activity wrapper for the parent fragment.
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800263 */
264 private void switchToParent(String className) {
265 final ComponentName cn = new ComponentName(this, className);
266 try {
267 final PackageManager pm = getPackageManager();
268 final ActivityInfo parentInfo = pm.getActivityInfo(cn, PackageManager.GET_META_DATA);
269
270 if (parentInfo != null && parentInfo.metaData != null) {
271 String fragmentClass = parentInfo.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
272 CharSequence fragmentTitle = parentInfo.loadLabel(pm);
273 Header parentHeader = new Header();
274 parentHeader.fragment = fragmentClass;
275 parentHeader.title = fragmentTitle;
276 mCurrentHeader = parentHeader;
277
278 switchToHeaderLocal(parentHeader);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700279 highlightHeader(mTopLevelHeaderId);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800280
281 mParentHeader = new Header();
282 mParentHeader.fragment
283 = parentInfo.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
284 mParentHeader.title = parentInfo.metaData.getString(META_DATA_KEY_PARENT_TITLE);
285 }
286 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700287 Log.w(LOG_TAG, "Could not find parent activity : " + className);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800288 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700289 }
290
Amith Yamasani3965ae62010-11-15 14:45:19 -0800291 @Override
292 public void onNewIntent(Intent intent) {
293 super.onNewIntent(intent);
294
295 // If it is not launched from history, then reset to top-level
Amith Yamasanief617232012-10-09 16:57:25 -0700296 if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
297 if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
298 switchToHeaderLocal(mFirstHeader);
299 }
300 getListView().setSelectionFromTop(0, 0);
Amith Yamasani3965ae62010-11-15 14:45:19 -0800301 }
302 }
303
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700304 private void highlightHeader(int id) {
305 if (id != 0) {
306 Integer index = mHeaderIndexMap.get(id);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700307 if (index != null) {
308 getListView().setItemChecked(index, true);
Amith Yamasanief617232012-10-09 16:57:25 -0700309 if (isMultiPane()) {
310 getListView().smoothScrollToPosition(index);
311 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700312 }
313 }
314 }
315
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700316 @Override
317 public Intent getIntent() {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700318 Intent superIntent = super.getIntent();
319 String startingFragment = getStartingFragmentClass(superIntent);
Gilles Debunne3661b622011-06-27 11:19:16 -0700320 // This is called from super.onCreate, isMultiPane() is not yet reliable
321 // Do not use onIsHidingHeaders either, which relies itself on this method
322 if (startingFragment != null && !onIsMultiPane()) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700323 Intent modIntent = new Intent(superIntent);
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700324 modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700325 Bundle args = superIntent.getExtras();
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700326 if (args != null) {
327 args = new Bundle(args);
328 } else {
329 args = new Bundle();
330 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700331 args.putParcelable("intent", superIntent);
332 modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, superIntent.getExtras());
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700333 return modIntent;
334 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700335 return superIntent;
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700336 }
337
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700338 /**
Amith Yamasani379d9b02010-09-27 12:03:59 -0700339 * Checks if the component name in the intent is different from the Settings class and
340 * returns the class name to load as a fragment.
341 */
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700342 protected String getStartingFragmentClass(Intent intent) {
343 if (mFragmentClass != null) return mFragmentClass;
344
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700345 String intentClass = intent.getComponent().getClassName();
Amith Yamasani379d9b02010-09-27 12:03:59 -0700346 if (intentClass.equals(getClass().getName())) return null;
347
Dianne Hackbornee293792010-11-01 12:32:33 -0700348 if ("com.android.settings.ManageApplications".equals(intentClass)
349 || "com.android.settings.RunningServices".equals(intentClass)
350 || "com.android.settings.applications.StorageUse".equals(intentClass)) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700351 // Old names of manage apps.
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700352 intentClass = com.android.settings.applications.ManageApplications.class.getName();
353 }
354
Amith Yamasani379d9b02010-09-27 12:03:59 -0700355 return intentClass;
356 }
357
358 /**
359 * Override initial header when an activity-alias is causing Settings to be launched
360 * for a specific fragment encoded in the android:name parameter.
361 */
362 @Override
363 public Header onGetInitialHeader() {
364 String fragmentClass = getStartingFragmentClass(super.getIntent());
365 if (fragmentClass != null) {
366 Header header = new Header();
367 header.fragment = fragmentClass;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800368 header.title = getTitle();
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700369 header.fragmentArguments = getIntent().getExtras();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800370 mCurrentHeader = header;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700371 return header;
372 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700373
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700374 return mFirstHeader;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700375 }
376
Dianne Hackbornb7258182011-03-15 16:23:55 -0700377 @Override
Dianne Hackborn48147dc2011-03-18 12:29:41 -0700378 public Intent onBuildStartFragmentIntent(String fragmentName, Bundle args,
379 int titleRes, int shortTitleRes) {
380 Intent intent = super.onBuildStartFragmentIntent(fragmentName, args,
381 titleRes, shortTitleRes);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700382
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800383 // Some fragments want split ActionBar; these should stay in sync with
384 // uiOptions for fragments also defined as activities in manifest.
385 if (WifiSettings.class.getName().equals(fragmentName) ||
386 WifiP2pSettings.class.getName().equals(fragmentName) ||
Jeff Sharkey0c3634c2013-02-20 12:35:16 -0800387 WifiDisplaySettings.class.getName().equals(fragmentName) ||
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800388 BluetoothSettings.class.getName().equals(fragmentName) ||
389 DreamSettings.class.getName().equals(fragmentName) ||
390 ToggleAccessibilityServicePreferenceFragment.class.getName().equals(fragmentName)) {
391 intent.putExtra(EXTRA_UI_OPTIONS, ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700392 }
393
Dianne Hackbornb7258182011-03-15 16:23:55 -0700394 intent.setClass(this, SubSettings.class);
395 return intent;
396 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700397
Amith Yamasani379d9b02010-09-27 12:03:59 -0700398 /**
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700399 * Populate the activity with the top-level headers.
400 */
Amith Yamasanid7993472010-08-18 13:59:28 -0700401 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700402 public void onBuildHeaders(List<Header> headers) {
403 loadHeadersFromResource(R.xml.settings_headers, headers);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700404 updateHeaderList(headers);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700405 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700406
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700407 private void updateHeaderList(List<Header> target) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700408 final boolean showDev = mDevelopmentPreferences.getBoolean(
409 DevelopmentSettings.PREF_SHOW,
410 android.os.Build.TYPE.equals("eng"));
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700411 int i = 0;
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400412
413 final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700414 mHeaderIndexMap.clear();
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700415 while (i < target.size()) {
416 Header header = target.get(i);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700417 // Ids are integers, so downcasting
418 int id = (int) header.id;
Chris Wren2bc32ae2012-09-24 14:23:46 -0400419 if (id == R.id.operator_settings || id == R.id.manufacturer_settings) {
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700420 Utils.updateHeaderToSpecificActivityFromMetaDataOrRemove(this, target, header);
Gilles Debunne2454f492011-06-21 16:16:06 -0700421 } else if (id == R.id.wifi_settings) {
422 // Remove WiFi Settings if WiFi service is not available.
423 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700424 target.remove(i);
Gilles Debunne2454f492011-06-21 16:16:06 -0700425 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700426 } else if (id == R.id.bluetooth_settings) {
427 // Remove Bluetooth Settings if Bluetooth service is not available.
Gilles Debunne2454f492011-06-21 16:16:06 -0700428 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700429 target.remove(i);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700430 }
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700431 } else if (id == R.id.data_usage_settings) {
432 // Remove data usage when kernel module not enabled
433 final INetworkManagementService netManager = INetworkManagementService.Stub
434 .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
435 try {
436 if (!netManager.isBandwidthControlEnabled()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700437 target.remove(i);
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700438 }
439 } catch (RemoteException e) {
440 // ignored
441 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700442 } else if (id == R.id.account_settings) {
443 int headerIndex = i + 1;
444 i = insertAccountsHeaders(target, headerIndex);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700445 } else if (id == R.id.user_settings) {
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700446 if (!UserHandle.MU_ENABLED
Jeff Sharkey44202462012-09-19 13:13:45 -0700447 || !UserManager.supportsMultipleUsers()
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700448 || Utils.isMonkeyRunning()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700449 target.remove(i);
450 }
451 } else if (id == R.id.development_settings) {
452 if (!showDev) {
453 target.remove(i);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700454 }
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400455 } else if (id == R.id.account_add) {
456 if (um.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS)) {
457 target.remove(i);
458 }
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700459 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700460
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900461 if (i < target.size() && target.get(i) == header
Amith Yamasanib99f8642012-10-10 21:41:12 -0700462 && UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700463 && !ArrayUtils.contains(SETTINGS_FOR_RESTRICTED, id)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700464 target.remove(i);
Amith Yamasanid7993472010-08-18 13:59:28 -0700465 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700466
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700467 // Increment if the current one wasn't removed by the Utils code.
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900468 if (i < target.size() && target.get(i) == header) {
Amith Yamasani3965ae62010-11-15 14:45:19 -0800469 // Hold on to the first header, when we need to reset to the top-level
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700470 if (mFirstHeader == null &&
471 HeaderAdapter.getHeaderType(header) != HeaderAdapter.HEADER_TYPE_CATEGORY) {
472 mFirstHeader = header;
473 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700474 mHeaderIndexMap.put(id, i);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700475 i++;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700476 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700477 }
478 }
479
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700480 private int insertAccountsHeaders(List<Header> target, int headerIndex) {
481 String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
482 List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length);
483 for (String accountType : accountTypes) {
484 CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType);
Brian Muramatsuc28af522012-06-28 14:25:14 -0700485 if (label == null) {
486 continue;
487 }
488
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700489 Account[] accounts = AccountManager.get(this).getAccountsByType(accountType);
490 boolean skipToAccount = accounts.length == 1
491 && !mAuthenticatorHelper.hasAccountPreferences(accountType);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700492 Header accHeader = new Header();
493 accHeader.title = label;
494 if (accHeader.extras == null) {
495 accHeader.extras = new Bundle();
496 }
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700497 if (skipToAccount) {
498 accHeader.breadCrumbTitleRes = R.string.account_sync_settings_title;
499 accHeader.breadCrumbShortTitleRes = R.string.account_sync_settings_title;
500 accHeader.fragment = AccountSyncSettings.class.getName();
501 accHeader.fragmentArguments = new Bundle();
502 // Need this for the icon
503 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
504 accHeader.extras.putParcelable(AccountSyncSettings.ACCOUNT_KEY, accounts[0]);
505 accHeader.fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
506 accounts[0]);
507 } else {
508 accHeader.breadCrumbTitle = label;
509 accHeader.breadCrumbShortTitle = label;
510 accHeader.fragment = ManageAccountsSettings.class.getName();
511 accHeader.fragmentArguments = new Bundle();
512 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
513 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE,
514 accountType);
515 if (!isMultiPane()) {
516 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
517 label.toString());
518 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700519 }
520 accountHeaders.add(accHeader);
521 }
522
523 // Sort by label
524 Collections.sort(accountHeaders, new Comparator<Header>() {
525 @Override
526 public int compare(Header h1, Header h2) {
527 return h1.title.toString().compareTo(h2.title.toString());
528 }
529 });
530
531 for (Header header : accountHeaders) {
532 target.add(headerIndex++, header);
533 }
Amith Yamasani86708a82012-06-06 20:23:08 -0700534 if (!mListeningToAccountUpdates) {
535 AccountManager.get(this).addOnAccountsUpdatedListener(this, null, true);
536 mListeningToAccountUpdates = true;
537 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700538 return headerIndex;
539 }
540
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700541 private void getMetaData() {
542 try {
543 ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
544 PackageManager.GET_META_DATA);
545 if (ai == null || ai.metaData == null) return;
546 mTopLevelHeaderId = ai.metaData.getInt(META_DATA_KEY_HEADER_ID);
547 mFragmentClass = ai.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700548
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800549 // Check if it has a parent specified and create a Header object
550 final int parentHeaderTitleRes = ai.metaData.getInt(META_DATA_KEY_PARENT_TITLE);
551 String parentFragmentClass = ai.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
552 if (parentFragmentClass != null) {
553 mParentHeader = new Header();
554 mParentHeader.fragment = parentFragmentClass;
555 if (parentHeaderTitleRes != 0) {
556 mParentHeader.title = getResources().getString(parentHeaderTitleRes);
557 }
558 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700559 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700560 // No recovery
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700561 }
562 }
563
Amith Yamasani9e3a4702011-01-11 09:09:26 -0800564 @Override
565 public boolean hasNextButton() {
566 return super.hasNextButton();
567 }
568
569 @Override
570 public Button getNextButton() {
571 return super.getNextButton();
572 }
573
Gilles Debunnee78c1872011-06-20 15:00:07 -0700574 private static class HeaderAdapter extends ArrayAdapter<Header> {
575 static final int HEADER_TYPE_CATEGORY = 0;
576 static final int HEADER_TYPE_NORMAL = 1;
577 static final int HEADER_TYPE_SWITCH = 2;
578 private static final int HEADER_TYPE_COUNT = HEADER_TYPE_SWITCH + 1;
579
580 private final WifiEnabler mWifiEnabler;
581 private final BluetoothEnabler mBluetoothEnabler;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700582 private AuthenticatorHelper mAuthHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700583
584 private static class HeaderViewHolder {
585 ImageView icon;
586 TextView title;
587 TextView summary;
588 Switch switch_;
589 }
590
591 private LayoutInflater mInflater;
592
593 static int getHeaderType(Header header) {
594 if (header.fragment == null && header.intent == null) {
595 return HEADER_TYPE_CATEGORY;
596 } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
597 return HEADER_TYPE_SWITCH;
598 } else {
599 return HEADER_TYPE_NORMAL;
600 }
601 }
602
603 @Override
604 public int getItemViewType(int position) {
605 Header header = getItem(position);
606 return getHeaderType(header);
607 }
608
609 @Override
610 public boolean areAllItemsEnabled() {
611 return false; // because of categories
612 }
613
614 @Override
615 public boolean isEnabled(int position) {
616 return getItemViewType(position) != HEADER_TYPE_CATEGORY;
617 }
618
619 @Override
620 public int getViewTypeCount() {
621 return HEADER_TYPE_COUNT;
622 }
623
624 @Override
625 public boolean hasStableIds() {
626 return true;
627 }
628
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700629 public HeaderAdapter(Context context, List<Header> objects,
630 AuthenticatorHelper authenticatorHelper) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700631 super(context, 0, objects);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700632
633 mAuthHelper = authenticatorHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700634 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700635
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700636 // Temp Switches provided as placeholder until the adapter replaces these with actual
Gilles Debunnee78c1872011-06-20 15:00:07 -0700637 // Switches inflated from their layouts. Must be done before adapter is set in super
638 mWifiEnabler = new WifiEnabler(context, new Switch(context));
639 mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
640 }
641
642 @Override
643 public View getView(int position, View convertView, ViewGroup parent) {
644 HeaderViewHolder holder;
645 Header header = getItem(position);
646 int headerType = getHeaderType(header);
647 View view = null;
648
649 if (convertView == null) {
650 holder = new HeaderViewHolder();
651 switch (headerType) {
652 case HEADER_TYPE_CATEGORY:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700653 view = new TextView(getContext(), null,
654 android.R.attr.listSeparatorTextViewStyle);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700655 holder.title = (TextView) view;
656 break;
657
658 case HEADER_TYPE_SWITCH:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700659 view = mInflater.inflate(R.layout.preference_header_switch_item, parent,
660 false);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700661 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700662 holder.title = (TextView)
663 view.findViewById(com.android.internal.R.id.title);
664 holder.summary = (TextView)
665 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700666 holder.switch_ = (Switch) view.findViewById(R.id.switchWidget);
667 break;
668
669 case HEADER_TYPE_NORMAL:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700670 view = mInflater.inflate(
Amith Yamasanic8a93172012-06-08 13:35:47 -0700671 R.layout.preference_header_item, parent,
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700672 false);
Amith Yamasanic8a93172012-06-08 13:35:47 -0700673 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700674 holder.title = (TextView)
675 view.findViewById(com.android.internal.R.id.title);
676 holder.summary = (TextView)
677 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700678 break;
679 }
680 view.setTag(holder);
681 } else {
682 view = convertView;
683 holder = (HeaderViewHolder) view.getTag();
684 }
685
686 // All view fields must be updated every time, because the view may be recycled
687 switch (headerType) {
688 case HEADER_TYPE_CATEGORY:
689 holder.title.setText(header.getTitle(getContext().getResources()));
690 break;
691
692 case HEADER_TYPE_SWITCH:
693 // Would need a different treatment if the main menu had more switches
694 if (header.id == R.id.wifi_settings) {
695 mWifiEnabler.setSwitch(holder.switch_);
696 } else {
697 mBluetoothEnabler.setSwitch(holder.switch_);
698 }
699 // No break, fall through on purpose to update common fields
700
701 //$FALL-THROUGH$
702 case HEADER_TYPE_NORMAL:
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700703 if (header.extras != null
704 && header.extras.containsKey(ManageAccountsSettings.KEY_ACCOUNT_TYPE)) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700705 String accType = header.extras.getString(
706 ManageAccountsSettings.KEY_ACCOUNT_TYPE);
707 ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
708 lp.width = getContext().getResources().getDimensionPixelSize(
709 R.dimen.header_icon_width);
710 lp.height = lp.width;
711 holder.icon.setLayoutParams(lp);
712 Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
713 holder.icon.setImageDrawable(icon);
714 } else {
715 holder.icon.setImageResource(header.iconRes);
716 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700717 holder.title.setText(header.getTitle(getContext().getResources()));
718 CharSequence summary = header.getSummary(getContext().getResources());
719 if (!TextUtils.isEmpty(summary)) {
720 holder.summary.setVisibility(View.VISIBLE);
721 holder.summary.setText(summary);
722 } else {
723 holder.summary.setVisibility(View.GONE);
724 }
725 break;
726 }
727
728 return view;
729 }
730
731 public void resume() {
732 mWifiEnabler.resume();
733 mBluetoothEnabler.resume();
734 }
Brian Muramatsuc28af522012-06-28 14:25:14 -0700735
Gilles Debunnee78c1872011-06-20 15:00:07 -0700736 public void pause() {
737 mWifiEnabler.pause();
738 mBluetoothEnabler.pause();
739 }
740 }
741
742 @Override
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700743 public void onHeaderClick(Header header, int position) {
744 boolean revert = false;
745 if (header.id == R.id.account_add) {
746 revert = true;
747 }
748
749 super.onHeaderClick(header, position);
750
751 if (revert && mLastHeader != null) {
752 highlightHeader((int) mLastHeader.id);
753 } else {
754 mLastHeader = header;
755 }
756 }
757
758 @Override
Amith Yamasania4379d62011-07-22 10:34:58 -0700759 public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
760 // Override the fragment title for Wallpaper settings
Amith Yamasanidfb65432011-11-29 16:38:14 -0800761 int titleRes = pref.getTitleRes();
Amith Yamasania4379d62011-07-22 10:34:58 -0700762 if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
Amith Yamasanidfb65432011-11-29 16:38:14 -0800763 titleRes = R.string.wallpaper_settings_fragment_title;
Amith Yamasani8666b9e2012-09-27 14:50:13 -0700764 } else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
765 && UserHandle.myUserId() != UserHandle.USER_OWNER) {
Amith Yamasanib0171712013-04-28 22:13:22 -0700766 if (UserManager.get(this).isLinkedUser()) {
767 titleRes = R.string.profile_info_settings_title;
768 } else {
769 titleRes = R.string.user_info_settings_title;
770 }
Amith Yamasania4379d62011-07-22 10:34:58 -0700771 }
Jean Chalard7dabe452012-05-10 18:08:07 +0900772 startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
773 null, 0);
Amith Yamasania4379d62011-07-22 10:34:58 -0700774 return true;
775 }
776
Maggie Benthall0c5a4012013-03-14 17:41:27 -0400777 @Override
Amith Yamasani3d384f42012-05-11 15:22:04 -0700778 public boolean shouldUpRecreateTask(Intent targetIntent) {
779 return super.shouldUpRecreateTask(new Intent(this, Settings.class));
780 }
781
Amith Yamasania4379d62011-07-22 10:34:58 -0700782 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700783 public void setListAdapter(ListAdapter adapter) {
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700784 if (adapter == null) {
785 super.setListAdapter(null);
786 } else {
787 super.setListAdapter(new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper));
Gilles Debunnee78c1872011-06-20 15:00:07 -0700788 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700789 }
790
Amith Yamasani56821db2012-06-05 13:20:45 -0700791 @Override
792 public void onAccountsUpdated(Account[] accounts) {
Jeff Sharkey9ff79c12012-10-03 16:48:17 -0700793 // TODO: watch for package upgrades to invalidate cache; see 7206643
794 mAuthenticatorHelper.updateAuthDescriptions(this);
Amith Yamasani56821db2012-06-05 13:20:45 -0700795 mAuthenticatorHelper.onAccountsUpdated(this, accounts);
796 invalidateHeaders();
797 }
798
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700799 /*
800 * Settings subclasses for launching independently.
801 */
Gilles Debunnee78c1872011-06-20 15:00:07 -0700802 public static class BluetoothSettingsActivity extends Settings { /* empty */ }
803 public static class WirelessSettingsActivity extends Settings { /* empty */ }
804 public static class TetherSettingsActivity extends Settings { /* empty */ }
805 public static class VpnSettingsActivity extends Settings { /* empty */ }
806 public static class DateTimeSettingsActivity extends Settings { /* empty */ }
807 public static class StorageSettingsActivity extends Settings { /* empty */ }
808 public static class WifiSettingsActivity extends Settings { /* empty */ }
repo syncb98463f2011-06-30 10:58:43 -0700809 public static class WifiP2pSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700810 public static class InputMethodAndLanguageSettingsActivity extends Settings { /* empty */ }
Jeff Browne46c5f32012-04-05 11:42:18 -0700811 public static class KeyboardLayoutPickerActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700812 public static class InputMethodAndSubtypeEnablerActivity extends Settings { /* empty */ }
satoke077d2b2011-07-25 09:38:11 +0900813 public static class SpellCheckersSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700814 public static class LocalePickerActivity extends Settings { /* empty */ }
815 public static class UserDictionarySettingsActivity extends Settings { /* empty */ }
816 public static class SoundSettingsActivity extends Settings { /* empty */ }
817 public static class DisplaySettingsActivity extends Settings { /* empty */ }
818 public static class DeviceInfoSettingsActivity extends Settings { /* empty */ }
819 public static class ApplicationSettingsActivity extends Settings { /* empty */ }
820 public static class ManageApplicationsActivity extends Settings { /* empty */ }
Dianne Hackborna522a8e2013-01-15 19:02:05 -0800821 public static class AppOpsSummaryActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700822 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 */ }
Daniel Sandler7dee75c2012-11-27 22:41:30 -0500840 public static class DreamSettingsActivity extends Settings { /* empty */ }
Daniel Sandler328e2d22013-01-17 13:14:02 -0500841 public static class NotificationStationActivity extends Settings { /* empty */ }
Amith Yamasani233592b2013-03-01 17:05:23 -0800842 public static class UserSettingsActivity extends Settings { /* empty */ }
Daniel Sandler79b9bfe2013-04-04 14:30:04 -0400843 public static class NotificationAccessSettingsActivity extends Settings { /* empty */ }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800844}