blob: be8e1ccb3ae6ac38d9ad897178bf88d094a731c0 [file] [log] [blame]
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.settings;
18
Amith Yamasani56821db2012-06-05 13:20:45 -070019import android.accounts.Account;
20import android.accounts.AccountManager;
21import android.accounts.OnAccountsUpdateListener;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080022import android.content.ComponentName;
Gilles Debunnee78c1872011-06-20 15:00:07 -070023import android.content.Context;
Amith Yamasani379d9b02010-09-27 12:03:59 -070024import android.content.Intent;
Amith Yamasani233592b2013-03-01 17:05:23 -080025import android.content.RestrictionEntry;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -070026import android.content.SharedPreferences;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070027import android.content.pm.ActivityInfo;
28import android.content.pm.PackageManager;
29import android.content.pm.PackageManager.NameNotFoundException;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070030import android.graphics.drawable.Drawable;
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -070031import android.os.Bundle;
Jeff Sharkey34e964d2012-04-21 15:41:48 -070032import android.os.INetworkManagementService;
33import android.os.RemoteException;
34import android.os.ServiceManager;
Dianne Hackbornbb06a422012-08-16 11:01:57 -070035import android.os.UserHandle;
Jeff Sharkey44202462012-09-19 13:13:45 -070036import android.os.UserManager;
Amith Yamasania4379d62011-07-22 10:34:58 -070037import android.preference.Preference;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070038import android.preference.PreferenceActivity;
Amith Yamasania4379d62011-07-22 10:34:58 -070039import android.preference.PreferenceFragment;
Gilles Debunnee78c1872011-06-20 15:00:07 -070040import android.text.TextUtils;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080041import android.util.Log;
Gilles Debunnee78c1872011-06-20 15:00:07 -070042import android.view.LayoutInflater;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080043import android.view.View;
44import android.view.View.OnClickListener;
Gilles Debunnee78c1872011-06-20 15:00:07 -070045import android.view.ViewGroup;
46import android.widget.ArrayAdapter;
Amith Yamasani9e3a4702011-01-11 09:09:26 -080047import android.widget.Button;
Gilles Debunnee78c1872011-06-20 15:00:07 -070048import android.widget.ImageView;
49import android.widget.ListAdapter;
50import android.widget.Switch;
51import android.widget.TextView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080052
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080053import com.android.internal.util.ArrayUtils;
54import com.android.settings.AccessibilitySettings.ToggleAccessibilityServicePreferenceFragment;
55import com.android.settings.accounts.AccountSyncSettings;
56import com.android.settings.accounts.AuthenticatorHelper;
57import com.android.settings.accounts.ManageAccountsSettings;
58import com.android.settings.bluetooth.BluetoothEnabler;
59import com.android.settings.bluetooth.BluetoothSettings;
Amith Yamasani233592b2013-03-01 17:05:23 -080060import com.android.settings.users.RestrictionsReceiver;
Jeff Sharkey0c3634c2013-02-20 12:35:16 -080061import com.android.settings.wfd.WifiDisplaySettings;
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080062import com.android.settings.wifi.WifiEnabler;
63import com.android.settings.wifi.WifiSettings;
64import com.android.settings.wifi.p2p.WifiP2pSettings;
65
Gilles Debunnee78c1872011-06-20 15:00:07 -070066import java.util.ArrayList;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070067import java.util.Collections;
68import java.util.Comparator;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070069import java.util.HashMap;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070070import java.util.List;
Amith Yamasanid7993472010-08-18 13:59:28 -070071
72/**
73 * Top-level settings activity to handle single pane and double pane UI layout.
74 */
Amith Yamasani56821db2012-06-05 13:20:45 -070075public class Settings extends PreferenceActivity
76 implements ButtonBarHandler, OnAccountsUpdateListener {
Amith Yamasanid7993472010-08-18 13:59:28 -070077
Gilles Debunnee78c1872011-06-20 15:00:07 -070078 private static final String LOG_TAG = "Settings";
Amith Yamasaniea7b28c2012-06-20 13:51:40 -070079
Amith Yamasani5203bdf2010-11-04 09:59:44 -070080 private static final String META_DATA_KEY_HEADER_ID =
Gilles Debunnee78c1872011-06-20 15:00:07 -070081 "com.android.settings.TOP_LEVEL_HEADER_ID";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070082 private static final String META_DATA_KEY_FRAGMENT_CLASS =
Gilles Debunnee78c1872011-06-20 15:00:07 -070083 "com.android.settings.FRAGMENT_CLASS";
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080084 private static final String META_DATA_KEY_PARENT_TITLE =
85 "com.android.settings.PARENT_FRAGMENT_TITLE";
86 private static final String META_DATA_KEY_PARENT_FRAGMENT_CLASS =
87 "com.android.settings.PARENT_FRAGMENT_CLASS";
88
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -080089 private static final String EXTRA_UI_OPTIONS = "settings:ui_options";
Jeff Sharkey9fab0da2011-07-09 17:52:31 -070090
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080091 private static final String SAVE_KEY_CURRENT_HEADER = "com.android.settings.CURRENT_HEADER";
92 private static final String SAVE_KEY_PARENT_HEADER = "com.android.settings.PARENT_HEADER";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070093
94 private String mFragmentClass;
95 private int mTopLevelHeaderId;
Amith Yamasani3965ae62010-11-15 14:45:19 -080096 private Header mFirstHeader;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080097 private Header mCurrentHeader;
98 private Header mParentHeader;
99 private boolean mInLocalHeaderSwitch;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700100
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700101 // Show only these settings for restricted users
102 private int[] SETTINGS_FOR_RESTRICTED = {
Amith Yamasani32630392012-08-10 19:31:39 -0700103 R.id.wireless_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700104 R.id.wifi_settings,
105 R.id.bluetooth_settings,
Jeff Sharkey38305fb2012-09-14 16:26:51 -0700106 R.id.data_usage_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700107 R.id.wireless_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700108 R.id.device_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700109 R.id.sound_settings,
110 R.id.display_settings,
Jeff Sharkey90c8b202012-08-30 15:20:10 -0700111 R.id.storage_settings,
Dianne Hackborn271c8b02012-08-20 17:24:39 -0700112 R.id.application_settings,
Dianne Hackborn52e56a22012-09-12 17:02:23 -0700113 R.id.battery_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700114 R.id.personal_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700115 R.id.location_settings,
Amith Yamasani3deeeb72012-04-05 14:44:48 -0700116 R.id.security_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700117 R.id.language_settings,
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700118 R.id.user_settings,
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700119 R.id.account_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700120 R.id.account_add,
121 R.id.system_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700122 R.id.date_time_settings,
Jeff Brown9e143f52012-09-19 20:46:07 -0700123 R.id.about_settings,
Svetoslav Ganov46045d82012-09-20 15:04:55 -0700124 R.id.accessibility_settings
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700125 };
126
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700127 private SharedPreferences mDevelopmentPreferences;
128 private SharedPreferences.OnSharedPreferenceChangeListener mDevelopmentPreferencesListener;
129
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700130 // TODO: Update Call Settings based on airplane mode state.
Amith Yamasanib61cf512010-09-12 08:17:50 -0700131
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700132 protected HashMap<Integer, Integer> mHeaderIndexMap = new HashMap<Integer, Integer>();
133
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700134 private AuthenticatorHelper mAuthenticatorHelper;
135 private Header mLastHeader;
Amith Yamasani86708a82012-06-06 20:23:08 -0700136 private boolean mListeningToAccountUpdates;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700137
Amith Yamasani233592b2013-03-01 17:05:23 -0800138 private List<RestrictionEntry> mAppRestrictions;
139
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700140 @Override
141 protected void onCreate(Bundle savedInstanceState) {
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800142 if (getIntent().hasExtra(EXTRA_UI_OPTIONS)) {
143 getWindow().setUiOptions(getIntent().getIntExtra(EXTRA_UI_OPTIONS, 0));
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700144 }
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700145
Amith Yamasani233592b2013-03-01 17:05:23 -0800146 mAppRestrictions = getApplicationRestrictions();
147
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700148 mAuthenticatorHelper = new AuthenticatorHelper();
149 mAuthenticatorHelper.updateAuthDescriptions(this);
150 mAuthenticatorHelper.onAccountsUpdated(this, null);
151
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700152 mDevelopmentPreferences = getSharedPreferences(DevelopmentSettings.PREF_FILE,
153 Context.MODE_PRIVATE);
154
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700155 getMetaData();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800156 mInLocalHeaderSwitch = true;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700157 super.onCreate(savedInstanceState);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800158 mInLocalHeaderSwitch = false;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700159
Gilles Debunne3661b622011-06-27 11:19:16 -0700160 if (!onIsHidingHeaders() && onIsMultiPane()) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700161 highlightHeader(mTopLevelHeaderId);
Amith Yamasani72aa19d2010-12-09 06:07:12 -0800162 // Force the title so that it doesn't get overridden by a direct launch of
163 // a specific settings screen.
164 setTitle(R.string.settings_label);
165 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800166
167 // Retrieve any saved state
168 if (savedInstanceState != null) {
169 mCurrentHeader = savedInstanceState.getParcelable(SAVE_KEY_CURRENT_HEADER);
170 mParentHeader = savedInstanceState.getParcelable(SAVE_KEY_PARENT_HEADER);
171 }
172
173 // If the current header was saved, switch to it
174 if (savedInstanceState != null && mCurrentHeader != null) {
175 //switchToHeaderLocal(mCurrentHeader);
176 showBreadCrumbs(mCurrentHeader.title, null);
177 }
178
179 if (mParentHeader != null) {
180 setParentTitle(mParentHeader.title, null, new OnClickListener() {
181 public void onClick(View v) {
182 switchToParent(mParentHeader.fragment);
183 }
184 });
185 }
Gilles Debunnedc7101f2011-06-27 12:00:49 -0700186
Amith Yamasani3d384f42012-05-11 15:22:04 -0700187 // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
188 if (onIsMultiPane()) {
189 getActionBar().setDisplayHomeAsUpEnabled(false);
190 getActionBar().setHomeButtonEnabled(false);
191 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800192 }
193
194 @Override
195 protected void onSaveInstanceState(Bundle outState) {
196 super.onSaveInstanceState(outState);
197
198 // Save the current fragment, if it is the same as originally launched
199 if (mCurrentHeader != null) {
200 outState.putParcelable(SAVE_KEY_CURRENT_HEADER, mCurrentHeader);
201 }
202 if (mParentHeader != null) {
203 outState.putParcelable(SAVE_KEY_PARENT_HEADER, mParentHeader);
204 }
205 }
206
Gilles Debunnee78c1872011-06-20 15:00:07 -0700207 @Override
208 public void onResume() {
209 super.onResume();
210
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700211 mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
212 @Override
213 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
214 invalidateHeaders();
215 }
216 };
217 mDevelopmentPreferences.registerOnSharedPreferenceChangeListener(
218 mDevelopmentPreferencesListener);
219
Gilles Debunnee78c1872011-06-20 15:00:07 -0700220 ListAdapter listAdapter = getListAdapter();
221 if (listAdapter instanceof HeaderAdapter) {
222 ((HeaderAdapter) listAdapter).resume();
223 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700224 invalidateHeaders();
Gilles Debunnee78c1872011-06-20 15:00:07 -0700225 }
226
227 @Override
228 public void onPause() {
229 super.onPause();
230
231 ListAdapter listAdapter = getListAdapter();
232 if (listAdapter instanceof HeaderAdapter) {
233 ((HeaderAdapter) listAdapter).pause();
Amith Yamasani86708a82012-06-06 20:23:08 -0700234 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700235
236 mDevelopmentPreferences.unregisterOnSharedPreferenceChangeListener(
237 mDevelopmentPreferencesListener);
238 mDevelopmentPreferencesListener = null;
Amith Yamasani86708a82012-06-06 20:23:08 -0700239 }
240
241 @Override
242 public void onDestroy() {
243 super.onDestroy();
244 if (mListeningToAccountUpdates) {
Amith Yamasani56821db2012-06-05 13:20:45 -0700245 AccountManager.get(this).removeOnAccountsUpdatedListener(this);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700246 }
247 }
248
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800249 private void switchToHeaderLocal(Header header) {
250 mInLocalHeaderSwitch = true;
251 switchToHeader(header);
252 mInLocalHeaderSwitch = false;
253 }
254
255 @Override
256 public void switchToHeader(Header header) {
257 if (!mInLocalHeaderSwitch) {
258 mCurrentHeader = null;
259 mParentHeader = null;
260 }
261 super.switchToHeader(header);
262 }
263
264 /**
265 * Switch to parent fragment and store the grand parent's info
Jake Hamby2748fc22011-01-12 15:06:28 -0800266 * @param className name of the activity wrapper for the parent fragment.
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800267 */
268 private void switchToParent(String className) {
269 final ComponentName cn = new ComponentName(this, className);
270 try {
271 final PackageManager pm = getPackageManager();
272 final ActivityInfo parentInfo = pm.getActivityInfo(cn, PackageManager.GET_META_DATA);
273
274 if (parentInfo != null && parentInfo.metaData != null) {
275 String fragmentClass = parentInfo.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
276 CharSequence fragmentTitle = parentInfo.loadLabel(pm);
277 Header parentHeader = new Header();
278 parentHeader.fragment = fragmentClass;
279 parentHeader.title = fragmentTitle;
280 mCurrentHeader = parentHeader;
281
282 switchToHeaderLocal(parentHeader);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700283 highlightHeader(mTopLevelHeaderId);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800284
285 mParentHeader = new Header();
286 mParentHeader.fragment
287 = parentInfo.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
288 mParentHeader.title = parentInfo.metaData.getString(META_DATA_KEY_PARENT_TITLE);
289 }
290 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700291 Log.w(LOG_TAG, "Could not find parent activity : " + className);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800292 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700293 }
294
Amith Yamasani3965ae62010-11-15 14:45:19 -0800295 @Override
296 public void onNewIntent(Intent intent) {
297 super.onNewIntent(intent);
298
299 // If it is not launched from history, then reset to top-level
Amith Yamasanief617232012-10-09 16:57:25 -0700300 if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
301 if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
302 switchToHeaderLocal(mFirstHeader);
303 }
304 getListView().setSelectionFromTop(0, 0);
Amith Yamasani3965ae62010-11-15 14:45:19 -0800305 }
306 }
307
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700308 private void highlightHeader(int id) {
309 if (id != 0) {
310 Integer index = mHeaderIndexMap.get(id);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700311 if (index != null) {
312 getListView().setItemChecked(index, true);
Amith Yamasanief617232012-10-09 16:57:25 -0700313 if (isMultiPane()) {
314 getListView().smoothScrollToPosition(index);
315 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700316 }
317 }
318 }
319
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700320 @Override
321 public Intent getIntent() {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700322 Intent superIntent = super.getIntent();
323 String startingFragment = getStartingFragmentClass(superIntent);
Gilles Debunne3661b622011-06-27 11:19:16 -0700324 // This is called from super.onCreate, isMultiPane() is not yet reliable
325 // Do not use onIsHidingHeaders either, which relies itself on this method
326 if (startingFragment != null && !onIsMultiPane()) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700327 Intent modIntent = new Intent(superIntent);
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700328 modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700329 Bundle args = superIntent.getExtras();
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700330 if (args != null) {
331 args = new Bundle(args);
332 } else {
333 args = new Bundle();
334 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700335 args.putParcelable("intent", superIntent);
336 modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, superIntent.getExtras());
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700337 return modIntent;
338 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700339 return superIntent;
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700340 }
341
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700342 /**
Amith Yamasani379d9b02010-09-27 12:03:59 -0700343 * Checks if the component name in the intent is different from the Settings class and
344 * returns the class name to load as a fragment.
345 */
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700346 protected String getStartingFragmentClass(Intent intent) {
347 if (mFragmentClass != null) return mFragmentClass;
348
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700349 String intentClass = intent.getComponent().getClassName();
Amith Yamasani379d9b02010-09-27 12:03:59 -0700350 if (intentClass.equals(getClass().getName())) return null;
351
Dianne Hackbornee293792010-11-01 12:32:33 -0700352 if ("com.android.settings.ManageApplications".equals(intentClass)
353 || "com.android.settings.RunningServices".equals(intentClass)
354 || "com.android.settings.applications.StorageUse".equals(intentClass)) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700355 // Old names of manage apps.
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700356 intentClass = com.android.settings.applications.ManageApplications.class.getName();
357 }
358
Amith Yamasani379d9b02010-09-27 12:03:59 -0700359 return intentClass;
360 }
361
362 /**
363 * Override initial header when an activity-alias is causing Settings to be launched
364 * for a specific fragment encoded in the android:name parameter.
365 */
366 @Override
367 public Header onGetInitialHeader() {
368 String fragmentClass = getStartingFragmentClass(super.getIntent());
369 if (fragmentClass != null) {
370 Header header = new Header();
371 header.fragment = fragmentClass;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800372 header.title = getTitle();
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700373 header.fragmentArguments = getIntent().getExtras();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800374 mCurrentHeader = header;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700375 return header;
376 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700377
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700378 return mFirstHeader;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700379 }
380
Dianne Hackbornb7258182011-03-15 16:23:55 -0700381 @Override
Dianne Hackborn48147dc2011-03-18 12:29:41 -0700382 public Intent onBuildStartFragmentIntent(String fragmentName, Bundle args,
383 int titleRes, int shortTitleRes) {
384 Intent intent = super.onBuildStartFragmentIntent(fragmentName, args,
385 titleRes, shortTitleRes);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700386
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800387 // Some fragments want split ActionBar; these should stay in sync with
388 // uiOptions for fragments also defined as activities in manifest.
389 if (WifiSettings.class.getName().equals(fragmentName) ||
390 WifiP2pSettings.class.getName().equals(fragmentName) ||
Jeff Sharkey0c3634c2013-02-20 12:35:16 -0800391 WifiDisplaySettings.class.getName().equals(fragmentName) ||
Jeff Sharkeycc0d26b2012-11-27 16:42:27 -0800392 BluetoothSettings.class.getName().equals(fragmentName) ||
393 DreamSettings.class.getName().equals(fragmentName) ||
394 ToggleAccessibilityServicePreferenceFragment.class.getName().equals(fragmentName)) {
395 intent.putExtra(EXTRA_UI_OPTIONS, ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700396 }
397
Dianne Hackbornb7258182011-03-15 16:23:55 -0700398 intent.setClass(this, SubSettings.class);
399 return intent;
400 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700401
Amith Yamasani379d9b02010-09-27 12:03:59 -0700402 /**
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700403 * Populate the activity with the top-level headers.
404 */
Amith Yamasanid7993472010-08-18 13:59:28 -0700405 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700406 public void onBuildHeaders(List<Header> headers) {
407 loadHeadersFromResource(R.xml.settings_headers, headers);
Amith Yamasanid7993472010-08-18 13:59:28 -0700408
Gilles Debunnee78c1872011-06-20 15:00:07 -0700409 updateHeaderList(headers);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700410 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700411
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700412 private void updateHeaderList(List<Header> target) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700413 final boolean showDev = mDevelopmentPreferences.getBoolean(
414 DevelopmentSettings.PREF_SHOW,
415 android.os.Build.TYPE.equals("eng"));
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700416 int i = 0;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700417 mHeaderIndexMap.clear();
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700418 while (i < target.size()) {
419 Header header = target.get(i);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700420 // Ids are integers, so downcasting
421 int id = (int) header.id;
Chris Wren2bc32ae2012-09-24 14:23:46 -0400422 if (id == R.id.operator_settings || id == R.id.manufacturer_settings) {
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700423 Utils.updateHeaderToSpecificActivityFromMetaDataOrRemove(this, target, header);
Gilles Debunne2454f492011-06-21 16:16:06 -0700424 } else if (id == R.id.wifi_settings) {
425 // Remove WiFi Settings if WiFi service is not available.
426 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700427 target.remove(i);
Gilles Debunne2454f492011-06-21 16:16:06 -0700428 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700429 } else if (id == R.id.bluetooth_settings) {
430 // Remove Bluetooth Settings if Bluetooth service is not available.
Gilles Debunne2454f492011-06-21 16:16:06 -0700431 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700432 target.remove(i);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700433 }
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700434 } else if (id == R.id.data_usage_settings) {
435 // Remove data usage when kernel module not enabled
436 final INetworkManagementService netManager = INetworkManagementService.Stub
437 .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
438 try {
439 if (!netManager.isBandwidthControlEnabled()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700440 target.remove(i);
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700441 }
442 } catch (RemoteException e) {
443 // ignored
444 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700445 } else if (id == R.id.account_settings) {
446 int headerIndex = i + 1;
447 i = insertAccountsHeaders(target, headerIndex);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700448 } else if (id == R.id.user_settings) {
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700449 if (!UserHandle.MU_ENABLED
Jeff Sharkey44202462012-09-19 13:13:45 -0700450 || !UserManager.supportsMultipleUsers()
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700451 || Utils.isMonkeyRunning()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700452 target.remove(i);
453 }
454 } else if (id == R.id.development_settings) {
455 if (!showDev) {
456 target.remove(i);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700457 }
Amith Yamasani233592b2013-03-01 17:05:23 -0800458 } else if (id == R.id.application_settings) {
459 if (mAppRestrictions != null) {
460 for (RestrictionEntry entry : mAppRestrictions) {
461 if (entry.key.equals(RestrictionsReceiver.KEY_ENABLE_APPS)
462 && !entry.getBooleanValue()) {
463 target.remove(i);
464 }
465 }
466 }
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700467 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700468
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900469 if (i < target.size() && target.get(i) == header
Amith Yamasanib99f8642012-10-10 21:41:12 -0700470 && UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700471 && !ArrayUtils.contains(SETTINGS_FOR_RESTRICTED, id)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700472 target.remove(i);
Amith Yamasanid7993472010-08-18 13:59:28 -0700473 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700474
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700475 // Increment if the current one wasn't removed by the Utils code.
Jaewan Kimbb0e6212013-02-04 15:36:17 +0900476 if (i < target.size() && target.get(i) == header) {
Amith Yamasani3965ae62010-11-15 14:45:19 -0800477 // Hold on to the first header, when we need to reset to the top-level
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700478 if (mFirstHeader == null &&
479 HeaderAdapter.getHeaderType(header) != HeaderAdapter.HEADER_TYPE_CATEGORY) {
480 mFirstHeader = header;
481 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700482 mHeaderIndexMap.put(id, i);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700483 i++;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700484 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700485 }
486 }
487
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700488 private int insertAccountsHeaders(List<Header> target, int headerIndex) {
489 String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
490 List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length);
491 for (String accountType : accountTypes) {
492 CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType);
Brian Muramatsuc28af522012-06-28 14:25:14 -0700493 if (label == null) {
494 continue;
495 }
496
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700497 Account[] accounts = AccountManager.get(this).getAccountsByType(accountType);
498 boolean skipToAccount = accounts.length == 1
499 && !mAuthenticatorHelper.hasAccountPreferences(accountType);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700500 Header accHeader = new Header();
501 accHeader.title = label;
502 if (accHeader.extras == null) {
503 accHeader.extras = new Bundle();
504 }
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700505 if (skipToAccount) {
506 accHeader.breadCrumbTitleRes = R.string.account_sync_settings_title;
507 accHeader.breadCrumbShortTitleRes = R.string.account_sync_settings_title;
508 accHeader.fragment = AccountSyncSettings.class.getName();
509 accHeader.fragmentArguments = new Bundle();
510 // Need this for the icon
511 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
512 accHeader.extras.putParcelable(AccountSyncSettings.ACCOUNT_KEY, accounts[0]);
513 accHeader.fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
514 accounts[0]);
515 } else {
516 accHeader.breadCrumbTitle = label;
517 accHeader.breadCrumbShortTitle = label;
518 accHeader.fragment = ManageAccountsSettings.class.getName();
519 accHeader.fragmentArguments = new Bundle();
520 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
521 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE,
522 accountType);
523 if (!isMultiPane()) {
524 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
525 label.toString());
526 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700527 }
528 accountHeaders.add(accHeader);
529 }
530
531 // Sort by label
532 Collections.sort(accountHeaders, new Comparator<Header>() {
533 @Override
534 public int compare(Header h1, Header h2) {
535 return h1.title.toString().compareTo(h2.title.toString());
536 }
537 });
538
539 for (Header header : accountHeaders) {
540 target.add(headerIndex++, header);
541 }
Amith Yamasani86708a82012-06-06 20:23:08 -0700542 if (!mListeningToAccountUpdates) {
543 AccountManager.get(this).addOnAccountsUpdatedListener(this, null, true);
544 mListeningToAccountUpdates = true;
545 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700546 return headerIndex;
547 }
548
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700549 private void getMetaData() {
550 try {
551 ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
552 PackageManager.GET_META_DATA);
553 if (ai == null || ai.metaData == null) return;
554 mTopLevelHeaderId = ai.metaData.getInt(META_DATA_KEY_HEADER_ID);
555 mFragmentClass = ai.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700556
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800557 // Check if it has a parent specified and create a Header object
558 final int parentHeaderTitleRes = ai.metaData.getInt(META_DATA_KEY_PARENT_TITLE);
559 String parentFragmentClass = ai.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
560 if (parentFragmentClass != null) {
561 mParentHeader = new Header();
562 mParentHeader.fragment = parentFragmentClass;
563 if (parentHeaderTitleRes != 0) {
564 mParentHeader.title = getResources().getString(parentHeaderTitleRes);
565 }
566 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700567 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700568 // No recovery
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700569 }
570 }
571
Amith Yamasani9e3a4702011-01-11 09:09:26 -0800572 @Override
573 public boolean hasNextButton() {
574 return super.hasNextButton();
575 }
576
577 @Override
578 public Button getNextButton() {
579 return super.getNextButton();
580 }
581
Gilles Debunnee78c1872011-06-20 15:00:07 -0700582 private static class HeaderAdapter extends ArrayAdapter<Header> {
583 static final int HEADER_TYPE_CATEGORY = 0;
584 static final int HEADER_TYPE_NORMAL = 1;
585 static final int HEADER_TYPE_SWITCH = 2;
586 private static final int HEADER_TYPE_COUNT = HEADER_TYPE_SWITCH + 1;
587
588 private final WifiEnabler mWifiEnabler;
589 private final BluetoothEnabler mBluetoothEnabler;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700590 private AuthenticatorHelper mAuthHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700591
592 private static class HeaderViewHolder {
593 ImageView icon;
594 TextView title;
595 TextView summary;
596 Switch switch_;
597 }
598
599 private LayoutInflater mInflater;
600
601 static int getHeaderType(Header header) {
602 if (header.fragment == null && header.intent == null) {
603 return HEADER_TYPE_CATEGORY;
604 } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
605 return HEADER_TYPE_SWITCH;
606 } else {
607 return HEADER_TYPE_NORMAL;
608 }
609 }
610
611 @Override
612 public int getItemViewType(int position) {
613 Header header = getItem(position);
614 return getHeaderType(header);
615 }
616
617 @Override
618 public boolean areAllItemsEnabled() {
619 return false; // because of categories
620 }
621
622 @Override
623 public boolean isEnabled(int position) {
624 return getItemViewType(position) != HEADER_TYPE_CATEGORY;
625 }
626
627 @Override
628 public int getViewTypeCount() {
629 return HEADER_TYPE_COUNT;
630 }
631
632 @Override
633 public boolean hasStableIds() {
634 return true;
635 }
636
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700637 public HeaderAdapter(Context context, List<Header> objects,
638 AuthenticatorHelper authenticatorHelper) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700639 super(context, 0, objects);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700640
641 mAuthHelper = authenticatorHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700642 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700643
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700644 // Temp Switches provided as placeholder until the adapter replaces these with actual
Gilles Debunnee78c1872011-06-20 15:00:07 -0700645 // Switches inflated from their layouts. Must be done before adapter is set in super
646 mWifiEnabler = new WifiEnabler(context, new Switch(context));
647 mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
648 }
649
650 @Override
651 public View getView(int position, View convertView, ViewGroup parent) {
652 HeaderViewHolder holder;
653 Header header = getItem(position);
654 int headerType = getHeaderType(header);
655 View view = null;
656
657 if (convertView == null) {
658 holder = new HeaderViewHolder();
659 switch (headerType) {
660 case HEADER_TYPE_CATEGORY:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700661 view = new TextView(getContext(), null,
662 android.R.attr.listSeparatorTextViewStyle);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700663 holder.title = (TextView) view;
664 break;
665
666 case HEADER_TYPE_SWITCH:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700667 view = mInflater.inflate(R.layout.preference_header_switch_item, parent,
668 false);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700669 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700670 holder.title = (TextView)
671 view.findViewById(com.android.internal.R.id.title);
672 holder.summary = (TextView)
673 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700674 holder.switch_ = (Switch) view.findViewById(R.id.switchWidget);
675 break;
676
677 case HEADER_TYPE_NORMAL:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700678 view = mInflater.inflate(
Amith Yamasanic8a93172012-06-08 13:35:47 -0700679 R.layout.preference_header_item, parent,
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700680 false);
Amith Yamasanic8a93172012-06-08 13:35:47 -0700681 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700682 holder.title = (TextView)
683 view.findViewById(com.android.internal.R.id.title);
684 holder.summary = (TextView)
685 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700686 break;
687 }
688 view.setTag(holder);
689 } else {
690 view = convertView;
691 holder = (HeaderViewHolder) view.getTag();
692 }
693
694 // All view fields must be updated every time, because the view may be recycled
695 switch (headerType) {
696 case HEADER_TYPE_CATEGORY:
697 holder.title.setText(header.getTitle(getContext().getResources()));
698 break;
699
700 case HEADER_TYPE_SWITCH:
701 // Would need a different treatment if the main menu had more switches
702 if (header.id == R.id.wifi_settings) {
703 mWifiEnabler.setSwitch(holder.switch_);
704 } else {
705 mBluetoothEnabler.setSwitch(holder.switch_);
706 }
707 // No break, fall through on purpose to update common fields
708
709 //$FALL-THROUGH$
710 case HEADER_TYPE_NORMAL:
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700711 if (header.extras != null
712 && header.extras.containsKey(ManageAccountsSettings.KEY_ACCOUNT_TYPE)) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700713 String accType = header.extras.getString(
714 ManageAccountsSettings.KEY_ACCOUNT_TYPE);
715 ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
716 lp.width = getContext().getResources().getDimensionPixelSize(
717 R.dimen.header_icon_width);
718 lp.height = lp.width;
719 holder.icon.setLayoutParams(lp);
720 Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
721 holder.icon.setImageDrawable(icon);
722 } else {
723 holder.icon.setImageResource(header.iconRes);
724 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700725 holder.title.setText(header.getTitle(getContext().getResources()));
726 CharSequence summary = header.getSummary(getContext().getResources());
727 if (!TextUtils.isEmpty(summary)) {
728 holder.summary.setVisibility(View.VISIBLE);
729 holder.summary.setText(summary);
730 } else {
731 holder.summary.setVisibility(View.GONE);
732 }
733 break;
734 }
735
736 return view;
737 }
738
739 public void resume() {
740 mWifiEnabler.resume();
741 mBluetoothEnabler.resume();
742 }
Brian Muramatsuc28af522012-06-28 14:25:14 -0700743
Gilles Debunnee78c1872011-06-20 15:00:07 -0700744 public void pause() {
745 mWifiEnabler.pause();
746 mBluetoothEnabler.pause();
747 }
748 }
749
750 @Override
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700751 public void onHeaderClick(Header header, int position) {
752 boolean revert = false;
753 if (header.id == R.id.account_add) {
754 revert = true;
755 }
756
757 super.onHeaderClick(header, position);
758
759 if (revert && mLastHeader != null) {
760 highlightHeader((int) mLastHeader.id);
761 } else {
762 mLastHeader = header;
763 }
764 }
765
766 @Override
Amith Yamasania4379d62011-07-22 10:34:58 -0700767 public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
768 // Override the fragment title for Wallpaper settings
Amith Yamasanidfb65432011-11-29 16:38:14 -0800769 int titleRes = pref.getTitleRes();
Amith Yamasania4379d62011-07-22 10:34:58 -0700770 if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
Amith Yamasanidfb65432011-11-29 16:38:14 -0800771 titleRes = R.string.wallpaper_settings_fragment_title;
Amith Yamasani8666b9e2012-09-27 14:50:13 -0700772 } else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
773 && UserHandle.myUserId() != UserHandle.USER_OWNER) {
774 titleRes = R.string.user_info_settings_title;
Amith Yamasania4379d62011-07-22 10:34:58 -0700775 }
Jean Chalard7dabe452012-05-10 18:08:07 +0900776 startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
777 null, 0);
Amith Yamasania4379d62011-07-22 10:34:58 -0700778 return true;
779 }
780
Amith Yamasani3d384f42012-05-11 15:22:04 -0700781 public boolean shouldUpRecreateTask(Intent targetIntent) {
782 return super.shouldUpRecreateTask(new Intent(this, Settings.class));
783 }
784
Amith Yamasania4379d62011-07-22 10:34:58 -0700785 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700786 public void setListAdapter(ListAdapter adapter) {
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700787 if (adapter == null) {
788 super.setListAdapter(null);
789 } else {
790 super.setListAdapter(new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper));
Gilles Debunnee78c1872011-06-20 15:00:07 -0700791 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700792 }
793
Amith Yamasani56821db2012-06-05 13:20:45 -0700794 @Override
795 public void onAccountsUpdated(Account[] accounts) {
Jeff Sharkey9ff79c12012-10-03 16:48:17 -0700796 // TODO: watch for package upgrades to invalidate cache; see 7206643
797 mAuthenticatorHelper.updateAuthDescriptions(this);
Amith Yamasani56821db2012-06-05 13:20:45 -0700798 mAuthenticatorHelper.onAccountsUpdated(this, accounts);
799 invalidateHeaders();
800 }
801
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700802 /*
803 * Settings subclasses for launching independently.
804 */
Gilles Debunnee78c1872011-06-20 15:00:07 -0700805 public static class BluetoothSettingsActivity extends Settings { /* empty */ }
806 public static class WirelessSettingsActivity extends Settings { /* empty */ }
807 public static class TetherSettingsActivity extends Settings { /* empty */ }
808 public static class VpnSettingsActivity extends Settings { /* empty */ }
809 public static class DateTimeSettingsActivity extends Settings { /* empty */ }
810 public static class StorageSettingsActivity extends Settings { /* empty */ }
811 public static class WifiSettingsActivity extends Settings { /* empty */ }
repo syncb98463f2011-06-30 10:58:43 -0700812 public static class WifiP2pSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700813 public static class InputMethodAndLanguageSettingsActivity extends Settings { /* empty */ }
Jeff Browne46c5f32012-04-05 11:42:18 -0700814 public static class KeyboardLayoutPickerActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700815 public static class InputMethodAndSubtypeEnablerActivity extends Settings { /* empty */ }
satoke077d2b2011-07-25 09:38:11 +0900816 public static class SpellCheckersSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700817 public static class LocalePickerActivity extends Settings { /* empty */ }
818 public static class UserDictionarySettingsActivity extends Settings { /* empty */ }
819 public static class SoundSettingsActivity extends Settings { /* empty */ }
820 public static class DisplaySettingsActivity extends Settings { /* empty */ }
821 public static class DeviceInfoSettingsActivity extends Settings { /* empty */ }
822 public static class ApplicationSettingsActivity extends Settings { /* empty */ }
823 public static class ManageApplicationsActivity extends Settings { /* empty */ }
Dianne Hackborna522a8e2013-01-15 19:02:05 -0800824 public static class AppOpsSummaryActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700825 public static class StorageUseActivity extends Settings { /* empty */ }
826 public static class DevelopmentSettingsActivity extends Settings { /* empty */ }
827 public static class AccessibilitySettingsActivity extends Settings { /* empty */ }
828 public static class SecuritySettingsActivity extends Settings { /* empty */ }
Gilles Debunnea6a8a142011-06-09 11:56:17 -0700829 public static class LocationSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700830 public static class PrivacySettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700831 public static class RunningServicesActivity extends Settings { /* empty */ }
832 public static class ManageAccountsSettingsActivity extends Settings { /* empty */ }
833 public static class PowerUsageSummaryActivity extends Settings { /* empty */ }
834 public static class AccountSyncSettingsActivity extends Settings { /* empty */ }
835 public static class AccountSyncSettingsInAddAccountActivity extends Settings { /* empty */ }
836 public static class CryptKeeperSettingsActivity extends Settings { /* empty */ }
837 public static class DeviceAdminSettingsActivity extends Settings { /* empty */ }
838 public static class DataUsageSummaryActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700839 public static class AdvancedWifiSettingsActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700840 public static class TextToSpeechSettingsActivity extends Settings { /* empty */ }
Jeff Hamilton3d670de2011-09-21 16:44:36 -0500841 public static class AndroidBeamSettingsActivity extends Settings { /* empty */ }
Jeff Brown9e143f52012-09-19 20:46:07 -0700842 public static class WifiDisplaySettingsActivity extends Settings { /* empty */ }
Daniel Sandler7dee75c2012-11-27 22:41:30 -0500843 public static class DreamSettingsActivity extends Settings { /* empty */ }
Daniel Sandler328e2d22013-01-17 13:14:02 -0500844 public static class NotificationStationActivity extends Settings { /* empty */ }
Amith Yamasani233592b2013-03-01 17:05:23 -0800845 public static class UserSettingsActivity extends Settings { /* empty */ }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800846}