blob: cfd33a19baf90e6eb9eca19683c15da11ab483d2 [file] [log] [blame]
-b master501eec92009-07-06 13:53:11 -07001/*
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.providers.settings;
18
Maggieaa080f92018-01-04 15:35:11 -080019import android.os.Process;
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070020import com.android.internal.R;
21import com.android.internal.app.LocalePicker;
22import com.android.internal.annotations.VisibleForTesting;
23
24import android.annotation.NonNull;
Sudheer Shankadc589ac2016-11-10 15:30:17 -080025import android.app.ActivityManager;
Amith Yamasani8823c0a82009-07-07 14:30:17 -070026import android.app.IActivityManager;
Christopher Tate45281862010-03-05 15:46:30 -080027import android.app.backup.IBackupManager;
Christopher Tate6597e342015-02-17 12:15:25 -080028import android.content.ContentResolver;
29import android.content.ContentValues;
-b master501eec92009-07-06 13:53:11 -070030import android.content.Context;
Christopher Tate6597e342015-02-17 12:15:25 -080031import android.content.Intent;
Amith Yamasani8823c0a82009-07-07 14:30:17 -070032import android.content.res.Configuration;
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070033import android.icu.util.ULocale;
Amith Yamasani70c874b2009-07-06 14:53:25 -070034import android.location.LocationManager;
-b master501eec92009-07-06 13:53:11 -070035import android.media.AudioManager;
Amith Yamasani622bf2222013-09-06 13:54:28 -070036import android.media.RingtoneManager;
37import android.net.Uri;
Mike Lockwood237a2992009-09-15 14:42:16 -040038import android.os.IPowerManager;
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070039import android.os.LocaleList;
-b master501eec92009-07-06 13:53:11 -070040import android.os.RemoteException;
41import android.os.ServiceManager;
Christopher Tate6597e342015-02-17 12:15:25 -080042import android.os.UserHandle;
Maggie Benthall67944582013-02-22 14:58:27 -050043import android.os.UserManager;
-b master501eec92009-07-06 13:53:11 -070044import android.provider.Settings;
Marvin Paul8fc50722014-12-23 11:46:33 -080045import android.telephony.TelephonyManager;
Amith Yamasani8823c0a82009-07-07 14:30:17 -070046import android.text.TextUtils;
Christopher Tate6597e342015-02-17 12:15:25 -080047import android.util.ArraySet;
Christopher Tate45d17582017-06-26 17:35:26 -070048import android.util.Slog;
-b master501eec92009-07-06 13:53:11 -070049
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070050import java.util.ArrayList;
51import java.util.HashMap;
52import java.util.List;
Maggie Benthall67944582013-02-22 14:58:27 -050053import java.util.Locale;
54
-b master501eec92009-07-06 13:53:11 -070055public class SettingsHelper {
Christopher Tate45d17582017-06-26 17:35:26 -070056 private static final String TAG = "SettingsHelper";
Amith Yamasani622bf2222013-09-06 13:54:28 -070057 private static final String SILENT_RINGTONE = "_silent";
-b master501eec92009-07-06 13:53:11 -070058 private Context mContext;
59 private AudioManager mAudioManager;
Marvin Paul8fc50722014-12-23 11:46:33 -080060 private TelephonyManager mTelephonyManager;
Amith Yamasani70c874b2009-07-06 14:53:25 -070061
Christopher Tate6597e342015-02-17 12:15:25 -080062 /**
63 * A few settings elements are special in that a restore of those values needs to
64 * be post-processed by relevant parts of the OS. A restore of any settings element
65 * mentioned in this table will therefore cause the system to send a broadcast with
66 * the {@link Intent#ACTION_SETTING_RESTORED} action, with extras naming the
67 * affected setting and supplying its pre-restore value for comparison.
68 *
69 * @see Intent#ACTION_SETTING_RESTORED
70 * @see System#SETTINGS_TO_BACKUP
71 * @see Secure#SETTINGS_TO_BACKUP
72 * @see Global#SETTINGS_TO_BACKUP
73 *
74 * {@hide}
75 */
76 private static final ArraySet<String> sBroadcastOnRestore;
77 static {
Stanley Tng767f05f2017-05-01 21:27:31 -070078 sBroadcastOnRestore = new ArraySet<String>(5);
Christopher Tate6597e342015-02-17 12:15:25 -080079 sBroadcastOnRestore.add(Settings.Secure.ENABLED_NOTIFICATION_LISTENERS);
Ruben Brunke24b9a62016-02-16 21:38:24 -080080 sBroadcastOnRestore.add(Settings.Secure.ENABLED_VR_LISTENERS);
Christopher Tate2d4aadc2015-03-16 16:55:14 -070081 sBroadcastOnRestore.add(Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
Christopher Tate7b9a28c2015-03-18 13:06:16 -070082 sBroadcastOnRestore.add(Settings.Secure.ENABLED_INPUT_METHODS);
Stanley Tng767f05f2017-05-01 21:27:31 -070083 sBroadcastOnRestore.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate6597e342015-02-17 12:15:25 -080084 }
85
86 private interface SettingsLookup {
87 public String lookup(ContentResolver resolver, String name, int userHandle);
88 }
89
90 private static SettingsLookup sSystemLookup = new SettingsLookup() {
91 public String lookup(ContentResolver resolver, String name, int userHandle) {
92 return Settings.System.getStringForUser(resolver, name, userHandle);
93 }
94 };
95
96 private static SettingsLookup sSecureLookup = new SettingsLookup() {
97 public String lookup(ContentResolver resolver, String name, int userHandle) {
98 return Settings.Secure.getStringForUser(resolver, name, userHandle);
99 }
100 };
101
102 private static SettingsLookup sGlobalLookup = new SettingsLookup() {
103 public String lookup(ContentResolver resolver, String name, int userHandle) {
104 return Settings.Global.getStringForUser(resolver, name, userHandle);
105 }
106 };
107
-b master501eec92009-07-06 13:53:11 -0700108 public SettingsHelper(Context context) {
109 mContext = context;
110 mAudioManager = (AudioManager) context
111 .getSystemService(Context.AUDIO_SERVICE);
Marvin Paul8fc50722014-12-23 11:46:33 -0800112 mTelephonyManager = (TelephonyManager) context
113 .getSystemService(Context.TELEPHONY_SERVICE);
-b master501eec92009-07-06 13:53:11 -0700114 }
115
Amith Yamasani70c874b2009-07-06 14:53:25 -0700116 /**
117 * Sets the property via a call to the appropriate API, if any, and returns
118 * whether or not the setting should be saved to the database as well.
119 * @param name the name of the setting
120 * @param value the string value of the setting
121 * @return whether to continue with writing the value to the database. In
122 * some cases the data will be written by the call to the appropriate API,
123 * and in some cases the property value needs to be modified before setting.
124 */
Christopher Tate6597e342015-02-17 12:15:25 -0800125 public void restoreValue(Context context, ContentResolver cr, ContentValues contentValues,
Michal Karpinski6135a262017-08-11 10:45:58 +0100126 Uri destination, String name, String value, int restoredFromSdkInt) {
Christopher Tate6597e342015-02-17 12:15:25 -0800127 // Will we need a post-restore broadcast for this element?
128 String oldValue = null;
129 boolean sendBroadcast = false;
130 final SettingsLookup table;
131
132 if (destination.equals(Settings.Secure.CONTENT_URI)) {
133 table = sSecureLookup;
134 } else if (destination.equals(Settings.System.CONTENT_URI)) {
135 table = sSystemLookup;
136 } else { /* must be GLOBAL; this was preflighted by the caller */
137 table = sGlobalLookup;
Amith Yamasani70c874b2009-07-06 14:53:25 -0700138 }
Christopher Tate6597e342015-02-17 12:15:25 -0800139
140 if (sBroadcastOnRestore.contains(name)) {
Xiaohui Chen43765b72015-08-31 10:57:33 -0700141 // TODO: http://b/22388012
142 oldValue = table.lookup(cr, name, UserHandle.USER_SYSTEM);
Christopher Tate6597e342015-02-17 12:15:25 -0800143 sendBroadcast = true;
144 }
145
146 try {
147 if (Settings.System.SCREEN_BRIGHTNESS.equals(name)) {
148 setBrightness(Integer.parseInt(value));
149 // fall through to the ordinary write to settings
150 } else if (Settings.System.SOUND_EFFECTS_ENABLED.equals(name)) {
151 setSoundEffects(Integer.parseInt(value) == 1);
152 // fall through to the ordinary write to settings
153 } else if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
154 setGpsLocation(value);
155 return;
156 } else if (Settings.Secure.BACKUP_AUTO_RESTORE.equals(name)) {
157 setAutoRestore(Integer.parseInt(value) == 1);
158 } else if (isAlreadyConfiguredCriticalAccessibilitySetting(name)) {
159 return;
160 } else if (Settings.System.RINGTONE.equals(name)
161 || Settings.System.NOTIFICATION_SOUND.equals(name)) {
162 setRingtone(name, value);
163 return;
164 }
165
166 // Default case: write the restored value to settings
167 contentValues.clear();
168 contentValues.put(Settings.NameValueTable.NAME, name);
169 contentValues.put(Settings.NameValueTable.VALUE, value);
170 cr.insert(destination, contentValues);
171 } catch (Exception e) {
172 // If we fail to apply the setting, by definition nothing happened
173 sendBroadcast = false;
174 } finally {
175 // If this was an element of interest, send the "we just restored it"
176 // broadcast with the historical value now that the new value has
177 // been committed and observers kicked off.
178 if (sendBroadcast) {
179 Intent intent = new Intent(Intent.ACTION_SETTING_RESTORED)
180 .setPackage("android").addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY)
181 .putExtra(Intent.EXTRA_SETTING_NAME, name)
182 .putExtra(Intent.EXTRA_SETTING_NEW_VALUE, value)
Michal Karpinski6135a262017-08-11 10:45:58 +0100183 .putExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE, oldValue)
184 .putExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, restoredFromSdkInt);
Xiaohui Chene4de5a02015-09-22 15:33:31 -0700185 context.sendBroadcastAsUser(intent, UserHandle.SYSTEM, null);
Christopher Tate6597e342015-02-17 12:15:25 -0800186 }
187 }
Amith Yamasani70c874b2009-07-06 14:53:25 -0700188 }
189
Amith Yamasani622bf2222013-09-06 13:54:28 -0700190 public String onBackupValue(String name, String value) {
Marvin Paul8fc50722014-12-23 11:46:33 -0800191 // Special processing for backing up ringtones & notification sounds
Amith Yamasani622bf2222013-09-06 13:54:28 -0700192 if (Settings.System.RINGTONE.equals(name)
193 || Settings.System.NOTIFICATION_SOUND.equals(name)) {
194 if (value == null) {
Marvin Paul8fc50722014-12-23 11:46:33 -0800195 if (Settings.System.RINGTONE.equals(name)) {
196 // For ringtones, we need to distinguish between non-telephony vs telephony
197 if (mTelephonyManager != null && mTelephonyManager.isVoiceCapable()) {
198 // Backup a null ringtone as silent on voice-capable devices
199 return SILENT_RINGTONE;
200 } else {
201 // Skip backup of ringtone on non-telephony devices.
202 return null;
203 }
204 } else {
205 // Backup a null notification sound as silent
206 return SILENT_RINGTONE;
207 }
Amith Yamasani622bf2222013-09-06 13:54:28 -0700208 } else {
209 return getCanonicalRingtoneValue(value);
210 }
211 }
212 // Return the original value
213 return value;
214 }
215
216 /**
217 * Sets the ringtone of type specified by the name.
218 *
219 * @param name should be Settings.System.RINGTONE or Settings.System.NOTIFICATION_SOUND.
220 * @param value can be a canonicalized uri or "_silent" to indicate a silent (null) ringtone.
221 */
222 private void setRingtone(String name, String value) {
223 // If it's null, don't change the default
224 if (value == null) return;
225 Uri ringtoneUri = null;
226 if (SILENT_RINGTONE.equals(value)) {
227 ringtoneUri = null;
228 } else {
229 Uri canonicalUri = Uri.parse(value);
230 ringtoneUri = mContext.getContentResolver().uncanonicalize(canonicalUri);
Amith Yamasani2e804442013-09-11 11:11:19 -0700231 if (ringtoneUri == null) {
232 // Unrecognized or invalid Uri, don't restore
233 return;
234 }
Amith Yamasani622bf2222013-09-06 13:54:28 -0700235 }
236 final int ringtoneType = Settings.System.RINGTONE.equals(name)
237 ? RingtoneManager.TYPE_RINGTONE : RingtoneManager.TYPE_NOTIFICATION;
238 RingtoneManager.setActualDefaultRingtoneUri(mContext, ringtoneType, ringtoneUri);
239 }
240
241 private String getCanonicalRingtoneValue(String value) {
242 final Uri ringtoneUri = Uri.parse(value);
243 final Uri canonicalUri = mContext.getContentResolver().canonicalize(ringtoneUri);
244 return canonicalUri == null ? null : canonicalUri.toString();
245 }
246
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700247 private boolean isAlreadyConfiguredCriticalAccessibilitySetting(String name) {
Anna Galuszafa7786c2015-12-22 10:53:44 -0800248 // These are the critical accessibility settings that are required for users with
249 // accessibility needs to be able to interact with the device. If these settings are
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700250 // already configured, we will not overwrite them. If they are already set,
Anna Galuszafa7786c2015-12-22 10:53:44 -0800251 // it means that the user has performed a global gesture to enable accessibility or set
252 // these settings in the Accessibility portion of the Setup Wizard, and definitely needs
253 // these features working after the restore.
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800254 switch (name) {
255 case Settings.Secure.ACCESSIBILITY_ENABLED:
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800256 case Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD:
257 case Settings.Secure.TOUCH_EXPLORATION_ENABLED:
258 case Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED:
259 case Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED:
260 case Settings.Secure.UI_NIGHT_MODE:
261 return Settings.Secure.getInt(mContext.getContentResolver(), name, 0) != 0;
262 case Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES:
263 case Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES:
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800264 case Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER:
265 case Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE:
266 return !TextUtils.isEmpty(Settings.Secure.getString(
267 mContext.getContentResolver(), name));
268 case Settings.System.FONT_SCALE:
269 return Settings.System.getFloat(mContext.getContentResolver(), name, 1.0f) != 1.0f;
270 default:
271 return false;
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700272 }
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700273 }
274
Christopher Tate03b6d902010-02-26 14:12:03 -0800275 private void setAutoRestore(boolean enabled) {
276 try {
277 IBackupManager bm = IBackupManager.Stub.asInterface(
278 ServiceManager.getService(Context.BACKUP_SERVICE));
279 if (bm != null) {
280 bm.setAutoRestore(enabled);
281 }
282 } catch (RemoteException e) {}
283 }
284
Amith Yamasani70c874b2009-07-06 14:53:25 -0700285 private void setGpsLocation(String value) {
Maggie Benthall67944582013-02-22 14:58:27 -0500286 UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
Maggie Benthalla12fccf2013-03-14 18:02:12 -0400287 if (um.hasUserRestriction(UserManager.DISALLOW_SHARE_LOCATION)) {
Maggie Benthall67944582013-02-22 14:58:27 -0500288 return;
289 }
Amith Yamasani70c874b2009-07-06 14:53:25 -0700290 final String GPS = LocationManager.GPS_PROVIDER;
Maggie Benthalla12fccf2013-03-14 18:02:12 -0400291 boolean enabled =
Maggieaa080f92018-01-04 15:35:11 -0800292 GPS.equals(value) ||
Amith Yamasani70c874b2009-07-06 14:53:25 -0700293 value.startsWith(GPS + ",") ||
294 value.endsWith("," + GPS) ||
295 value.contains("," + GPS + ",");
Maggieaa080f92018-01-04 15:35:11 -0800296 LocationManager lm = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
297 lm.setProviderEnabledForUser(GPS, enabled, Process.myUserHandle());
Amith Yamasani70c874b2009-07-06 14:53:25 -0700298 }
299
300 private void setSoundEffects(boolean enable) {
301 if (enable) {
302 mAudioManager.loadSoundEffects();
303 } else {
304 mAudioManager.unloadSoundEffects();
-b master501eec92009-07-06 13:53:11 -0700305 }
306 }
307
308 private void setBrightness(int brightness) {
309 try {
Mike Lockwood237a2992009-09-15 14:42:16 -0400310 IPowerManager power = IPowerManager.Stub.asInterface(
311 ServiceManager.getService("power"));
312 if (power != null) {
Jeff Brown96307042012-07-27 15:51:34 -0700313 power.setTemporaryScreenBrightnessSettingOverride(brightness);
-b master501eec92009-07-06 13:53:11 -0700314 }
315 } catch (RemoteException doe) {
316
317 }
318 }
319
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700320 /* package */ byte[] getLocaleData() {
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700321 Configuration conf = mContext.getResources().getConfiguration();
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700322 return conf.getLocales().toLanguageTags().getBytes();
323 }
324
325 private static Locale toFullLocale(@NonNull Locale locale) {
326 if (locale.getScript().isEmpty() || locale.getCountry().isEmpty()) {
327 return ULocale.addLikelySubtags(ULocale.forLocale(locale)).toLocale();
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700328 }
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700329 return locale;
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700330 }
331
332 /**
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700333 * Merging the locale came from backup server and current device locale.
334 *
335 * Merge works with following rules.
336 * - The backup locales are appended to the current locale with keeping order.
337 * e.g. current locale "en-US,zh-CN" and backup locale "ja-JP,ko-KR" are merged to
338 * "en-US,zh-CH,ja-JP,ko-KR".
339 *
340 * - Duplicated locales are dropped.
341 * e.g. current locale "en-US,zh-CN" and backup locale "ja-JP,zh-Hans-CN,en-US" are merged to
342 * "en-US,zh-CN,ja-JP".
343 *
344 * - Unsupported locales are dropped.
345 * e.g. current locale "en-US" and backup locale "ja-JP,zh-CN" but the supported locales
346 * are "en-US,zh-CN", the merged locale list is "en-US,zh-CN".
347 *
348 * - The final result locale list only contains the supported locales.
349 * e.g. current locale "en-US" and backup locale "zh-Hans-CN" and supported locales are
350 * "en-US,zh-CN", the merged locale list is "en-US,zh-CN".
351 *
352 * @param restore The locale list that came from backup server.
353 * @param current The device's locale setting.
354 * @param supportedLocales The list of language tags supported by this device.
355 */
356 @VisibleForTesting
357 public static LocaleList resolveLocales(LocaleList restore, LocaleList current,
358 String[] supportedLocales) {
359 final HashMap<Locale, Locale> allLocales = new HashMap<>(supportedLocales.length);
360 for (String supportedLocaleStr : supportedLocales) {
361 final Locale locale = Locale.forLanguageTag(supportedLocaleStr);
362 allLocales.put(toFullLocale(locale), locale);
363 }
364
365 final ArrayList<Locale> filtered = new ArrayList<>(current.size());
366 for (int i = 0; i < current.size(); i++) {
367 final Locale locale = current.get(i);
368 allLocales.remove(toFullLocale(locale));
369 filtered.add(locale);
370 }
371
372 for (int i = 0; i < restore.size(); i++) {
373 final Locale locale = allLocales.remove(toFullLocale(restore.get(i)));
374 if (locale != null) {
375 filtered.add(locale);
376 }
377 }
378
379 if (filtered.size() == current.size()) {
380 return current; // Nothing added to current locale list.
381 }
382
383 return new LocaleList(filtered.toArray(new Locale[filtered.size()]));
384 }
385
386 /**
387 * Sets the locale specified. Input data is the byte representation of comma separated
388 * multiple BCP-47 language tags. For backwards compatibility, strings of the form
Narayan Kamath11bfc222014-07-30 15:42:25 +0100389 * {@code ll_CC} are also accepted, where {@code ll} is a two letter language
390 * code and {@code CC} is a two letter country code.
391 *
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700392 * @param data the comma separated BCP-47 language tags in bytes.
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700393 */
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700394 /* package */ void setLocaleData(byte[] data, int size) {
395 final Configuration conf = mContext.getResources().getConfiguration();
396
397 // Replace "_" with "-" to deal with older backups.
398 final String localeCodes = new String(data, 0, size).replace('_', '-');
399 final LocaleList localeList = LocaleList.forLanguageTags(localeCodes);
400 if (localeList.isEmpty()) {
Christopher Tate45d17582017-06-26 17:35:26 -0700401 return;
402 }
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700403
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700404 final String[] supportedLocales = LocalePicker.getSupportedLocales(mContext);
405 final LocaleList currentLocales = conf.getLocales();
406
407 final LocaleList merged = resolveLocales(localeList, currentLocales, supportedLocales);
408 if (merged.equals(currentLocales)) {
409 return;
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700410 }
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700411
412 try {
Sudheer Shankadc589ac2016-11-10 15:30:17 -0800413 IActivityManager am = ActivityManager.getService();
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700414 Configuration config = am.getConfiguration();
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700415 config.setLocales(merged);
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700416 // indicate this isn't some passing default - the user wants this remembered
417 config.userSetLocale = true;
418
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700419 am.updatePersistentConfiguration(config);
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700420 } catch (RemoteException e) {
421 // Intentionally left blank
422 }
Amith Yamasanid1582142009-07-08 20:04:55 -0700423 }
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700424
Amith Yamasanid1582142009-07-08 20:04:55 -0700425 /**
426 * Informs the audio service of changes to the settings so that
427 * they can be re-read and applied.
428 */
429 void applyAudioSettings() {
430 AudioManager am = new AudioManager(mContext);
431 am.reloadAudioSettings();
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700432 }
-b master501eec92009-07-06 13:53:11 -0700433}