blob: 4314f2d7eb993e2937b32ab4d7f68827a0cf53e9 [file] [log] [blame]
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.settings;
18
Amith Yamasanib810a0d2012-03-25 10:12:26 -070019import com.android.internal.util.ArrayUtils;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070020import com.android.settings.accounts.AccountSyncSettings;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070021import com.android.settings.accounts.AuthenticatorHelper;
22import com.android.settings.accounts.ManageAccountsSettings;
Adam Powell7474bc32012-09-30 18:21:14 -070023import com.android.settings.applications.InstalledAppDetails;
Adam Powellfaba7e42012-03-26 17:28:38 -070024import com.android.settings.applications.ManageApplications;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070025import com.android.settings.bluetooth.BluetoothEnabler;
Jeff Sharkey11d30122012-03-19 16:54:07 -070026import com.android.settings.deviceinfo.Memory;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070027import com.android.settings.fuelgauge.PowerUsageSummary;
Jeff Sharkey9fd7ac12012-08-25 00:06:08 -070028import com.android.settings.vpn2.VpnSettings;
Gilles Debunnecd8e5242011-07-25 11:36:15 -070029import com.android.settings.wifi.WifiEnabler;
30
Amith Yamasani56821db2012-06-05 13:20:45 -070031import android.accounts.Account;
32import android.accounts.AccountManager;
33import android.accounts.OnAccountsUpdateListener;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080034import android.content.ComponentName;
Gilles Debunnee78c1872011-06-20 15:00:07 -070035import android.content.Context;
Amith Yamasani379d9b02010-09-27 12:03:59 -070036import android.content.Intent;
Dianne Hackborncaefa9b2012-10-10 15:05:42 -070037import android.content.SharedPreferences;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070038import android.content.pm.ActivityInfo;
39import android.content.pm.PackageManager;
40import android.content.pm.PackageManager.NameNotFoundException;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070041import android.graphics.drawable.Drawable;
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -070042import android.os.Bundle;
Jeff Sharkey34e964d2012-04-21 15:41:48 -070043import android.os.INetworkManagementService;
44import android.os.RemoteException;
45import android.os.ServiceManager;
Dianne Hackbornbb06a422012-08-16 11:01:57 -070046import android.os.UserHandle;
Jeff Sharkey44202462012-09-19 13:13:45 -070047import android.os.UserManager;
Amith Yamasania4379d62011-07-22 10:34:58 -070048import android.preference.Preference;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070049import android.preference.PreferenceActivity;
Amith Yamasania4379d62011-07-22 10:34:58 -070050import android.preference.PreferenceFragment;
Gilles Debunnee78c1872011-06-20 15:00:07 -070051import android.text.TextUtils;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080052import android.util.Log;
Gilles Debunnee78c1872011-06-20 15:00:07 -070053import android.view.LayoutInflater;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080054import android.view.View;
55import android.view.View.OnClickListener;
Gilles Debunnee78c1872011-06-20 15:00:07 -070056import android.view.ViewGroup;
57import android.widget.ArrayAdapter;
Amith Yamasani9e3a4702011-01-11 09:09:26 -080058import android.widget.Button;
Gilles Debunnee78c1872011-06-20 15:00:07 -070059import android.widget.ImageView;
60import android.widget.ListAdapter;
61import android.widget.Switch;
62import android.widget.TextView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080063
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 Sharkey54d0af52011-08-11 18:26:57 -070087 private static final String EXTRA_CLEAR_UI_OPTIONS = "settings:remove_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 Sharkey54d0af52011-08-11 18:26:57 -0700138 if (getIntent().getBooleanExtra(EXTRA_CLEAR_UI_OPTIONS, false)) {
139 getWindow().setUiOptions(0);
140 }
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 Sharkey54d0af52011-08-11 18:26:57 -0700381 // some fragments want to avoid split actionbar
Gilles Debunne162e5412011-07-11 14:13:31 -0700382 if (DataUsageSummary.class.getName().equals(fragmentName) ||
383 PowerUsageSummary.class.getName().equals(fragmentName) ||
Gilles Debunnecd8e5242011-07-25 11:36:15 -0700384 AccountSyncSettings.class.getName().equals(fragmentName) ||
Jeff Sharkey11d30122012-03-19 16:54:07 -0700385 UserDictionarySettings.class.getName().equals(fragmentName) ||
Adam Powellfaba7e42012-03-26 17:28:38 -0700386 Memory.class.getName().equals(fragmentName) ||
Jeff Sharkeya339cba2012-05-08 11:42:49 -0700387 ManageApplications.class.getName().equals(fragmentName) ||
388 WirelessSettings.class.getName().equals(fragmentName) ||
389 SoundSettings.class.getName().equals(fragmentName) ||
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700390 PrivacySettings.class.getName().equals(fragmentName) ||
Jeff Sharkey9fd7ac12012-08-25 00:06:08 -0700391 ManageAccountsSettings.class.getName().equals(fragmentName) ||
rich cannings93c0ee52012-09-30 13:54:26 -0700392 VpnSettings.class.getName().equals(fragmentName) ||
Adam Powell7474bc32012-09-30 18:21:14 -0700393 SecuritySettings.class.getName().equals(fragmentName) ||
394 InstalledAppDetails.class.getName().equals(fragmentName)) {
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700395 intent.putExtra(EXTRA_CLEAR_UI_OPTIONS, true);
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
418 mHeaderIndexMap.clear();
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700419 while (i < target.size()) {
420 Header header = target.get(i);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700421 // Ids are integers, so downcasting
422 int id = (int) header.id;
Chris Wren2bc32ae2012-09-24 14:23:46 -0400423 if (id == R.id.operator_settings || id == R.id.manufacturer_settings) {
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700424 Utils.updateHeaderToSpecificActivityFromMetaDataOrRemove(this, target, header);
Gilles Debunne2454f492011-06-21 16:16:06 -0700425 } else if (id == R.id.wifi_settings) {
426 // Remove WiFi Settings if WiFi service is not available.
427 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700428 target.remove(i);
Gilles Debunne2454f492011-06-21 16:16:06 -0700429 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700430 } else if (id == R.id.bluetooth_settings) {
431 // Remove Bluetooth Settings if Bluetooth service is not available.
Gilles Debunne2454f492011-06-21 16:16:06 -0700432 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700433 target.remove(i);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700434 }
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700435 } else if (id == R.id.data_usage_settings) {
436 // Remove data usage when kernel module not enabled
437 final INetworkManagementService netManager = INetworkManagementService.Stub
438 .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
439 try {
440 if (!netManager.isBandwidthControlEnabled()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700441 target.remove(i);
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700442 }
443 } catch (RemoteException e) {
444 // ignored
445 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700446 } else if (id == R.id.account_settings) {
447 int headerIndex = i + 1;
448 i = insertAccountsHeaders(target, headerIndex);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700449 } else if (id == R.id.user_settings) {
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700450 if (!UserHandle.MU_ENABLED
Jeff Sharkey44202462012-09-19 13:13:45 -0700451 || !UserManager.supportsMultipleUsers()
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700452 || Utils.isMonkeyRunning()) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700453 target.remove(i);
454 }
455 } else if (id == R.id.development_settings) {
456 if (!showDev) {
457 target.remove(i);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700458 }
459 }
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700460
Dianne Hackbornbb06a422012-08-16 11:01:57 -0700461 if (UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700462 && !ArrayUtils.contains(SETTINGS_FOR_RESTRICTED, id)) {
Dianne Hackborncaefa9b2012-10-10 15:05:42 -0700463 target.remove(i);
Amith Yamasanid7993472010-08-18 13:59:28 -0700464 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700465
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700466 // Increment if the current one wasn't removed by the Utils code.
467 if (target.get(i) == header) {
Amith Yamasani3965ae62010-11-15 14:45:19 -0800468 // Hold on to the first header, when we need to reset to the top-level
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700469 if (mFirstHeader == null &&
470 HeaderAdapter.getHeaderType(header) != HeaderAdapter.HEADER_TYPE_CATEGORY) {
471 mFirstHeader = header;
472 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700473 mHeaderIndexMap.put(id, i);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700474 i++;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700475 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700476 }
477 }
478
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700479 private int insertAccountsHeaders(List<Header> target, int headerIndex) {
480 String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
481 List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length);
482 for (String accountType : accountTypes) {
483 CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType);
Brian Muramatsuc28af522012-06-28 14:25:14 -0700484 if (label == null) {
485 continue;
486 }
487
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700488 Account[] accounts = AccountManager.get(this).getAccountsByType(accountType);
489 boolean skipToAccount = accounts.length == 1
490 && !mAuthenticatorHelper.hasAccountPreferences(accountType);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700491 Header accHeader = new Header();
492 accHeader.title = label;
493 if (accHeader.extras == null) {
494 accHeader.extras = new Bundle();
495 }
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700496 if (skipToAccount) {
497 accHeader.breadCrumbTitleRes = R.string.account_sync_settings_title;
498 accHeader.breadCrumbShortTitleRes = R.string.account_sync_settings_title;
499 accHeader.fragment = AccountSyncSettings.class.getName();
500 accHeader.fragmentArguments = new Bundle();
501 // Need this for the icon
502 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
503 accHeader.extras.putParcelable(AccountSyncSettings.ACCOUNT_KEY, accounts[0]);
504 accHeader.fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
505 accounts[0]);
506 } else {
507 accHeader.breadCrumbTitle = label;
508 accHeader.breadCrumbShortTitle = label;
509 accHeader.fragment = ManageAccountsSettings.class.getName();
510 accHeader.fragmentArguments = new Bundle();
511 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
512 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE,
513 accountType);
514 if (!isMultiPane()) {
515 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
516 label.toString());
517 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700518 }
519 accountHeaders.add(accHeader);
520 }
521
522 // Sort by label
523 Collections.sort(accountHeaders, new Comparator<Header>() {
524 @Override
525 public int compare(Header h1, Header h2) {
526 return h1.title.toString().compareTo(h2.title.toString());
527 }
528 });
529
530 for (Header header : accountHeaders) {
531 target.add(headerIndex++, header);
532 }
Amith Yamasani86708a82012-06-06 20:23:08 -0700533 if (!mListeningToAccountUpdates) {
534 AccountManager.get(this).addOnAccountsUpdatedListener(this, null, true);
535 mListeningToAccountUpdates = true;
536 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700537 return headerIndex;
538 }
539
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700540 private void getMetaData() {
541 try {
542 ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
543 PackageManager.GET_META_DATA);
544 if (ai == null || ai.metaData == null) return;
545 mTopLevelHeaderId = ai.metaData.getInt(META_DATA_KEY_HEADER_ID);
546 mFragmentClass = ai.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700547
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800548 // Check if it has a parent specified and create a Header object
549 final int parentHeaderTitleRes = ai.metaData.getInt(META_DATA_KEY_PARENT_TITLE);
550 String parentFragmentClass = ai.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
551 if (parentFragmentClass != null) {
552 mParentHeader = new Header();
553 mParentHeader.fragment = parentFragmentClass;
554 if (parentHeaderTitleRes != 0) {
555 mParentHeader.title = getResources().getString(parentHeaderTitleRes);
556 }
557 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700558 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700559 // No recovery
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700560 }
561 }
562
Amith Yamasani9e3a4702011-01-11 09:09:26 -0800563 @Override
564 public boolean hasNextButton() {
565 return super.hasNextButton();
566 }
567
568 @Override
569 public Button getNextButton() {
570 return super.getNextButton();
571 }
572
Gilles Debunnee78c1872011-06-20 15:00:07 -0700573 private static class HeaderAdapter extends ArrayAdapter<Header> {
574 static final int HEADER_TYPE_CATEGORY = 0;
575 static final int HEADER_TYPE_NORMAL = 1;
576 static final int HEADER_TYPE_SWITCH = 2;
577 private static final int HEADER_TYPE_COUNT = HEADER_TYPE_SWITCH + 1;
578
579 private final WifiEnabler mWifiEnabler;
580 private final BluetoothEnabler mBluetoothEnabler;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700581 private AuthenticatorHelper mAuthHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700582
583 private static class HeaderViewHolder {
584 ImageView icon;
585 TextView title;
586 TextView summary;
587 Switch switch_;
588 }
589
590 private LayoutInflater mInflater;
591
592 static int getHeaderType(Header header) {
593 if (header.fragment == null && header.intent == null) {
594 return HEADER_TYPE_CATEGORY;
595 } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
596 return HEADER_TYPE_SWITCH;
597 } else {
598 return HEADER_TYPE_NORMAL;
599 }
600 }
601
602 @Override
603 public int getItemViewType(int position) {
604 Header header = getItem(position);
605 return getHeaderType(header);
606 }
607
608 @Override
609 public boolean areAllItemsEnabled() {
610 return false; // because of categories
611 }
612
613 @Override
614 public boolean isEnabled(int position) {
615 return getItemViewType(position) != HEADER_TYPE_CATEGORY;
616 }
617
618 @Override
619 public int getViewTypeCount() {
620 return HEADER_TYPE_COUNT;
621 }
622
623 @Override
624 public boolean hasStableIds() {
625 return true;
626 }
627
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700628 public HeaderAdapter(Context context, List<Header> objects,
629 AuthenticatorHelper authenticatorHelper) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700630 super(context, 0, objects);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700631
632 mAuthHelper = authenticatorHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700633 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700634
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700635 // Temp Switches provided as placeholder until the adapter replaces these with actual
Gilles Debunnee78c1872011-06-20 15:00:07 -0700636 // Switches inflated from their layouts. Must be done before adapter is set in super
637 mWifiEnabler = new WifiEnabler(context, new Switch(context));
638 mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
639 }
640
641 @Override
642 public View getView(int position, View convertView, ViewGroup parent) {
643 HeaderViewHolder holder;
644 Header header = getItem(position);
645 int headerType = getHeaderType(header);
646 View view = null;
647
648 if (convertView == null) {
649 holder = new HeaderViewHolder();
650 switch (headerType) {
651 case HEADER_TYPE_CATEGORY:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700652 view = new TextView(getContext(), null,
653 android.R.attr.listSeparatorTextViewStyle);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700654 holder.title = (TextView) view;
655 break;
656
657 case HEADER_TYPE_SWITCH:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700658 view = mInflater.inflate(R.layout.preference_header_switch_item, parent,
659 false);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700660 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700661 holder.title = (TextView)
662 view.findViewById(com.android.internal.R.id.title);
663 holder.summary = (TextView)
664 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700665 holder.switch_ = (Switch) view.findViewById(R.id.switchWidget);
666 break;
667
668 case HEADER_TYPE_NORMAL:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700669 view = mInflater.inflate(
Amith Yamasanic8a93172012-06-08 13:35:47 -0700670 R.layout.preference_header_item, parent,
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700671 false);
Amith Yamasanic8a93172012-06-08 13:35:47 -0700672 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700673 holder.title = (TextView)
674 view.findViewById(com.android.internal.R.id.title);
675 holder.summary = (TextView)
676 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700677 break;
678 }
679 view.setTag(holder);
680 } else {
681 view = convertView;
682 holder = (HeaderViewHolder) view.getTag();
683 }
684
685 // All view fields must be updated every time, because the view may be recycled
686 switch (headerType) {
687 case HEADER_TYPE_CATEGORY:
688 holder.title.setText(header.getTitle(getContext().getResources()));
689 break;
690
691 case HEADER_TYPE_SWITCH:
692 // Would need a different treatment if the main menu had more switches
693 if (header.id == R.id.wifi_settings) {
694 mWifiEnabler.setSwitch(holder.switch_);
695 } else {
696 mBluetoothEnabler.setSwitch(holder.switch_);
697 }
698 // No break, fall through on purpose to update common fields
699
700 //$FALL-THROUGH$
701 case HEADER_TYPE_NORMAL:
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700702 if (header.extras != null
703 && header.extras.containsKey(ManageAccountsSettings.KEY_ACCOUNT_TYPE)) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700704 String accType = header.extras.getString(
705 ManageAccountsSettings.KEY_ACCOUNT_TYPE);
706 ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
707 lp.width = getContext().getResources().getDimensionPixelSize(
708 R.dimen.header_icon_width);
709 lp.height = lp.width;
710 holder.icon.setLayoutParams(lp);
711 Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
712 holder.icon.setImageDrawable(icon);
713 } else {
714 holder.icon.setImageResource(header.iconRes);
715 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700716 holder.title.setText(header.getTitle(getContext().getResources()));
717 CharSequence summary = header.getSummary(getContext().getResources());
718 if (!TextUtils.isEmpty(summary)) {
719 holder.summary.setVisibility(View.VISIBLE);
720 holder.summary.setText(summary);
721 } else {
722 holder.summary.setVisibility(View.GONE);
723 }
724 break;
725 }
726
727 return view;
728 }
729
730 public void resume() {
731 mWifiEnabler.resume();
732 mBluetoothEnabler.resume();
733 }
Brian Muramatsuc28af522012-06-28 14:25:14 -0700734
Gilles Debunnee78c1872011-06-20 15:00:07 -0700735 public void pause() {
736 mWifiEnabler.pause();
737 mBluetoothEnabler.pause();
738 }
739 }
740
741 @Override
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700742 public void onHeaderClick(Header header, int position) {
743 boolean revert = false;
744 if (header.id == R.id.account_add) {
745 revert = true;
746 }
747
748 super.onHeaderClick(header, position);
749
750 if (revert && mLastHeader != null) {
751 highlightHeader((int) mLastHeader.id);
752 } else {
753 mLastHeader = header;
754 }
755 }
756
757 @Override
Amith Yamasania4379d62011-07-22 10:34:58 -0700758 public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
759 // Override the fragment title for Wallpaper settings
Amith Yamasanidfb65432011-11-29 16:38:14 -0800760 int titleRes = pref.getTitleRes();
Amith Yamasania4379d62011-07-22 10:34:58 -0700761 if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
Amith Yamasanidfb65432011-11-29 16:38:14 -0800762 titleRes = R.string.wallpaper_settings_fragment_title;
Amith Yamasani8666b9e2012-09-27 14:50:13 -0700763 } else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
764 && UserHandle.myUserId() != UserHandle.USER_OWNER) {
765 titleRes = R.string.user_info_settings_title;
Amith Yamasania4379d62011-07-22 10:34:58 -0700766 }
Jean Chalard7dabe452012-05-10 18:08:07 +0900767 startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
768 null, 0);
Amith Yamasania4379d62011-07-22 10:34:58 -0700769 return true;
770 }
771
Amith Yamasani3d384f42012-05-11 15:22:04 -0700772 public boolean shouldUpRecreateTask(Intent targetIntent) {
773 return super.shouldUpRecreateTask(new Intent(this, Settings.class));
774 }
775
Amith Yamasania4379d62011-07-22 10:34:58 -0700776 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700777 public void setListAdapter(ListAdapter adapter) {
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700778 if (adapter == null) {
779 super.setListAdapter(null);
780 } else {
781 super.setListAdapter(new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper));
Gilles Debunnee78c1872011-06-20 15:00:07 -0700782 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700783 }
784
Amith Yamasani56821db2012-06-05 13:20:45 -0700785 @Override
786 public void onAccountsUpdated(Account[] accounts) {
Jeff Sharkey9ff79c12012-10-03 16:48:17 -0700787 // TODO: watch for package upgrades to invalidate cache; see 7206643
788 mAuthenticatorHelper.updateAuthDescriptions(this);
Amith Yamasani56821db2012-06-05 13:20:45 -0700789 mAuthenticatorHelper.onAccountsUpdated(this, accounts);
790 invalidateHeaders();
791 }
792
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700793 /*
794 * Settings subclasses for launching independently.
795 */
Gilles Debunnee78c1872011-06-20 15:00:07 -0700796 public static class BluetoothSettingsActivity extends Settings { /* empty */ }
797 public static class WirelessSettingsActivity extends Settings { /* empty */ }
798 public static class TetherSettingsActivity extends Settings { /* empty */ }
799 public static class VpnSettingsActivity extends Settings { /* empty */ }
800 public static class DateTimeSettingsActivity extends Settings { /* empty */ }
801 public static class StorageSettingsActivity extends Settings { /* empty */ }
802 public static class WifiSettingsActivity extends Settings { /* empty */ }
repo syncb98463f2011-06-30 10:58:43 -0700803 public static class WifiP2pSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700804 public static class InputMethodAndLanguageSettingsActivity extends Settings { /* empty */ }
Jeff Browne46c5f32012-04-05 11:42:18 -0700805 public static class KeyboardLayoutPickerActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700806 public static class InputMethodAndSubtypeEnablerActivity extends Settings { /* empty */ }
satoke077d2b2011-07-25 09:38:11 +0900807 public static class SpellCheckersSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700808 public static class LocalePickerActivity extends Settings { /* empty */ }
809 public static class UserDictionarySettingsActivity extends Settings { /* empty */ }
810 public static class SoundSettingsActivity extends Settings { /* empty */ }
811 public static class DisplaySettingsActivity extends Settings { /* empty */ }
812 public static class DeviceInfoSettingsActivity extends Settings { /* empty */ }
813 public static class ApplicationSettingsActivity extends Settings { /* empty */ }
814 public static class ManageApplicationsActivity extends Settings { /* empty */ }
815 public static class StorageUseActivity extends Settings { /* empty */ }
816 public static class DevelopmentSettingsActivity extends Settings { /* empty */ }
817 public static class AccessibilitySettingsActivity extends Settings { /* empty */ }
818 public static class SecuritySettingsActivity extends Settings { /* empty */ }
Gilles Debunnea6a8a142011-06-09 11:56:17 -0700819 public static class LocationSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700820 public static class PrivacySettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700821 public static class RunningServicesActivity extends Settings { /* empty */ }
822 public static class ManageAccountsSettingsActivity extends Settings { /* empty */ }
823 public static class PowerUsageSummaryActivity extends Settings { /* empty */ }
824 public static class AccountSyncSettingsActivity extends Settings { /* empty */ }
825 public static class AccountSyncSettingsInAddAccountActivity extends Settings { /* empty */ }
826 public static class CryptKeeperSettingsActivity extends Settings { /* empty */ }
827 public static class DeviceAdminSettingsActivity extends Settings { /* empty */ }
828 public static class DataUsageSummaryActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700829 public static class AdvancedWifiSettingsActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700830 public static class TextToSpeechSettingsActivity extends Settings { /* empty */ }
Jeff Hamilton3d670de2011-09-21 16:44:36 -0500831 public static class AndroidBeamSettingsActivity extends Settings { /* empty */ }
Jeff Brown9e143f52012-09-19 20:46:07 -0700832 public static class WifiDisplaySettingsActivity extends Settings { /* empty */ }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800833}