blob: 962d042332a16c5c85d9132b403f9f77e0f18630 [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;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -070025import android.content.SharedPreferences;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070026import android.content.pm.ActivityInfo;
27import android.content.pm.PackageManager;
28import android.content.pm.PackageManager.NameNotFoundException;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070029import android.graphics.drawable.Drawable;
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -070030import android.os.Bundle;
Jeff Sharkey34e964d2012-04-21 15:41:48 -070031import android.os.INetworkManagementService;
32import android.os.RemoteException;
33import android.os.ServiceManager;
Dianne Hackbornbb06a422012-08-16 11:01:57 -070034import android.os.UserHandle;
Jeff Sharkey44202462012-09-19 13:13:45 -070035import android.os.UserManager;
Amith Yamasania4379d62011-07-22 10:34:58 -070036import android.preference.Preference;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070037import android.preference.PreferenceActivity;
Amith Yamasania4379d62011-07-22 10:34:58 -070038import android.preference.PreferenceFragment;
Gilles Debunnee78c1872011-06-20 15:00:07 -070039import android.text.TextUtils;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080040import android.util.Log;
Gilles Debunnee78c1872011-06-20 15:00:07 -070041import android.view.LayoutInflater;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080042import android.view.View;
43import android.view.View.OnClickListener;
Gilles Debunnee78c1872011-06-20 15:00:07 -070044import android.view.ViewGroup;
45import android.widget.ArrayAdapter;
Amith Yamasani9e3a4702011-01-11 09:09:26 -080046import android.widget.Button;
Gilles Debunnee78c1872011-06-20 15:00:07 -070047import android.widget.ImageView;
48import android.widget.ListAdapter;
49import android.widget.Switch;
50import android.widget.TextView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080051
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080052import com.android.internal.util.ArrayUtils;
53import com.android.settings.AccessibilitySettings.ToggleAccessibilityServicePreferenceFragment;
54import com.android.settings.accounts.AccountSyncSettings;
55import com.android.settings.accounts.AuthenticatorHelper;
56import com.android.settings.accounts.ManageAccountsSettings;
57import com.android.settings.bluetooth.BluetoothEnabler;
58import com.android.settings.bluetooth.BluetoothSettings;
Jeff Sharkey0c3634c2013-02-20 12:35:16 -080059import com.android.settings.wfd.WifiDisplaySettings;
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080060import com.android.settings.wifi.WifiEnabler;
61import com.android.settings.wifi.WifiSettings;
62import com.android.settings.wifi.p2p.WifiP2pSettings;
63
Gilles Debunnee78c1872011-06-20 15:00:07 -070064import java.util.ArrayList;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070065import java.util.Collections;
66import java.util.Comparator;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070067import java.util.HashMap;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070068import java.util.List;
Amith Yamasanid7993472010-08-18 13:59:28 -070069
70/**
71 * Top-level settings activity to handle single pane and double pane UI layout.
72 */
Amith Yamasani56821db2012-06-05 13:20:45 -070073public class Settings extends PreferenceActivity
74 implements ButtonBarHandler, OnAccountsUpdateListener {
Amith Yamasanid7993472010-08-18 13:59:28 -070075
Gilles Debunnee78c1872011-06-20 15:00:07 -070076 private static final String LOG_TAG = "Settings";
Amith Yamasaniea7b28c2012-06-20 13:51:40 -070077
Amith Yamasani5203bdf2010-11-04 09:59:44 -070078 private static final String META_DATA_KEY_HEADER_ID =
Gilles Debunnee78c1872011-06-20 15:00:07 -070079 "com.android.settings.TOP_LEVEL_HEADER_ID";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070080 private static final String META_DATA_KEY_FRAGMENT_CLASS =
Gilles Debunnee78c1872011-06-20 15:00:07 -070081 "com.android.settings.FRAGMENT_CLASS";
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080082 private static final String META_DATA_KEY_PARENT_TITLE =
83 "com.android.settings.PARENT_FRAGMENT_TITLE";
84 private static final String META_DATA_KEY_PARENT_FRAGMENT_CLASS =
85 "com.android.settings.PARENT_FRAGMENT_CLASS";
86
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080087 private static final String EXTRA_UI_OPTIONS = "settings:ui_options";
Jeff Sharkey9fab0da2011-07-09 17:52:31 -070088
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080089 private static final String SAVE_KEY_CURRENT_HEADER = "com.android.settings.CURRENT_HEADER";
90 private static final String SAVE_KEY_PARENT_HEADER = "com.android.settings.PARENT_HEADER";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070091
92 private String mFragmentClass;
93 private int mTopLevelHeaderId;
Amith Yamasani3965ae62010-11-15 14:45:19 -080094 private Header mFirstHeader;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080095 private Header mCurrentHeader;
96 private Header mParentHeader;
97 private boolean mInLocalHeaderSwitch;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070098
Amith Yamasanib810a0d2012-03-25 10:12:26 -070099 // Show only these settings for restricted users
100 private int[] SETTINGS_FOR_RESTRICTED = {
Amith Yamasani32630392012-08-10 19:31:39 -0700101 R.id.wireless_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700102 R.id.wifi_settings,
103 R.id.bluetooth_settings,
Jeff Sharkey38305fb2012-09-14 16:26:51 -0700104 R.id.data_usage_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700105 R.id.wireless_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700106 R.id.device_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700107 R.id.sound_settings,
108 R.id.display_settings,
Jeff Sharkey90c8b202012-08-30 15:20:10 -0700109 R.id.storage_settings,
Dianne Hackborn271c8b02012-08-20 17:24:39 -0700110 R.id.application_settings,
Dianne Hackborn52e56a22012-09-12 17:02:23 -0700111 R.id.battery_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700112 R.id.personal_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700113 R.id.location_settings,
Amith Yamasani3deeeb72012-04-05 14:44:48 -0700114 R.id.security_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700115 R.id.language_settings,
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700116 R.id.user_settings,
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700117 R.id.account_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700118 R.id.account_add,
119 R.id.system_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700120 R.id.date_time_settings,
Jeff Brown9e143f52012-09-19 20:46:07 -0700121 R.id.about_settings,
Svetoslav Ganov46045d82012-09-20 15:04:55 -0700122 R.id.accessibility_settings
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700123 };
124
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700125 private SharedPreferences mDevelopmentPreferences;
126 private SharedPreferences.OnSharedPreferenceChangeListener mDevelopmentPreferencesListener;
127
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700128 // TODO: Update Call Settings based on airplane mode state.
Amith Yamasanib61cf512010-09-12 08:17:50 -0700129
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700130 protected HashMap<Integer, Integer> mHeaderIndexMap = new HashMap<Integer, Integer>();
131
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700132 private AuthenticatorHelper mAuthenticatorHelper;
133 private Header mLastHeader;
Amith Yamasani86708a82012-06-06 20:23:08 -0700134 private boolean mListeningToAccountUpdates;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700135
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700136 @Override
137 protected void onCreate(Bundle savedInstanceState) {
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800138 if (getIntent().hasExtra(EXTRA_UI_OPTIONS)) {
139 getWindow().setUiOptions(getIntent().getIntExtra(EXTRA_UI_OPTIONS, 0));
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700140 }
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700141
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700142 mAuthenticatorHelper = new AuthenticatorHelper();
143 mAuthenticatorHelper.updateAuthDescriptions(this);
144 mAuthenticatorHelper.onAccountsUpdated(this, null);
145
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700146 mDevelopmentPreferences = getSharedPreferences(DevelopmentSettings.PREF_FILE,
147 Context.MODE_PRIVATE);
148
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700149 getMetaData();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800150 mInLocalHeaderSwitch = true;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700151 super.onCreate(savedInstanceState);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800152 mInLocalHeaderSwitch = false;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700153
Gilles Debunne3661b622011-06-27 11:19:16 -0700154 if (!onIsHidingHeaders() && onIsMultiPane()) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700155 highlightHeader(mTopLevelHeaderId);
Amith Yamasani72aa19d2010-12-09 06:07:12 -0800156 // Force the title so that it doesn't get overridden by a direct launch of
157 // a specific settings screen.
158 setTitle(R.string.settings_label);
159 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800160
161 // Retrieve any saved state
162 if (savedInstanceState != null) {
163 mCurrentHeader = savedInstanceState.getParcelable(SAVE_KEY_CURRENT_HEADER);
164 mParentHeader = savedInstanceState.getParcelable(SAVE_KEY_PARENT_HEADER);
165 }
166
167 // If the current header was saved, switch to it
168 if (savedInstanceState != null && mCurrentHeader != null) {
169 //switchToHeaderLocal(mCurrentHeader);
170 showBreadCrumbs(mCurrentHeader.title, null);
171 }
172
173 if (mParentHeader != null) {
174 setParentTitle(mParentHeader.title, null, new OnClickListener() {
175 public void onClick(View v) {
176 switchToParent(mParentHeader.fragment);
177 }
178 });
179 }
Gilles Debunnedc7101f2011-06-27 12:00:49 -0700180
Amith Yamasani3d384f42012-05-11 15:22:04 -0700181 // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
182 if (onIsMultiPane()) {
183 getActionBar().setDisplayHomeAsUpEnabled(false);
184 getActionBar().setHomeButtonEnabled(false);
185 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800186 }
187
188 @Override
189 protected void onSaveInstanceState(Bundle outState) {
190 super.onSaveInstanceState(outState);
191
192 // Save the current fragment, if it is the same as originally launched
193 if (mCurrentHeader != null) {
194 outState.putParcelable(SAVE_KEY_CURRENT_HEADER, mCurrentHeader);
195 }
196 if (mParentHeader != null) {
197 outState.putParcelable(SAVE_KEY_PARENT_HEADER, mParentHeader);
198 }
199 }
200
Gilles Debunnee78c1872011-06-20 15:00:07 -0700201 @Override
202 public void onResume() {
203 super.onResume();
204
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700205 mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
206 @Override
207 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
208 invalidateHeaders();
209 }
210 };
211 mDevelopmentPreferences.registerOnSharedPreferenceChangeListener(
212 mDevelopmentPreferencesListener);
213
Gilles Debunnee78c1872011-06-20 15:00:07 -0700214 ListAdapter listAdapter = getListAdapter();
215 if (listAdapter instanceof HeaderAdapter) {
216 ((HeaderAdapter) listAdapter).resume();
217 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700218 invalidateHeaders();
Gilles Debunnee78c1872011-06-20 15:00:07 -0700219 }
220
221 @Override
222 public void onPause() {
223 super.onPause();
224
225 ListAdapter listAdapter = getListAdapter();
226 if (listAdapter instanceof HeaderAdapter) {
227 ((HeaderAdapter) listAdapter).pause();
Amith Yamasani86708a82012-06-06 20:23:08 -0700228 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700229
230 mDevelopmentPreferences.unregisterOnSharedPreferenceChangeListener(
231 mDevelopmentPreferencesListener);
232 mDevelopmentPreferencesListener = null;
Amith Yamasani86708a82012-06-06 20:23:08 -0700233 }
234
235 @Override
236 public void onDestroy() {
237 super.onDestroy();
238 if (mListeningToAccountUpdates) {
Amith Yamasani56821db2012-06-05 13:20:45 -0700239 AccountManager.get(this).removeOnAccountsUpdatedListener(this);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700240 }
241 }
242
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800243 private void switchToHeaderLocal(Header header) {
244 mInLocalHeaderSwitch = true;
245 switchToHeader(header);
246 mInLocalHeaderSwitch = false;
247 }
248
249 @Override
250 public void switchToHeader(Header header) {
251 if (!mInLocalHeaderSwitch) {
252 mCurrentHeader = null;
253 mParentHeader = null;
254 }
255 super.switchToHeader(header);
256 }
257
258 /**
259 * Switch to parent fragment and store the grand parent's info
Jake Hamby2748fc22011-01-12 15:06:28 -0800260 * @param className name of the activity wrapper for the parent fragment.
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800261 */
262 private void switchToParent(String className) {
263 final ComponentName cn = new ComponentName(this, className);
264 try {
265 final PackageManager pm = getPackageManager();
266 final ActivityInfo parentInfo = pm.getActivityInfo(cn, PackageManager.GET_META_DATA);
267
268 if (parentInfo != null && parentInfo.metaData != null) {
269 String fragmentClass = parentInfo.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
270 CharSequence fragmentTitle = parentInfo.loadLabel(pm);
271 Header parentHeader = new Header();
272 parentHeader.fragment = fragmentClass;
273 parentHeader.title = fragmentTitle;
274 mCurrentHeader = parentHeader;
275
276 switchToHeaderLocal(parentHeader);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700277 highlightHeader(mTopLevelHeaderId);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800278
279 mParentHeader = new Header();
280 mParentHeader.fragment
281 = parentInfo.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
282 mParentHeader.title = parentInfo.metaData.getString(META_DATA_KEY_PARENT_TITLE);
283 }
284 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700285 Log.w(LOG_TAG, "Could not find parent activity : " + className);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800286 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700287 }
288
Amith Yamasani3965ae62010-11-15 14:45:19 -0800289 @Override
290 public void onNewIntent(Intent intent) {
291 super.onNewIntent(intent);
292
293 // If it is not launched from history, then reset to top-level
Amith Yamasanief617232012-10-09 16:57:25 -0700294 if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
295 if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
296 switchToHeaderLocal(mFirstHeader);
297 }
298 getListView().setSelectionFromTop(0, 0);
Amith Yamasani3965ae62010-11-15 14:45:19 -0800299 }
300 }
301
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700302 private void highlightHeader(int id) {
303 if (id != 0) {
304 Integer index = mHeaderIndexMap.get(id);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700305 if (index != null) {
306 getListView().setItemChecked(index, true);
Amith Yamasanief617232012-10-09 16:57:25 -0700307 if (isMultiPane()) {
308 getListView().smoothScrollToPosition(index);
309 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700310 }
311 }
312 }
313
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700314 @Override
315 public Intent getIntent() {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700316 Intent superIntent = super.getIntent();
317 String startingFragment = getStartingFragmentClass(superIntent);
Gilles Debunne3661b622011-06-27 11:19:16 -0700318 // This is called from super.onCreate, isMultiPane() is not yet reliable
319 // Do not use onIsHidingHeaders either, which relies itself on this method
320 if (startingFragment != null && !onIsMultiPane()) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700321 Intent modIntent = new Intent(superIntent);
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700322 modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700323 Bundle args = superIntent.getExtras();
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700324 if (args != null) {
325 args = new Bundle(args);
326 } else {
327 args = new Bundle();
328 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700329 args.putParcelable("intent", superIntent);
330 modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, superIntent.getExtras());
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700331 return modIntent;
332 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700333 return superIntent;
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700334 }
335
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700336 /**
Amith Yamasani379d9b02010-09-27 12:03:59 -0700337 * Checks if the component name in the intent is different from the Settings class and
338 * returns the class name to load as a fragment.
339 */
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700340 protected String getStartingFragmentClass(Intent intent) {
341 if (mFragmentClass != null) return mFragmentClass;
342
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700343 String intentClass = intent.getComponent().getClassName();
Amith Yamasani379d9b02010-09-27 12:03:59 -0700344 if (intentClass.equals(getClass().getName())) return null;
345
Dianne Hackbornee293792010-11-01 12:32:33 -0700346 if ("com.android.settings.ManageApplications".equals(intentClass)
347 || "com.android.settings.RunningServices".equals(intentClass)
348 || "com.android.settings.applications.StorageUse".equals(intentClass)) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700349 // Old names of manage apps.
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700350 intentClass = com.android.settings.applications.ManageApplications.class.getName();
351 }
352
Amith Yamasani379d9b02010-09-27 12:03:59 -0700353 return intentClass;
354 }
355
356 /**
357 * Override initial header when an activity-alias is causing Settings to be launched
358 * for a specific fragment encoded in the android:name parameter.
359 */
360 @Override
361 public Header onGetInitialHeader() {
362 String fragmentClass = getStartingFragmentClass(super.getIntent());
363 if (fragmentClass != null) {
364 Header header = new Header();
365 header.fragment = fragmentClass;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800366 header.title = getTitle();
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700367 header.fragmentArguments = getIntent().getExtras();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800368 mCurrentHeader = header;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700369 return header;
370 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700371
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700372 return mFirstHeader;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700373 }
374
Dianne Hackbornb7258182011-03-15 16:23:55 -0700375 @Override
Dianne Hackborn48147dc2011-03-18 12:29:41 -0700376 public Intent onBuildStartFragmentIntent(String fragmentName, Bundle args,
377 int titleRes, int shortTitleRes) {
378 Intent intent = super.onBuildStartFragmentIntent(fragmentName, args,
379 titleRes, shortTitleRes);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700380
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800381 // Some fragments want split ActionBar; these should stay in sync with
382 // uiOptions for fragments also defined as activities in manifest.
383 if (WifiSettings.class.getName().equals(fragmentName) ||
384 WifiP2pSettings.class.getName().equals(fragmentName) ||
Jeff Sharkey0c3634c2013-02-20 12:35:16 -0800385 WifiDisplaySettings.class.getName().equals(fragmentName) ||
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800386 BluetoothSettings.class.getName().equals(fragmentName) ||
387 DreamSettings.class.getName().equals(fragmentName) ||
388 ToggleAccessibilityServicePreferenceFragment.class.getName().equals(fragmentName)) {
389 intent.putExtra(EXTRA_UI_OPTIONS, ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700390 }
391
Dianne Hackbornb7258182011-03-15 16:23:55 -0700392 intent.setClass(this, SubSettings.class);
393 return intent;
394 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700395
Amith Yamasani379d9b02010-09-27 12:03:59 -0700396 /**
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700397 * Populate the activity with the top-level headers.
398 */
Amith Yamasanid7993472010-08-18 13:59:28 -0700399 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700400 public void onBuildHeaders(List<Header> headers) {
401 loadHeadersFromResource(R.xml.settings_headers, headers);
Amith Yamasanid7993472010-08-18 13:59:28 -0700402
Gilles Debunnee78c1872011-06-20 15:00:07 -0700403 updateHeaderList(headers);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700404 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700405
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700406 private void updateHeaderList(List<Header> target) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700407 final boolean showDev = mDevelopmentPreferences.getBoolean(
408 DevelopmentSettings.PREF_SHOW,
409 android.os.Build.TYPE.equals("eng"));
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700410 int i = 0;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700411
412 mHeaderIndexMap.clear();
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700413 while (i < target.size()) {
414 Header header = target.get(i);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700415 // Ids are integers, so downcasting
416 int id = (int) header.id;
Chris Wren2bc32ae2012-09-24 14:23:46 -0400417 if (id == R.id.operator_settings || id == R.id.manufacturer_settings) {
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700418 Utils.updateHeaderToSpecificActivityFromMetaDataOrRemove(this, target, header);
Gilles Debunne2454f492011-06-21 16:16:06 -0700419 } else if (id == R.id.wifi_settings) {
420 // Remove WiFi Settings if WiFi service is not available.
421 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700422 target.remove(i);
Gilles Debunne2454f492011-06-21 16:16:06 -0700423 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700424 } else if (id == R.id.bluetooth_settings) {
425 // Remove Bluetooth Settings if Bluetooth service is not available.
Gilles Debunne2454f492011-06-21 16:16:06 -0700426 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700427 target.remove(i);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700428 }
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700429 } else if (id == R.id.data_usage_settings) {
430 // Remove data usage when kernel module not enabled
431 final INetworkManagementService netManager = INetworkManagementService.Stub
432 .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
433 try {
434 if (!netManager.isBandwidthControlEnabled()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700435 target.remove(i);
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700436 }
437 } catch (RemoteException e) {
438 // ignored
439 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700440 } else if (id == R.id.account_settings) {
441 int headerIndex = i + 1;
442 i = insertAccountsHeaders(target, headerIndex);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700443 } else if (id == R.id.user_settings) {
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700444 if (!UserHandle.MU_ENABLED
Jeff Sharkey44202462012-09-19 13:13:45 -0700445 || !UserManager.supportsMultipleUsers()
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700446 || Utils.isMonkeyRunning()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700447 target.remove(i);
448 }
449 } else if (id == R.id.development_settings) {
450 if (!showDev) {
451 target.remove(i);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700452 }
453 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700454
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900455 if (i < target.size() && target.get(i) == header
Amith Yamasanib99f8642012-10-10 21:41:12 -0700456 && UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700457 && !ArrayUtils.contains(SETTINGS_FOR_RESTRICTED, id)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700458 target.remove(i);
Amith Yamasanid7993472010-08-18 13:59:28 -0700459 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700460
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700461 // Increment if the current one wasn't removed by the Utils code.
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900462 if (i < target.size() && target.get(i) == header) {
Amith Yamasani3965ae62010-11-15 14:45:19 -0800463 // Hold on to the first header, when we need to reset to the top-level
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700464 if (mFirstHeader == null &&
465 HeaderAdapter.getHeaderType(header) != HeaderAdapter.HEADER_TYPE_CATEGORY) {
466 mFirstHeader = header;
467 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700468 mHeaderIndexMap.put(id, i);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700469 i++;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700470 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700471 }
472 }
473
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700474 private int insertAccountsHeaders(List<Header> target, int headerIndex) {
475 String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
476 List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length);
477 for (String accountType : accountTypes) {
478 CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType);
Brian Muramatsuc28af522012-06-28 14:25:14 -0700479 if (label == null) {
480 continue;
481 }
482
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700483 Account[] accounts = AccountManager.get(this).getAccountsByType(accountType);
484 boolean skipToAccount = accounts.length == 1
485 && !mAuthenticatorHelper.hasAccountPreferences(accountType);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700486 Header accHeader = new Header();
487 accHeader.title = label;
488 if (accHeader.extras == null) {
489 accHeader.extras = new Bundle();
490 }
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700491 if (skipToAccount) {
492 accHeader.breadCrumbTitleRes = R.string.account_sync_settings_title;
493 accHeader.breadCrumbShortTitleRes = R.string.account_sync_settings_title;
494 accHeader.fragment = AccountSyncSettings.class.getName();
495 accHeader.fragmentArguments = new Bundle();
496 // Need this for the icon
497 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
498 accHeader.extras.putParcelable(AccountSyncSettings.ACCOUNT_KEY, accounts[0]);
499 accHeader.fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
500 accounts[0]);
501 } else {
502 accHeader.breadCrumbTitle = label;
503 accHeader.breadCrumbShortTitle = label;
504 accHeader.fragment = ManageAccountsSettings.class.getName();
505 accHeader.fragmentArguments = new Bundle();
506 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
507 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE,
508 accountType);
509 if (!isMultiPane()) {
510 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
511 label.toString());
512 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700513 }
514 accountHeaders.add(accHeader);
515 }
516
517 // Sort by label
518 Collections.sort(accountHeaders, new Comparator<Header>() {
519 @Override
520 public int compare(Header h1, Header h2) {
521 return h1.title.toString().compareTo(h2.title.toString());
522 }
523 });
524
525 for (Header header : accountHeaders) {
526 target.add(headerIndex++, header);
527 }
Amith Yamasani86708a82012-06-06 20:23:08 -0700528 if (!mListeningToAccountUpdates) {
529 AccountManager.get(this).addOnAccountsUpdatedListener(this, null, true);
530 mListeningToAccountUpdates = true;
531 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700532 return headerIndex;
533 }
534
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700535 private void getMetaData() {
536 try {
537 ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
538 PackageManager.GET_META_DATA);
539 if (ai == null || ai.metaData == null) return;
540 mTopLevelHeaderId = ai.metaData.getInt(META_DATA_KEY_HEADER_ID);
541 mFragmentClass = ai.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700542
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800543 // Check if it has a parent specified and create a Header object
544 final int parentHeaderTitleRes = ai.metaData.getInt(META_DATA_KEY_PARENT_TITLE);
545 String parentFragmentClass = ai.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
546 if (parentFragmentClass != null) {
547 mParentHeader = new Header();
548 mParentHeader.fragment = parentFragmentClass;
549 if (parentHeaderTitleRes != 0) {
550 mParentHeader.title = getResources().getString(parentHeaderTitleRes);
551 }
552 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700553 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700554 // No recovery
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700555 }
556 }
557
Amith Yamasani9e3a4702011-01-11 09:09:26 -0800558 @Override
559 public boolean hasNextButton() {
560 return super.hasNextButton();
561 }
562
563 @Override
564 public Button getNextButton() {
565 return super.getNextButton();
566 }
567
Gilles Debunnee78c1872011-06-20 15:00:07 -0700568 private static class HeaderAdapter extends ArrayAdapter<Header> {
569 static final int HEADER_TYPE_CATEGORY = 0;
570 static final int HEADER_TYPE_NORMAL = 1;
571 static final int HEADER_TYPE_SWITCH = 2;
572 private static final int HEADER_TYPE_COUNT = HEADER_TYPE_SWITCH + 1;
573
574 private final WifiEnabler mWifiEnabler;
575 private final BluetoothEnabler mBluetoothEnabler;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700576 private AuthenticatorHelper mAuthHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700577
578 private static class HeaderViewHolder {
579 ImageView icon;
580 TextView title;
581 TextView summary;
582 Switch switch_;
583 }
584
585 private LayoutInflater mInflater;
586
587 static int getHeaderType(Header header) {
588 if (header.fragment == null && header.intent == null) {
589 return HEADER_TYPE_CATEGORY;
590 } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
591 return HEADER_TYPE_SWITCH;
592 } else {
593 return HEADER_TYPE_NORMAL;
594 }
595 }
596
597 @Override
598 public int getItemViewType(int position) {
599 Header header = getItem(position);
600 return getHeaderType(header);
601 }
602
603 @Override
604 public boolean areAllItemsEnabled() {
605 return false; // because of categories
606 }
607
608 @Override
609 public boolean isEnabled(int position) {
610 return getItemViewType(position) != HEADER_TYPE_CATEGORY;
611 }
612
613 @Override
614 public int getViewTypeCount() {
615 return HEADER_TYPE_COUNT;
616 }
617
618 @Override
619 public boolean hasStableIds() {
620 return true;
621 }
622
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700623 public HeaderAdapter(Context context, List<Header> objects,
624 AuthenticatorHelper authenticatorHelper) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700625 super(context, 0, objects);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700626
627 mAuthHelper = authenticatorHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700628 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700629
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700630 // Temp Switches provided as placeholder until the adapter replaces these with actual
Gilles Debunnee78c1872011-06-20 15:00:07 -0700631 // Switches inflated from their layouts. Must be done before adapter is set in super
632 mWifiEnabler = new WifiEnabler(context, new Switch(context));
633 mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
634 }
635
636 @Override
637 public View getView(int position, View convertView, ViewGroup parent) {
638 HeaderViewHolder holder;
639 Header header = getItem(position);
640 int headerType = getHeaderType(header);
641 View view = null;
642
643 if (convertView == null) {
644 holder = new HeaderViewHolder();
645 switch (headerType) {
646 case HEADER_TYPE_CATEGORY:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700647 view = new TextView(getContext(), null,
648 android.R.attr.listSeparatorTextViewStyle);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700649 holder.title = (TextView) view;
650 break;
651
652 case HEADER_TYPE_SWITCH:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700653 view = mInflater.inflate(R.layout.preference_header_switch_item, parent,
654 false);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700655 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700656 holder.title = (TextView)
657 view.findViewById(com.android.internal.R.id.title);
658 holder.summary = (TextView)
659 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700660 holder.switch_ = (Switch) view.findViewById(R.id.switchWidget);
661 break;
662
663 case HEADER_TYPE_NORMAL:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700664 view = mInflater.inflate(
Amith Yamasanic8a93172012-06-08 13:35:47 -0700665 R.layout.preference_header_item, parent,
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700666 false);
Amith Yamasanic8a93172012-06-08 13:35:47 -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 break;
673 }
674 view.setTag(holder);
675 } else {
676 view = convertView;
677 holder = (HeaderViewHolder) view.getTag();
678 }
679
680 // All view fields must be updated every time, because the view may be recycled
681 switch (headerType) {
682 case HEADER_TYPE_CATEGORY:
683 holder.title.setText(header.getTitle(getContext().getResources()));
684 break;
685
686 case HEADER_TYPE_SWITCH:
687 // Would need a different treatment if the main menu had more switches
688 if (header.id == R.id.wifi_settings) {
689 mWifiEnabler.setSwitch(holder.switch_);
690 } else {
691 mBluetoothEnabler.setSwitch(holder.switch_);
692 }
693 // No break, fall through on purpose to update common fields
694
695 //$FALL-THROUGH$
696 case HEADER_TYPE_NORMAL:
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700697 if (header.extras != null
698 && header.extras.containsKey(ManageAccountsSettings.KEY_ACCOUNT_TYPE)) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700699 String accType = header.extras.getString(
700 ManageAccountsSettings.KEY_ACCOUNT_TYPE);
701 ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
702 lp.width = getContext().getResources().getDimensionPixelSize(
703 R.dimen.header_icon_width);
704 lp.height = lp.width;
705 holder.icon.setLayoutParams(lp);
706 Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
707 holder.icon.setImageDrawable(icon);
708 } else {
709 holder.icon.setImageResource(header.iconRes);
710 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700711 holder.title.setText(header.getTitle(getContext().getResources()));
712 CharSequence summary = header.getSummary(getContext().getResources());
713 if (!TextUtils.isEmpty(summary)) {
714 holder.summary.setVisibility(View.VISIBLE);
715 holder.summary.setText(summary);
716 } else {
717 holder.summary.setVisibility(View.GONE);
718 }
719 break;
720 }
721
722 return view;
723 }
724
725 public void resume() {
726 mWifiEnabler.resume();
727 mBluetoothEnabler.resume();
728 }
Brian Muramatsuc28af522012-06-28 14:25:14 -0700729
Gilles Debunnee78c1872011-06-20 15:00:07 -0700730 public void pause() {
731 mWifiEnabler.pause();
732 mBluetoothEnabler.pause();
733 }
734 }
735
736 @Override
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700737 public void onHeaderClick(Header header, int position) {
738 boolean revert = false;
739 if (header.id == R.id.account_add) {
740 revert = true;
741 }
742
743 super.onHeaderClick(header, position);
744
745 if (revert && mLastHeader != null) {
746 highlightHeader((int) mLastHeader.id);
747 } else {
748 mLastHeader = header;
749 }
750 }
751
752 @Override
Amith Yamasania4379d62011-07-22 10:34:58 -0700753 public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
754 // Override the fragment title for Wallpaper settings
Amith Yamasanidfb65432011-11-29 16:38:14 -0800755 int titleRes = pref.getTitleRes();
Amith Yamasania4379d62011-07-22 10:34:58 -0700756 if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
Amith Yamasanidfb65432011-11-29 16:38:14 -0800757 titleRes = R.string.wallpaper_settings_fragment_title;
Amith Yamasani8666b9e2012-09-27 14:50:13 -0700758 } else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
759 && UserHandle.myUserId() != UserHandle.USER_OWNER) {
760 titleRes = R.string.user_info_settings_title;
Amith Yamasania4379d62011-07-22 10:34:58 -0700761 }
Jean Chalard7dabe452012-05-10 18:08:07 +0900762 startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
763 null, 0);
Amith Yamasania4379d62011-07-22 10:34:58 -0700764 return true;
765 }
766
Amith Yamasani3d384f42012-05-11 15:22:04 -0700767 public boolean shouldUpRecreateTask(Intent targetIntent) {
768 return super.shouldUpRecreateTask(new Intent(this, Settings.class));
769 }
770
Amith Yamasania4379d62011-07-22 10:34:58 -0700771 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700772 public void setListAdapter(ListAdapter adapter) {
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700773 if (adapter == null) {
774 super.setListAdapter(null);
775 } else {
776 super.setListAdapter(new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper));
Gilles Debunnee78c1872011-06-20 15:00:07 -0700777 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700778 }
779
Amith Yamasani56821db2012-06-05 13:20:45 -0700780 @Override
781 public void onAccountsUpdated(Account[] accounts) {
Jeff Sharkey9ff79c12012-10-03 16:48:17 -0700782 // TODO: watch for package upgrades to invalidate cache; see 7206643
783 mAuthenticatorHelper.updateAuthDescriptions(this);
Amith Yamasani56821db2012-06-05 13:20:45 -0700784 mAuthenticatorHelper.onAccountsUpdated(this, accounts);
785 invalidateHeaders();
786 }
787
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700788 /*
789 * Settings subclasses for launching independently.
790 */
Gilles Debunnee78c1872011-06-20 15:00:07 -0700791 public static class BluetoothSettingsActivity extends Settings { /* empty */ }
792 public static class WirelessSettingsActivity extends Settings { /* empty */ }
793 public static class TetherSettingsActivity extends Settings { /* empty */ }
794 public static class VpnSettingsActivity extends Settings { /* empty */ }
795 public static class DateTimeSettingsActivity extends Settings { /* empty */ }
796 public static class StorageSettingsActivity extends Settings { /* empty */ }
797 public static class WifiSettingsActivity extends Settings { /* empty */ }
repo syncb98463f2011-06-30 10:58:43 -0700798 public static class WifiP2pSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700799 public static class InputMethodAndLanguageSettingsActivity extends Settings { /* empty */ }
Jeff Browne46c5f32012-04-05 11:42:18 -0700800 public static class KeyboardLayoutPickerActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700801 public static class InputMethodAndSubtypeEnablerActivity extends Settings { /* empty */ }
satoke077d2b2011-07-25 09:38:11 +0900802 public static class SpellCheckersSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700803 public static class LocalePickerActivity extends Settings { /* empty */ }
804 public static class UserDictionarySettingsActivity extends Settings { /* empty */ }
805 public static class SoundSettingsActivity extends Settings { /* empty */ }
806 public static class DisplaySettingsActivity extends Settings { /* empty */ }
807 public static class DeviceInfoSettingsActivity extends Settings { /* empty */ }
808 public static class ApplicationSettingsActivity extends Settings { /* empty */ }
809 public static class ManageApplicationsActivity extends Settings { /* empty */ }
Dianne Hackborna522a8e2013-01-15 19:02:05 -0800810 public static class AppOpsSummaryActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700811 public static class StorageUseActivity extends Settings { /* empty */ }
812 public static class DevelopmentSettingsActivity extends Settings { /* empty */ }
813 public static class AccessibilitySettingsActivity extends Settings { /* empty */ }
814 public static class SecuritySettingsActivity extends Settings { /* empty */ }
Gilles Debunnea6a8a142011-06-09 11:56:17 -0700815 public static class LocationSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700816 public static class PrivacySettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700817 public static class RunningServicesActivity extends Settings { /* empty */ }
818 public static class ManageAccountsSettingsActivity extends Settings { /* empty */ }
819 public static class PowerUsageSummaryActivity extends Settings { /* empty */ }
820 public static class AccountSyncSettingsActivity extends Settings { /* empty */ }
821 public static class AccountSyncSettingsInAddAccountActivity extends Settings { /* empty */ }
822 public static class CryptKeeperSettingsActivity extends Settings { /* empty */ }
823 public static class DeviceAdminSettingsActivity extends Settings { /* empty */ }
824 public static class DataUsageSummaryActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700825 public static class AdvancedWifiSettingsActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700826 public static class TextToSpeechSettingsActivity extends Settings { /* empty */ }
Jeff Hamilton3d670de2011-09-21 16:44:36 -0500827 public static class AndroidBeamSettingsActivity extends Settings { /* empty */ }
Jeff Brown9e143f52012-09-19 20:46:07 -0700828 public static class WifiDisplaySettingsActivity extends Settings { /* empty */ }
Daniel Sandler7dee75c2012-11-27 22:41:30 -0500829 public static class DreamSettingsActivity extends Settings { /* empty */ }
Daniel Sandler328e2d22013-01-17 13:14:02 -0500830 public static class NotificationStationActivity extends Settings { /* empty */ }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800831}