blob: b52c2e24836319ae56762363bace35a0557bbc5c [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;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070037import android.content.pm.ActivityInfo;
38import android.content.pm.PackageManager;
39import android.content.pm.PackageManager.NameNotFoundException;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070040import android.graphics.drawable.Drawable;
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -070041import android.os.Bundle;
Jeff Sharkey34e964d2012-04-21 15:41:48 -070042import android.os.INetworkManagementService;
43import android.os.RemoteException;
44import android.os.ServiceManager;
Dianne Hackbornbb06a422012-08-16 11:01:57 -070045import android.os.UserHandle;
Jeff Sharkey44202462012-09-19 13:13:45 -070046import android.os.UserManager;
Amith Yamasania4379d62011-07-22 10:34:58 -070047import android.preference.Preference;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070048import android.preference.PreferenceActivity;
Amith Yamasania4379d62011-07-22 10:34:58 -070049import android.preference.PreferenceFragment;
Gilles Debunnee78c1872011-06-20 15:00:07 -070050import android.text.TextUtils;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080051import android.util.Log;
Gilles Debunnee78c1872011-06-20 15:00:07 -070052import android.view.LayoutInflater;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080053import android.view.View;
54import android.view.View.OnClickListener;
Gilles Debunnee78c1872011-06-20 15:00:07 -070055import android.view.ViewGroup;
56import android.widget.ArrayAdapter;
Amith Yamasani9e3a4702011-01-11 09:09:26 -080057import android.widget.Button;
Gilles Debunnee78c1872011-06-20 15:00:07 -070058import android.widget.ImageView;
59import android.widget.ListAdapter;
60import android.widget.Switch;
61import android.widget.TextView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080062
Gilles Debunnee78c1872011-06-20 15:00:07 -070063import java.util.ArrayList;
Amith Yamasanid1ab8282012-05-18 09:50:08 -070064import java.util.Collections;
65import java.util.Comparator;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070066import java.util.HashMap;
Amith Yamasani02cf71a2010-09-21 15:48:52 -070067import java.util.List;
Amith Yamasanid7993472010-08-18 13:59:28 -070068
69/**
70 * Top-level settings activity to handle single pane and double pane UI layout.
71 */
Amith Yamasani56821db2012-06-05 13:20:45 -070072public class Settings extends PreferenceActivity
73 implements ButtonBarHandler, OnAccountsUpdateListener {
Amith Yamasanid7993472010-08-18 13:59:28 -070074
Gilles Debunnee78c1872011-06-20 15:00:07 -070075 private static final String LOG_TAG = "Settings";
Amith Yamasaniea7b28c2012-06-20 13:51:40 -070076
Amith Yamasani5203bdf2010-11-04 09:59:44 -070077 private static final String META_DATA_KEY_HEADER_ID =
Gilles Debunnee78c1872011-06-20 15:00:07 -070078 "com.android.settings.TOP_LEVEL_HEADER_ID";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070079 private static final String META_DATA_KEY_FRAGMENT_CLASS =
Gilles Debunnee78c1872011-06-20 15:00:07 -070080 "com.android.settings.FRAGMENT_CLASS";
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080081 private static final String META_DATA_KEY_PARENT_TITLE =
82 "com.android.settings.PARENT_FRAGMENT_TITLE";
83 private static final String META_DATA_KEY_PARENT_FRAGMENT_CLASS =
84 "com.android.settings.PARENT_FRAGMENT_CLASS";
85
Jeff Sharkey54d0af52011-08-11 18:26:57 -070086 private static final String EXTRA_CLEAR_UI_OPTIONS = "settings:remove_ui_options";
Jeff Sharkey9fab0da2011-07-09 17:52:31 -070087
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080088 private static final String SAVE_KEY_CURRENT_HEADER = "com.android.settings.CURRENT_HEADER";
89 private static final String SAVE_KEY_PARENT_HEADER = "com.android.settings.PARENT_HEADER";
Amith Yamasani5203bdf2010-11-04 09:59:44 -070090
91 private String mFragmentClass;
92 private int mTopLevelHeaderId;
Amith Yamasani3965ae62010-11-15 14:45:19 -080093 private Header mFirstHeader;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -080094 private Header mCurrentHeader;
95 private Header mParentHeader;
96 private boolean mInLocalHeaderSwitch;
Amith Yamasani5203bdf2010-11-04 09:59:44 -070097
Amith Yamasanib810a0d2012-03-25 10:12:26 -070098 // Show only these settings for restricted users
99 private int[] SETTINGS_FOR_RESTRICTED = {
Amith Yamasani32630392012-08-10 19:31:39 -0700100 R.id.wireless_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700101 R.id.wifi_settings,
102 R.id.bluetooth_settings,
Jeff Sharkey38305fb2012-09-14 16:26:51 -0700103 R.id.data_usage_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700104 R.id.wireless_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700105 R.id.device_section,
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700106 R.id.sound_settings,
107 R.id.display_settings,
Jeff Sharkey90c8b202012-08-30 15:20:10 -0700108 R.id.storage_settings,
Dianne Hackborn271c8b02012-08-20 17:24:39 -0700109 R.id.application_settings,
Dianne Hackborn52e56a22012-09-12 17:02:23 -0700110 R.id.battery_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700111 R.id.personal_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700112 R.id.location_settings,
Amith Yamasani3deeeb72012-04-05 14:44:48 -0700113 R.id.security_settings,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700114 R.id.language_settings,
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700115 R.id.user_settings,
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700116 R.id.account_settings,
Amith Yamasani32630392012-08-10 19:31:39 -0700117 R.id.account_add,
118 R.id.system_section,
Amith Yamasani9627a8e2012-09-23 12:54:14 -0700119 R.id.date_time_settings,
Jeff Brown9e143f52012-09-19 20:46:07 -0700120 R.id.about_settings,
Svetoslav Ganov46045d82012-09-20 15:04:55 -0700121 R.id.accessibility_settings
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700122 };
123
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700124 // TODO: Update Call Settings based on airplane mode state.
Amith Yamasanib61cf512010-09-12 08:17:50 -0700125
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700126 protected HashMap<Integer, Integer> mHeaderIndexMap = new HashMap<Integer, Integer>();
127
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700128 private AuthenticatorHelper mAuthenticatorHelper;
129 private Header mLastHeader;
Amith Yamasani86708a82012-06-06 20:23:08 -0700130 private boolean mListeningToAccountUpdates;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700131
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700132 @Override
133 protected void onCreate(Bundle savedInstanceState) {
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700134 if (getIntent().getBooleanExtra(EXTRA_CLEAR_UI_OPTIONS, false)) {
135 getWindow().setUiOptions(0);
136 }
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700137
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700138 mAuthenticatorHelper = new AuthenticatorHelper();
139 mAuthenticatorHelper.updateAuthDescriptions(this);
140 mAuthenticatorHelper.onAccountsUpdated(this, null);
141
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700142 getMetaData();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800143 mInLocalHeaderSwitch = true;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700144 super.onCreate(savedInstanceState);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800145 mInLocalHeaderSwitch = false;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700146
Gilles Debunne3661b622011-06-27 11:19:16 -0700147 if (!onIsHidingHeaders() && onIsMultiPane()) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700148 highlightHeader(mTopLevelHeaderId);
Amith Yamasani72aa19d2010-12-09 06:07:12 -0800149 // Force the title so that it doesn't get overridden by a direct launch of
150 // a specific settings screen.
151 setTitle(R.string.settings_label);
152 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800153
154 // Retrieve any saved state
155 if (savedInstanceState != null) {
156 mCurrentHeader = savedInstanceState.getParcelable(SAVE_KEY_CURRENT_HEADER);
157 mParentHeader = savedInstanceState.getParcelable(SAVE_KEY_PARENT_HEADER);
158 }
159
160 // If the current header was saved, switch to it
161 if (savedInstanceState != null && mCurrentHeader != null) {
162 //switchToHeaderLocal(mCurrentHeader);
163 showBreadCrumbs(mCurrentHeader.title, null);
164 }
165
166 if (mParentHeader != null) {
167 setParentTitle(mParentHeader.title, null, new OnClickListener() {
168 public void onClick(View v) {
169 switchToParent(mParentHeader.fragment);
170 }
171 });
172 }
Gilles Debunnedc7101f2011-06-27 12:00:49 -0700173
Amith Yamasani3d384f42012-05-11 15:22:04 -0700174 // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
175 if (onIsMultiPane()) {
176 getActionBar().setDisplayHomeAsUpEnabled(false);
177 getActionBar().setHomeButtonEnabled(false);
178 }
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800179 }
180
181 @Override
182 protected void onSaveInstanceState(Bundle outState) {
183 super.onSaveInstanceState(outState);
184
185 // Save the current fragment, if it is the same as originally launched
186 if (mCurrentHeader != null) {
187 outState.putParcelable(SAVE_KEY_CURRENT_HEADER, mCurrentHeader);
188 }
189 if (mParentHeader != null) {
190 outState.putParcelable(SAVE_KEY_PARENT_HEADER, mParentHeader);
191 }
192 }
193
Gilles Debunnee78c1872011-06-20 15:00:07 -0700194 @Override
195 public void onResume() {
196 super.onResume();
197
198 ListAdapter listAdapter = getListAdapter();
199 if (listAdapter instanceof HeaderAdapter) {
200 ((HeaderAdapter) listAdapter).resume();
201 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700202 invalidateHeaders();
Gilles Debunnee78c1872011-06-20 15:00:07 -0700203 }
204
205 @Override
206 public void onPause() {
207 super.onPause();
208
209 ListAdapter listAdapter = getListAdapter();
210 if (listAdapter instanceof HeaderAdapter) {
211 ((HeaderAdapter) listAdapter).pause();
Amith Yamasani86708a82012-06-06 20:23:08 -0700212 }
213 }
214
215 @Override
216 public void onDestroy() {
217 super.onDestroy();
218 if (mListeningToAccountUpdates) {
Amith Yamasani56821db2012-06-05 13:20:45 -0700219 AccountManager.get(this).removeOnAccountsUpdatedListener(this);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700220 }
221 }
222
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800223 private void switchToHeaderLocal(Header header) {
224 mInLocalHeaderSwitch = true;
225 switchToHeader(header);
226 mInLocalHeaderSwitch = false;
227 }
228
229 @Override
230 public void switchToHeader(Header header) {
231 if (!mInLocalHeaderSwitch) {
232 mCurrentHeader = null;
233 mParentHeader = null;
234 }
235 super.switchToHeader(header);
236 }
237
238 /**
239 * Switch to parent fragment and store the grand parent's info
Jake Hamby2748fc22011-01-12 15:06:28 -0800240 * @param className name of the activity wrapper for the parent fragment.
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800241 */
242 private void switchToParent(String className) {
243 final ComponentName cn = new ComponentName(this, className);
244 try {
245 final PackageManager pm = getPackageManager();
246 final ActivityInfo parentInfo = pm.getActivityInfo(cn, PackageManager.GET_META_DATA);
247
248 if (parentInfo != null && parentInfo.metaData != null) {
249 String fragmentClass = parentInfo.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
250 CharSequence fragmentTitle = parentInfo.loadLabel(pm);
251 Header parentHeader = new Header();
252 parentHeader.fragment = fragmentClass;
253 parentHeader.title = fragmentTitle;
254 mCurrentHeader = parentHeader;
255
256 switchToHeaderLocal(parentHeader);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700257 highlightHeader(mTopLevelHeaderId);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800258
259 mParentHeader = new Header();
260 mParentHeader.fragment
261 = parentInfo.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
262 mParentHeader.title = parentInfo.metaData.getString(META_DATA_KEY_PARENT_TITLE);
263 }
264 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700265 Log.w(LOG_TAG, "Could not find parent activity : " + className);
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800266 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700267 }
268
Amith Yamasani3965ae62010-11-15 14:45:19 -0800269 @Override
270 public void onNewIntent(Intent intent) {
271 super.onNewIntent(intent);
272
273 // If it is not launched from history, then reset to top-level
Amith Yamasanief617232012-10-09 16:57:25 -0700274 if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) {
275 if (mFirstHeader != null && !onIsHidingHeaders() && onIsMultiPane()) {
276 switchToHeaderLocal(mFirstHeader);
277 }
278 getListView().setSelectionFromTop(0, 0);
Amith Yamasani3965ae62010-11-15 14:45:19 -0800279 }
280 }
281
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700282 private void highlightHeader(int id) {
283 if (id != 0) {
284 Integer index = mHeaderIndexMap.get(id);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700285 if (index != null) {
286 getListView().setItemChecked(index, true);
Amith Yamasanief617232012-10-09 16:57:25 -0700287 if (isMultiPane()) {
288 getListView().smoothScrollToPosition(index);
289 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700290 }
291 }
292 }
293
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700294 @Override
295 public Intent getIntent() {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700296 Intent superIntent = super.getIntent();
297 String startingFragment = getStartingFragmentClass(superIntent);
Gilles Debunne3661b622011-06-27 11:19:16 -0700298 // This is called from super.onCreate, isMultiPane() is not yet reliable
299 // Do not use onIsHidingHeaders either, which relies itself on this method
300 if (startingFragment != null && !onIsMultiPane()) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700301 Intent modIntent = new Intent(superIntent);
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700302 modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700303 Bundle args = superIntent.getExtras();
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700304 if (args != null) {
305 args = new Bundle(args);
306 } else {
307 args = new Bundle();
308 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700309 args.putParcelable("intent", superIntent);
310 modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, superIntent.getExtras());
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700311 return modIntent;
312 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700313 return superIntent;
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700314 }
315
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700316 /**
Amith Yamasani379d9b02010-09-27 12:03:59 -0700317 * Checks if the component name in the intent is different from the Settings class and
318 * returns the class name to load as a fragment.
319 */
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700320 protected String getStartingFragmentClass(Intent intent) {
321 if (mFragmentClass != null) return mFragmentClass;
322
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700323 String intentClass = intent.getComponent().getClassName();
Amith Yamasani379d9b02010-09-27 12:03:59 -0700324 if (intentClass.equals(getClass().getName())) return null;
325
Dianne Hackbornee293792010-11-01 12:32:33 -0700326 if ("com.android.settings.ManageApplications".equals(intentClass)
327 || "com.android.settings.RunningServices".equals(intentClass)
328 || "com.android.settings.applications.StorageUse".equals(intentClass)) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700329 // Old names of manage apps.
Dianne Hackbornf4eb85b2010-10-29 16:53:04 -0700330 intentClass = com.android.settings.applications.ManageApplications.class.getName();
331 }
332
Amith Yamasani379d9b02010-09-27 12:03:59 -0700333 return intentClass;
334 }
335
336 /**
337 * Override initial header when an activity-alias is causing Settings to be launched
338 * for a specific fragment encoded in the android:name parameter.
339 */
340 @Override
341 public Header onGetInitialHeader() {
342 String fragmentClass = getStartingFragmentClass(super.getIntent());
343 if (fragmentClass != null) {
344 Header header = new Header();
345 header.fragment = fragmentClass;
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800346 header.title = getTitle();
Amith Yamasanie0e4fc22010-10-05 11:49:51 -0700347 header.fragmentArguments = getIntent().getExtras();
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800348 mCurrentHeader = header;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700349 return header;
350 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700351
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700352 return mFirstHeader;
Amith Yamasani379d9b02010-09-27 12:03:59 -0700353 }
354
Dianne Hackbornb7258182011-03-15 16:23:55 -0700355 @Override
Dianne Hackborn48147dc2011-03-18 12:29:41 -0700356 public Intent onBuildStartFragmentIntent(String fragmentName, Bundle args,
357 int titleRes, int shortTitleRes) {
358 Intent intent = super.onBuildStartFragmentIntent(fragmentName, args,
359 titleRes, shortTitleRes);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700360
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700361 // some fragments want to avoid split actionbar
Gilles Debunne162e5412011-07-11 14:13:31 -0700362 if (DataUsageSummary.class.getName().equals(fragmentName) ||
363 PowerUsageSummary.class.getName().equals(fragmentName) ||
Gilles Debunnecd8e5242011-07-25 11:36:15 -0700364 AccountSyncSettings.class.getName().equals(fragmentName) ||
Jeff Sharkey11d30122012-03-19 16:54:07 -0700365 UserDictionarySettings.class.getName().equals(fragmentName) ||
Adam Powellfaba7e42012-03-26 17:28:38 -0700366 Memory.class.getName().equals(fragmentName) ||
Jeff Sharkeya339cba2012-05-08 11:42:49 -0700367 ManageApplications.class.getName().equals(fragmentName) ||
368 WirelessSettings.class.getName().equals(fragmentName) ||
369 SoundSettings.class.getName().equals(fragmentName) ||
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700370 PrivacySettings.class.getName().equals(fragmentName) ||
Jeff Sharkey9fd7ac12012-08-25 00:06:08 -0700371 ManageAccountsSettings.class.getName().equals(fragmentName) ||
rich cannings93c0ee52012-09-30 13:54:26 -0700372 VpnSettings.class.getName().equals(fragmentName) ||
Adam Powell7474bc32012-09-30 18:21:14 -0700373 SecuritySettings.class.getName().equals(fragmentName) ||
374 InstalledAppDetails.class.getName().equals(fragmentName)) {
Jeff Sharkey54d0af52011-08-11 18:26:57 -0700375 intent.putExtra(EXTRA_CLEAR_UI_OPTIONS, true);
Jeff Sharkey9fab0da2011-07-09 17:52:31 -0700376 }
377
Dianne Hackbornb7258182011-03-15 16:23:55 -0700378 intent.setClass(this, SubSettings.class);
379 return intent;
380 }
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700381
Amith Yamasani379d9b02010-09-27 12:03:59 -0700382 /**
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700383 * Populate the activity with the top-level headers.
384 */
Amith Yamasanid7993472010-08-18 13:59:28 -0700385 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700386 public void onBuildHeaders(List<Header> headers) {
387 loadHeadersFromResource(R.xml.settings_headers, headers);
Amith Yamasanid7993472010-08-18 13:59:28 -0700388
Gilles Debunnee78c1872011-06-20 15:00:07 -0700389 updateHeaderList(headers);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700390 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700391
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700392 private void updateHeaderList(List<Header> target) {
393 int i = 0;
394 while (i < target.size()) {
395 Header header = target.get(i);
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700396 // Ids are integers, so downcasting
397 int id = (int) header.id;
Chris Wren2bc32ae2012-09-24 14:23:46 -0400398 if (id == R.id.operator_settings || id == R.id.manufacturer_settings) {
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700399 Utils.updateHeaderToSpecificActivityFromMetaDataOrRemove(this, target, header);
Gilles Debunne2454f492011-06-21 16:16:06 -0700400 } else if (id == R.id.wifi_settings) {
401 // Remove WiFi Settings if WiFi service is not available.
402 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
403 target.remove(header);
404 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700405 } else if (id == R.id.bluetooth_settings) {
406 // Remove Bluetooth Settings if Bluetooth service is not available.
Gilles Debunne2454f492011-06-21 16:16:06 -0700407 if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700408 target.remove(header);
409 }
Jeff Sharkey34e964d2012-04-21 15:41:48 -0700410 } else if (id == R.id.data_usage_settings) {
411 // Remove data usage when kernel module not enabled
412 final INetworkManagementService netManager = INetworkManagementService.Stub
413 .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
414 try {
415 if (!netManager.isBandwidthControlEnabled()) {
416 target.remove(header);
417 }
418 } catch (RemoteException e) {
419 // ignored
420 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700421 } else if (id == R.id.account_settings) {
422 int headerIndex = i + 1;
423 i = insertAccountsHeaders(target, headerIndex);
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700424 } else if (id == R.id.user_settings) {
Amith Yamasanidc6bfa62012-09-06 18:04:06 -0700425 if (!UserHandle.MU_ENABLED
Jeff Sharkey44202462012-09-19 13:13:45 -0700426 || !UserManager.supportsMultipleUsers()
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700427 || Utils.isMonkeyRunning()) {
428 target.remove(header);
429 }
430 }
Dianne Hackbornbb06a422012-08-16 11:01:57 -0700431 if (UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
Amith Yamasanib810a0d2012-03-25 10:12:26 -0700432 && !ArrayUtils.contains(SETTINGS_FOR_RESTRICTED, id)) {
433 target.remove(header);
Amith Yamasanid7993472010-08-18 13:59:28 -0700434 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700435
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700436 // Increment if the current one wasn't removed by the Utils code.
437 if (target.get(i) == header) {
Amith Yamasani3965ae62010-11-15 14:45:19 -0800438 // Hold on to the first header, when we need to reset to the top-level
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700439 if (mFirstHeader == null &&
440 HeaderAdapter.getHeaderType(header) != HeaderAdapter.HEADER_TYPE_CATEGORY) {
441 mFirstHeader = header;
442 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700443 mHeaderIndexMap.put(id, i);
Amith Yamasani02cf71a2010-09-21 15:48:52 -0700444 i++;
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700445 }
Amith Yamasanid7993472010-08-18 13:59:28 -0700446 }
447 }
448
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700449 private int insertAccountsHeaders(List<Header> target, int headerIndex) {
450 String[] accountTypes = mAuthenticatorHelper.getEnabledAccountTypes();
451 List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length);
452 for (String accountType : accountTypes) {
453 CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType);
Brian Muramatsuc28af522012-06-28 14:25:14 -0700454 if (label == null) {
455 continue;
456 }
457
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700458 Account[] accounts = AccountManager.get(this).getAccountsByType(accountType);
459 boolean skipToAccount = accounts.length == 1
460 && !mAuthenticatorHelper.hasAccountPreferences(accountType);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700461 Header accHeader = new Header();
462 accHeader.title = label;
463 if (accHeader.extras == null) {
464 accHeader.extras = new Bundle();
465 }
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700466 if (skipToAccount) {
467 accHeader.breadCrumbTitleRes = R.string.account_sync_settings_title;
468 accHeader.breadCrumbShortTitleRes = R.string.account_sync_settings_title;
469 accHeader.fragment = AccountSyncSettings.class.getName();
470 accHeader.fragmentArguments = new Bundle();
471 // Need this for the icon
472 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
473 accHeader.extras.putParcelable(AccountSyncSettings.ACCOUNT_KEY, accounts[0]);
474 accHeader.fragmentArguments.putParcelable(AccountSyncSettings.ACCOUNT_KEY,
475 accounts[0]);
476 } else {
477 accHeader.breadCrumbTitle = label;
478 accHeader.breadCrumbShortTitle = label;
479 accHeader.fragment = ManageAccountsSettings.class.getName();
480 accHeader.fragmentArguments = new Bundle();
481 accHeader.extras.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE, accountType);
482 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_TYPE,
483 accountType);
484 if (!isMultiPane()) {
485 accHeader.fragmentArguments.putString(ManageAccountsSettings.KEY_ACCOUNT_LABEL,
486 label.toString());
487 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700488 }
489 accountHeaders.add(accHeader);
490 }
491
492 // Sort by label
493 Collections.sort(accountHeaders, new Comparator<Header>() {
494 @Override
495 public int compare(Header h1, Header h2) {
496 return h1.title.toString().compareTo(h2.title.toString());
497 }
498 });
499
500 for (Header header : accountHeaders) {
501 target.add(headerIndex++, header);
502 }
Amith Yamasani86708a82012-06-06 20:23:08 -0700503 if (!mListeningToAccountUpdates) {
504 AccountManager.get(this).addOnAccountsUpdatedListener(this, null, true);
505 mListeningToAccountUpdates = true;
506 }
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700507 return headerIndex;
508 }
509
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700510 private void getMetaData() {
511 try {
512 ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
513 PackageManager.GET_META_DATA);
514 if (ai == null || ai.metaData == null) return;
515 mTopLevelHeaderId = ai.metaData.getInt(META_DATA_KEY_HEADER_ID);
516 mFragmentClass = ai.metaData.getString(META_DATA_KEY_FRAGMENT_CLASS);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700517
Amith Yamasanic9fdfa82010-12-14 14:38:16 -0800518 // Check if it has a parent specified and create a Header object
519 final int parentHeaderTitleRes = ai.metaData.getInt(META_DATA_KEY_PARENT_TITLE);
520 String parentFragmentClass = ai.metaData.getString(META_DATA_KEY_PARENT_FRAGMENT_CLASS);
521 if (parentFragmentClass != null) {
522 mParentHeader = new Header();
523 mParentHeader.fragment = parentFragmentClass;
524 if (parentHeaderTitleRes != 0) {
525 mParentHeader.title = getResources().getString(parentHeaderTitleRes);
526 }
527 }
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700528 } catch (NameNotFoundException nnfe) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700529 // No recovery
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700530 }
531 }
532
Amith Yamasani9e3a4702011-01-11 09:09:26 -0800533 @Override
534 public boolean hasNextButton() {
535 return super.hasNextButton();
536 }
537
538 @Override
539 public Button getNextButton() {
540 return super.getNextButton();
541 }
542
Gilles Debunnee78c1872011-06-20 15:00:07 -0700543 private static class HeaderAdapter extends ArrayAdapter<Header> {
544 static final int HEADER_TYPE_CATEGORY = 0;
545 static final int HEADER_TYPE_NORMAL = 1;
546 static final int HEADER_TYPE_SWITCH = 2;
547 private static final int HEADER_TYPE_COUNT = HEADER_TYPE_SWITCH + 1;
548
549 private final WifiEnabler mWifiEnabler;
550 private final BluetoothEnabler mBluetoothEnabler;
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700551 private AuthenticatorHelper mAuthHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700552
553 private static class HeaderViewHolder {
554 ImageView icon;
555 TextView title;
556 TextView summary;
557 Switch switch_;
558 }
559
560 private LayoutInflater mInflater;
561
562 static int getHeaderType(Header header) {
563 if (header.fragment == null && header.intent == null) {
564 return HEADER_TYPE_CATEGORY;
565 } else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
566 return HEADER_TYPE_SWITCH;
567 } else {
568 return HEADER_TYPE_NORMAL;
569 }
570 }
571
572 @Override
573 public int getItemViewType(int position) {
574 Header header = getItem(position);
575 return getHeaderType(header);
576 }
577
578 @Override
579 public boolean areAllItemsEnabled() {
580 return false; // because of categories
581 }
582
583 @Override
584 public boolean isEnabled(int position) {
585 return getItemViewType(position) != HEADER_TYPE_CATEGORY;
586 }
587
588 @Override
589 public int getViewTypeCount() {
590 return HEADER_TYPE_COUNT;
591 }
592
593 @Override
594 public boolean hasStableIds() {
595 return true;
596 }
597
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700598 public HeaderAdapter(Context context, List<Header> objects,
599 AuthenticatorHelper authenticatorHelper) {
Gilles Debunnee78c1872011-06-20 15:00:07 -0700600 super(context, 0, objects);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700601
602 mAuthHelper = authenticatorHelper;
Gilles Debunnee78c1872011-06-20 15:00:07 -0700603 mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700604
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700605 // Temp Switches provided as placeholder until the adapter replaces these with actual
Gilles Debunnee78c1872011-06-20 15:00:07 -0700606 // Switches inflated from their layouts. Must be done before adapter is set in super
607 mWifiEnabler = new WifiEnabler(context, new Switch(context));
608 mBluetoothEnabler = new BluetoothEnabler(context, new Switch(context));
609 }
610
611 @Override
612 public View getView(int position, View convertView, ViewGroup parent) {
613 HeaderViewHolder holder;
614 Header header = getItem(position);
615 int headerType = getHeaderType(header);
616 View view = null;
617
618 if (convertView == null) {
619 holder = new HeaderViewHolder();
620 switch (headerType) {
621 case HEADER_TYPE_CATEGORY:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700622 view = new TextView(getContext(), null,
623 android.R.attr.listSeparatorTextViewStyle);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700624 holder.title = (TextView) view;
625 break;
626
627 case HEADER_TYPE_SWITCH:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700628 view = mInflater.inflate(R.layout.preference_header_switch_item, parent,
629 false);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700630 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700631 holder.title = (TextView)
632 view.findViewById(com.android.internal.R.id.title);
633 holder.summary = (TextView)
634 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700635 holder.switch_ = (Switch) view.findViewById(R.id.switchWidget);
636 break;
637
638 case HEADER_TYPE_NORMAL:
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700639 view = mInflater.inflate(
Amith Yamasanic8a93172012-06-08 13:35:47 -0700640 R.layout.preference_header_item, parent,
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700641 false);
Amith Yamasanic8a93172012-06-08 13:35:47 -0700642 holder.icon = (ImageView) view.findViewById(R.id.icon);
Gilles Debunneb396c9b2011-06-22 16:07:29 -0700643 holder.title = (TextView)
644 view.findViewById(com.android.internal.R.id.title);
645 holder.summary = (TextView)
646 view.findViewById(com.android.internal.R.id.summary);
Gilles Debunnee78c1872011-06-20 15:00:07 -0700647 break;
648 }
649 view.setTag(holder);
650 } else {
651 view = convertView;
652 holder = (HeaderViewHolder) view.getTag();
653 }
654
655 // All view fields must be updated every time, because the view may be recycled
656 switch (headerType) {
657 case HEADER_TYPE_CATEGORY:
658 holder.title.setText(header.getTitle(getContext().getResources()));
659 break;
660
661 case HEADER_TYPE_SWITCH:
662 // Would need a different treatment if the main menu had more switches
663 if (header.id == R.id.wifi_settings) {
664 mWifiEnabler.setSwitch(holder.switch_);
665 } else {
666 mBluetoothEnabler.setSwitch(holder.switch_);
667 }
668 // No break, fall through on purpose to update common fields
669
670 //$FALL-THROUGH$
671 case HEADER_TYPE_NORMAL:
Amith Yamasani3882c2e2012-06-07 17:03:20 -0700672 if (header.extras != null
673 && header.extras.containsKey(ManageAccountsSettings.KEY_ACCOUNT_TYPE)) {
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700674 String accType = header.extras.getString(
675 ManageAccountsSettings.KEY_ACCOUNT_TYPE);
676 ViewGroup.LayoutParams lp = holder.icon.getLayoutParams();
677 lp.width = getContext().getResources().getDimensionPixelSize(
678 R.dimen.header_icon_width);
679 lp.height = lp.width;
680 holder.icon.setLayoutParams(lp);
681 Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
682 holder.icon.setImageDrawable(icon);
683 } else {
684 holder.icon.setImageResource(header.iconRes);
685 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700686 holder.title.setText(header.getTitle(getContext().getResources()));
687 CharSequence summary = header.getSummary(getContext().getResources());
688 if (!TextUtils.isEmpty(summary)) {
689 holder.summary.setVisibility(View.VISIBLE);
690 holder.summary.setText(summary);
691 } else {
692 holder.summary.setVisibility(View.GONE);
693 }
694 break;
695 }
696
697 return view;
698 }
699
700 public void resume() {
701 mWifiEnabler.resume();
702 mBluetoothEnabler.resume();
703 }
Brian Muramatsuc28af522012-06-28 14:25:14 -0700704
Gilles Debunnee78c1872011-06-20 15:00:07 -0700705 public void pause() {
706 mWifiEnabler.pause();
707 mBluetoothEnabler.pause();
708 }
709 }
710
711 @Override
Amith Yamasanid1ab8282012-05-18 09:50:08 -0700712 public void onHeaderClick(Header header, int position) {
713 boolean revert = false;
714 if (header.id == R.id.account_add) {
715 revert = true;
716 }
717
718 super.onHeaderClick(header, position);
719
720 if (revert && mLastHeader != null) {
721 highlightHeader((int) mLastHeader.id);
722 } else {
723 mLastHeader = header;
724 }
725 }
726
727 @Override
Amith Yamasania4379d62011-07-22 10:34:58 -0700728 public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
729 // Override the fragment title for Wallpaper settings
Amith Yamasanidfb65432011-11-29 16:38:14 -0800730 int titleRes = pref.getTitleRes();
Amith Yamasania4379d62011-07-22 10:34:58 -0700731 if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
Amith Yamasanidfb65432011-11-29 16:38:14 -0800732 titleRes = R.string.wallpaper_settings_fragment_title;
Amith Yamasani8666b9e2012-09-27 14:50:13 -0700733 } else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
734 && UserHandle.myUserId() != UserHandle.USER_OWNER) {
735 titleRes = R.string.user_info_settings_title;
Amith Yamasania4379d62011-07-22 10:34:58 -0700736 }
Jean Chalard7dabe452012-05-10 18:08:07 +0900737 startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
738 null, 0);
Amith Yamasania4379d62011-07-22 10:34:58 -0700739 return true;
740 }
741
Amith Yamasani3d384f42012-05-11 15:22:04 -0700742 public boolean shouldUpRecreateTask(Intent targetIntent) {
743 return super.shouldUpRecreateTask(new Intent(this, Settings.class));
744 }
745
Amith Yamasania4379d62011-07-22 10:34:58 -0700746 @Override
Gilles Debunnee78c1872011-06-20 15:00:07 -0700747 public void setListAdapter(ListAdapter adapter) {
Amith Yamasaniea7b28c2012-06-20 13:51:40 -0700748 if (adapter == null) {
749 super.setListAdapter(null);
750 } else {
751 super.setListAdapter(new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper));
Gilles Debunnee78c1872011-06-20 15:00:07 -0700752 }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700753 }
754
Amith Yamasani56821db2012-06-05 13:20:45 -0700755 @Override
756 public void onAccountsUpdated(Account[] accounts) {
Jeff Sharkey9ff79c12012-10-03 16:48:17 -0700757 // TODO: watch for package upgrades to invalidate cache; see 7206643
758 mAuthenticatorHelper.updateAuthDescriptions(this);
Amith Yamasani56821db2012-06-05 13:20:45 -0700759 mAuthenticatorHelper.onAccountsUpdated(this, accounts);
760 invalidateHeaders();
761 }
762
Amith Yamasani5203bdf2010-11-04 09:59:44 -0700763 /*
764 * Settings subclasses for launching independently.
765 */
Gilles Debunnee78c1872011-06-20 15:00:07 -0700766 public static class BluetoothSettingsActivity extends Settings { /* empty */ }
767 public static class WirelessSettingsActivity extends Settings { /* empty */ }
768 public static class TetherSettingsActivity extends Settings { /* empty */ }
769 public static class VpnSettingsActivity extends Settings { /* empty */ }
770 public static class DateTimeSettingsActivity extends Settings { /* empty */ }
771 public static class StorageSettingsActivity extends Settings { /* empty */ }
772 public static class WifiSettingsActivity extends Settings { /* empty */ }
repo syncb98463f2011-06-30 10:58:43 -0700773 public static class WifiP2pSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700774 public static class InputMethodAndLanguageSettingsActivity extends Settings { /* empty */ }
Jeff Browne46c5f32012-04-05 11:42:18 -0700775 public static class KeyboardLayoutPickerActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700776 public static class InputMethodAndSubtypeEnablerActivity extends Settings { /* empty */ }
satoke077d2b2011-07-25 09:38:11 +0900777 public static class SpellCheckersSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700778 public static class LocalePickerActivity extends Settings { /* empty */ }
779 public static class UserDictionarySettingsActivity extends Settings { /* empty */ }
780 public static class SoundSettingsActivity extends Settings { /* empty */ }
781 public static class DisplaySettingsActivity extends Settings { /* empty */ }
782 public static class DeviceInfoSettingsActivity extends Settings { /* empty */ }
783 public static class ApplicationSettingsActivity extends Settings { /* empty */ }
784 public static class ManageApplicationsActivity extends Settings { /* empty */ }
785 public static class StorageUseActivity extends Settings { /* empty */ }
786 public static class DevelopmentSettingsActivity extends Settings { /* empty */ }
787 public static class AccessibilitySettingsActivity extends Settings { /* empty */ }
788 public static class SecuritySettingsActivity extends Settings { /* empty */ }
Gilles Debunnea6a8a142011-06-09 11:56:17 -0700789 public static class LocationSettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700790 public static class PrivacySettingsActivity extends Settings { /* empty */ }
Gilles Debunnee78c1872011-06-20 15:00:07 -0700791 public static class RunningServicesActivity extends Settings { /* empty */ }
792 public static class ManageAccountsSettingsActivity extends Settings { /* empty */ }
793 public static class PowerUsageSummaryActivity extends Settings { /* empty */ }
794 public static class AccountSyncSettingsActivity extends Settings { /* empty */ }
795 public static class AccountSyncSettingsInAddAccountActivity extends Settings { /* empty */ }
796 public static class CryptKeeperSettingsActivity extends Settings { /* empty */ }
797 public static class DeviceAdminSettingsActivity extends Settings { /* empty */ }
798 public static class DataUsageSummaryActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700799 public static class AdvancedWifiSettingsActivity extends Settings { /* empty */ }
Gilles Debunneab189bd2011-07-06 13:10:16 -0700800 public static class TextToSpeechSettingsActivity extends Settings { /* empty */ }
Jeff Hamilton3d670de2011-09-21 16:44:36 -0500801 public static class AndroidBeamSettingsActivity extends Settings { /* empty */ }
Jeff Brown9e143f52012-09-19 20:46:07 -0700802 public static class WifiDisplaySettingsActivity extends Settings { /* empty */ }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800803}