blob: 36bb8ef623207c1f450b29f7de6970499f1d7dc1 [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
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070019import android.annotation.NonNull;
Sudheer Shankadc589ac2016-11-10 15:30:17 -080020import android.app.ActivityManager;
Amith Yamasani8823c0a82009-07-07 14:30:17 -070021import android.app.IActivityManager;
Christopher Tate45281862010-03-05 15:46:30 -080022import android.app.backup.IBackupManager;
Christopher Tate6597e342015-02-17 12:15:25 -080023import android.content.ContentResolver;
24import android.content.ContentValues;
-b master501eec92009-07-06 13:53:11 -070025import android.content.Context;
Christopher Tate6597e342015-02-17 12:15:25 -080026import android.content.Intent;
Amith Yamasani8823c0a82009-07-07 14:30:17 -070027import android.content.res.Configuration;
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070028import android.icu.util.ULocale;
-b master501eec92009-07-06 13:53:11 -070029import android.media.AudioManager;
Amith Yamasani622bf2222013-09-06 13:54:28 -070030import android.media.RingtoneManager;
31import android.net.Uri;
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070032import android.os.LocaleList;
-b master501eec92009-07-06 13:53:11 -070033import android.os.RemoteException;
34import android.os.ServiceManager;
Christopher Tate6597e342015-02-17 12:15:25 -080035import android.os.UserHandle;
-b master501eec92009-07-06 13:53:11 -070036import android.provider.Settings;
Marvin Paul8fc50722014-12-23 11:46:33 -080037import android.telephony.TelephonyManager;
Amith Yamasani8823c0a82009-07-07 14:30:17 -070038import android.text.TextUtils;
Christopher Tate6597e342015-02-17 12:15:25 -080039import android.util.ArraySet;
-b master501eec92009-07-06 13:53:11 -070040
Soonil Nagarkar6dac9d12019-03-11 15:39:00 -070041import com.android.internal.annotations.VisibleForTesting;
42import com.android.internal.app.LocalePicker;
43
Seigo Nonaka0f19cc72017-06-26 16:06:17 -070044import java.util.ArrayList;
45import java.util.HashMap;
Maggie Benthall67944582013-02-22 14:58:27 -050046import java.util.Locale;
47
-b master501eec92009-07-06 13:53:11 -070048public class SettingsHelper {
Christopher Tate45d17582017-06-26 17:35:26 -070049 private static final String TAG = "SettingsHelper";
Amith Yamasani622bf2222013-09-06 13:54:28 -070050 private static final String SILENT_RINGTONE = "_silent";
Annie Meng95264452018-04-19 17:32:17 +010051 private static final float FLOAT_TOLERANCE = 0.01f;
52
-b master501eec92009-07-06 13:53:11 -070053 private Context mContext;
54 private AudioManager mAudioManager;
Marvin Paul8fc50722014-12-23 11:46:33 -080055 private TelephonyManager mTelephonyManager;
Amith Yamasani70c874b2009-07-06 14:53:25 -070056
Christopher Tate6597e342015-02-17 12:15:25 -080057 /**
58 * A few settings elements are special in that a restore of those values needs to
59 * be post-processed by relevant parts of the OS. A restore of any settings element
60 * mentioned in this table will therefore cause the system to send a broadcast with
61 * the {@link Intent#ACTION_SETTING_RESTORED} action, with extras naming the
62 * affected setting and supplying its pre-restore value for comparison.
63 *
64 * @see Intent#ACTION_SETTING_RESTORED
65 * @see System#SETTINGS_TO_BACKUP
66 * @see Secure#SETTINGS_TO_BACKUP
67 * @see Global#SETTINGS_TO_BACKUP
68 *
69 * {@hide}
70 */
71 private static final ArraySet<String> sBroadcastOnRestore;
72 static {
Yohei Yukawaca780952018-02-07 22:16:32 +090073 sBroadcastOnRestore = new ArraySet<String>(4);
Christopher Tate6597e342015-02-17 12:15:25 -080074 sBroadcastOnRestore.add(Settings.Secure.ENABLED_NOTIFICATION_LISTENERS);
Ruben Brunke24b9a62016-02-16 21:38:24 -080075 sBroadcastOnRestore.add(Settings.Secure.ENABLED_VR_LISTENERS);
Christopher Tate2d4aadc2015-03-16 16:55:14 -070076 sBroadcastOnRestore.add(Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
Stanley Tng767f05f2017-05-01 21:27:31 -070077 sBroadcastOnRestore.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate6597e342015-02-17 12:15:25 -080078 }
79
80 private interface SettingsLookup {
81 public String lookup(ContentResolver resolver, String name, int userHandle);
82 }
83
84 private static SettingsLookup sSystemLookup = new SettingsLookup() {
85 public String lookup(ContentResolver resolver, String name, int userHandle) {
86 return Settings.System.getStringForUser(resolver, name, userHandle);
87 }
88 };
89
90 private static SettingsLookup sSecureLookup = new SettingsLookup() {
91 public String lookup(ContentResolver resolver, String name, int userHandle) {
92 return Settings.Secure.getStringForUser(resolver, name, userHandle);
93 }
94 };
95
96 private static SettingsLookup sGlobalLookup = new SettingsLookup() {
97 public String lookup(ContentResolver resolver, String name, int userHandle) {
98 return Settings.Global.getStringForUser(resolver, name, userHandle);
99 }
100 };
101
-b master501eec92009-07-06 13:53:11 -0700102 public SettingsHelper(Context context) {
103 mContext = context;
104 mAudioManager = (AudioManager) context
105 .getSystemService(Context.AUDIO_SERVICE);
Marvin Paul8fc50722014-12-23 11:46:33 -0800106 mTelephonyManager = (TelephonyManager) context
107 .getSystemService(Context.TELEPHONY_SERVICE);
-b master501eec92009-07-06 13:53:11 -0700108 }
109
Amith Yamasani70c874b2009-07-06 14:53:25 -0700110 /**
111 * Sets the property via a call to the appropriate API, if any, and returns
112 * whether or not the setting should be saved to the database as well.
113 * @param name the name of the setting
114 * @param value the string value of the setting
115 * @return whether to continue with writing the value to the database. In
116 * some cases the data will be written by the call to the appropriate API,
117 * and in some cases the property value needs to be modified before setting.
118 */
Christopher Tate6597e342015-02-17 12:15:25 -0800119 public void restoreValue(Context context, ContentResolver cr, ContentValues contentValues,
Michal Karpinski6135a262017-08-11 10:45:58 +0100120 Uri destination, String name, String value, int restoredFromSdkInt) {
Christopher Tate6597e342015-02-17 12:15:25 -0800121 // Will we need a post-restore broadcast for this element?
122 String oldValue = null;
123 boolean sendBroadcast = false;
124 final SettingsLookup table;
125
126 if (destination.equals(Settings.Secure.CONTENT_URI)) {
127 table = sSecureLookup;
128 } else if (destination.equals(Settings.System.CONTENT_URI)) {
129 table = sSystemLookup;
130 } else { /* must be GLOBAL; this was preflighted by the caller */
131 table = sGlobalLookup;
Amith Yamasani70c874b2009-07-06 14:53:25 -0700132 }
Christopher Tate6597e342015-02-17 12:15:25 -0800133
134 if (sBroadcastOnRestore.contains(name)) {
Xiaohui Chen43765b72015-08-31 10:57:33 -0700135 // TODO: http://b/22388012
136 oldValue = table.lookup(cr, name, UserHandle.USER_SYSTEM);
Christopher Tate6597e342015-02-17 12:15:25 -0800137 sendBroadcast = true;
138 }
139
140 try {
Annie Meng931b41b2018-04-05 18:49:52 +0100141 if (Settings.System.SOUND_EFFECTS_ENABLED.equals(name)) {
Christopher Tate6597e342015-02-17 12:15:25 -0800142 setSoundEffects(Integer.parseInt(value) == 1);
143 // fall through to the ordinary write to settings
Christopher Tate6597e342015-02-17 12:15:25 -0800144 } else if (Settings.Secure.BACKUP_AUTO_RESTORE.equals(name)) {
145 setAutoRestore(Integer.parseInt(value) == 1);
146 } else if (isAlreadyConfiguredCriticalAccessibilitySetting(name)) {
147 return;
148 } else if (Settings.System.RINGTONE.equals(name)
chenedwardc47329b2018-05-03 12:13:45 +0800149 || Settings.System.NOTIFICATION_SOUND.equals(name)
150 || Settings.System.ALARM_ALERT.equals(name)) {
Christopher Tate6597e342015-02-17 12:15:25 -0800151 setRingtone(name, value);
152 return;
153 }
154
155 // Default case: write the restored value to settings
156 contentValues.clear();
157 contentValues.put(Settings.NameValueTable.NAME, name);
158 contentValues.put(Settings.NameValueTable.VALUE, value);
159 cr.insert(destination, contentValues);
160 } catch (Exception e) {
161 // If we fail to apply the setting, by definition nothing happened
162 sendBroadcast = false;
163 } finally {
164 // If this was an element of interest, send the "we just restored it"
165 // broadcast with the historical value now that the new value has
166 // been committed and observers kicked off.
167 if (sendBroadcast) {
168 Intent intent = new Intent(Intent.ACTION_SETTING_RESTORED)
169 .setPackage("android").addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY)
170 .putExtra(Intent.EXTRA_SETTING_NAME, name)
171 .putExtra(Intent.EXTRA_SETTING_NEW_VALUE, value)
Michal Karpinski6135a262017-08-11 10:45:58 +0100172 .putExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE, oldValue)
173 .putExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, restoredFromSdkInt);
Xiaohui Chene4de5a02015-09-22 15:33:31 -0700174 context.sendBroadcastAsUser(intent, UserHandle.SYSTEM, null);
Christopher Tate6597e342015-02-17 12:15:25 -0800175 }
176 }
Amith Yamasani70c874b2009-07-06 14:53:25 -0700177 }
178
Amith Yamasani622bf2222013-09-06 13:54:28 -0700179 public String onBackupValue(String name, String value) {
Marvin Paul8fc50722014-12-23 11:46:33 -0800180 // Special processing for backing up ringtones & notification sounds
Amith Yamasani622bf2222013-09-06 13:54:28 -0700181 if (Settings.System.RINGTONE.equals(name)
chenedwardc47329b2018-05-03 12:13:45 +0800182 || Settings.System.NOTIFICATION_SOUND.equals(name)
183 || Settings.System.ALARM_ALERT.equals(name)) {
Amith Yamasani622bf2222013-09-06 13:54:28 -0700184 if (value == null) {
Marvin Paul8fc50722014-12-23 11:46:33 -0800185 if (Settings.System.RINGTONE.equals(name)) {
186 // For ringtones, we need to distinguish between non-telephony vs telephony
187 if (mTelephonyManager != null && mTelephonyManager.isVoiceCapable()) {
188 // Backup a null ringtone as silent on voice-capable devices
189 return SILENT_RINGTONE;
190 } else {
191 // Skip backup of ringtone on non-telephony devices.
192 return null;
193 }
194 } else {
chenedwardc47329b2018-05-03 12:13:45 +0800195 // Backup a null notification sound or alarm alert as silent
Marvin Paul8fc50722014-12-23 11:46:33 -0800196 return SILENT_RINGTONE;
197 }
Amith Yamasani622bf2222013-09-06 13:54:28 -0700198 } else {
199 return getCanonicalRingtoneValue(value);
200 }
201 }
202 // Return the original value
203 return value;
204 }
205
206 /**
207 * Sets the ringtone of type specified by the name.
208 *
chenedwardc47329b2018-05-03 12:13:45 +0800209 * @param name should be Settings.System.RINGTONE, Settings.System.NOTIFICATION_SOUND
210 * or Settings.System.ALARM_ALERT.
Amith Yamasani622bf2222013-09-06 13:54:28 -0700211 * @param value can be a canonicalized uri or "_silent" to indicate a silent (null) ringtone.
212 */
213 private void setRingtone(String name, String value) {
214 // If it's null, don't change the default
215 if (value == null) return;
chenedwardc47329b2018-05-03 12:13:45 +0800216 final Uri ringtoneUri;
Amith Yamasani622bf2222013-09-06 13:54:28 -0700217 if (SILENT_RINGTONE.equals(value)) {
218 ringtoneUri = null;
219 } else {
220 Uri canonicalUri = Uri.parse(value);
221 ringtoneUri = mContext.getContentResolver().uncanonicalize(canonicalUri);
Amith Yamasani2e804442013-09-11 11:11:19 -0700222 if (ringtoneUri == null) {
223 // Unrecognized or invalid Uri, don't restore
224 return;
225 }
Amith Yamasani622bf2222013-09-06 13:54:28 -0700226 }
chenedwardc47329b2018-05-03 12:13:45 +0800227 final int ringtoneType = getRingtoneType(name);
228
Amith Yamasani622bf2222013-09-06 13:54:28 -0700229 RingtoneManager.setActualDefaultRingtoneUri(mContext, ringtoneType, ringtoneUri);
230 }
231
chenedwardc47329b2018-05-03 12:13:45 +0800232 private int getRingtoneType(String name) {
233 switch (name) {
234 case Settings.System.RINGTONE:
235 return RingtoneManager.TYPE_RINGTONE;
236 case Settings.System.NOTIFICATION_SOUND:
237 return RingtoneManager.TYPE_NOTIFICATION;
238 case Settings.System.ALARM_ALERT:
239 return RingtoneManager.TYPE_ALARM;
240 default:
chenedward70b75b42018-05-10 15:58:44 +0800241 throw new IllegalArgumentException("Incorrect ringtone name: " + name);
chenedwardc47329b2018-05-03 12:13:45 +0800242 }
243 }
244
Amith Yamasani622bf2222013-09-06 13:54:28 -0700245 private String getCanonicalRingtoneValue(String value) {
246 final Uri ringtoneUri = Uri.parse(value);
247 final Uri canonicalUri = mContext.getContentResolver().canonicalize(ringtoneUri);
248 return canonicalUri == null ? null : canonicalUri.toString();
249 }
250
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700251 private boolean isAlreadyConfiguredCriticalAccessibilitySetting(String name) {
Anna Galuszafa7786c2015-12-22 10:53:44 -0800252 // These are the critical accessibility settings that are required for users with
253 // accessibility needs to be able to interact with the device. If these settings are
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700254 // already configured, we will not overwrite them. If they are already set,
Anna Galuszafa7786c2015-12-22 10:53:44 -0800255 // it means that the user has performed a global gesture to enable accessibility or set
256 // these settings in the Accessibility portion of the Setup Wizard, and definitely needs
257 // these features working after the restore.
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800258 switch (name) {
259 case Settings.Secure.ACCESSIBILITY_ENABLED:
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800260 case Settings.Secure.TOUCH_EXPLORATION_ENABLED:
261 case Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED:
262 case Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED:
Annie Meng425c8682018-05-03 16:24:03 +0100263 case Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED:
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800264 return Settings.Secure.getInt(mContext.getContentResolver(), name, 0) != 0;
265 case Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES:
266 case Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES:
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800267 case Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER:
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800268 return !TextUtils.isEmpty(Settings.Secure.getString(
269 mContext.getContentResolver(), name));
Annie Meng95264452018-04-19 17:32:17 +0100270 case Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE:
271 float defaultScale = mContext.getResources().getFraction(
272 R.fraction.def_accessibility_display_magnification_scale, 1, 1);
273 float currentScale = Settings.Secure.getFloat(
274 mContext.getContentResolver(), name, defaultScale);
275 return Math.abs(currentScale - defaultScale) >= FLOAT_TOLERANCE;
Casey Burkhardt86b867f2015-12-29 18:03:36 -0800276 case Settings.System.FONT_SCALE:
277 return Settings.System.getFloat(mContext.getContentResolver(), name, 1.0f) != 1.0f;
278 default:
279 return false;
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700280 }
Svetoslav Ganov818d2042012-09-12 21:35:15 -0700281 }
282
Christopher Tate03b6d902010-02-26 14:12:03 -0800283 private void setAutoRestore(boolean enabled) {
284 try {
285 IBackupManager bm = IBackupManager.Stub.asInterface(
286 ServiceManager.getService(Context.BACKUP_SERVICE));
287 if (bm != null) {
288 bm.setAutoRestore(enabled);
289 }
290 } catch (RemoteException e) {}
291 }
292
Amith Yamasani70c874b2009-07-06 14:53:25 -0700293 private void setSoundEffects(boolean enable) {
294 if (enable) {
295 mAudioManager.loadSoundEffects();
296 } else {
297 mAudioManager.unloadSoundEffects();
-b master501eec92009-07-06 13:53:11 -0700298 }
299 }
300
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700301 /* package */ byte[] getLocaleData() {
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700302 Configuration conf = mContext.getResources().getConfiguration();
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700303 return conf.getLocales().toLanguageTags().getBytes();
304 }
305
306 private static Locale toFullLocale(@NonNull Locale locale) {
307 if (locale.getScript().isEmpty() || locale.getCountry().isEmpty()) {
308 return ULocale.addLikelySubtags(ULocale.forLocale(locale)).toLocale();
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700309 }
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700310 return locale;
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700311 }
312
313 /**
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700314 * Merging the locale came from backup server and current device locale.
315 *
316 * Merge works with following rules.
317 * - The backup locales are appended to the current locale with keeping order.
318 * e.g. current locale "en-US,zh-CN" and backup locale "ja-JP,ko-KR" are merged to
319 * "en-US,zh-CH,ja-JP,ko-KR".
320 *
321 * - Duplicated locales are dropped.
322 * e.g. current locale "en-US,zh-CN" and backup locale "ja-JP,zh-Hans-CN,en-US" are merged to
323 * "en-US,zh-CN,ja-JP".
324 *
325 * - Unsupported locales are dropped.
326 * e.g. current locale "en-US" and backup locale "ja-JP,zh-CN" but the supported locales
327 * are "en-US,zh-CN", the merged locale list is "en-US,zh-CN".
328 *
329 * - The final result locale list only contains the supported locales.
330 * e.g. current locale "en-US" and backup locale "zh-Hans-CN" and supported locales are
331 * "en-US,zh-CN", the merged locale list is "en-US,zh-CN".
332 *
333 * @param restore The locale list that came from backup server.
334 * @param current The device's locale setting.
335 * @param supportedLocales The list of language tags supported by this device.
336 */
337 @VisibleForTesting
338 public static LocaleList resolveLocales(LocaleList restore, LocaleList current,
339 String[] supportedLocales) {
340 final HashMap<Locale, Locale> allLocales = new HashMap<>(supportedLocales.length);
341 for (String supportedLocaleStr : supportedLocales) {
342 final Locale locale = Locale.forLanguageTag(supportedLocaleStr);
343 allLocales.put(toFullLocale(locale), locale);
344 }
345
346 final ArrayList<Locale> filtered = new ArrayList<>(current.size());
347 for (int i = 0; i < current.size(); i++) {
348 final Locale locale = current.get(i);
349 allLocales.remove(toFullLocale(locale));
350 filtered.add(locale);
351 }
352
353 for (int i = 0; i < restore.size(); i++) {
354 final Locale locale = allLocales.remove(toFullLocale(restore.get(i)));
355 if (locale != null) {
356 filtered.add(locale);
357 }
358 }
359
360 if (filtered.size() == current.size()) {
361 return current; // Nothing added to current locale list.
362 }
363
364 return new LocaleList(filtered.toArray(new Locale[filtered.size()]));
365 }
366
367 /**
368 * Sets the locale specified. Input data is the byte representation of comma separated
369 * multiple BCP-47 language tags. For backwards compatibility, strings of the form
Narayan Kamath11bfc222014-07-30 15:42:25 +0100370 * {@code ll_CC} are also accepted, where {@code ll} is a two letter language
371 * code and {@code CC} is a two letter country code.
372 *
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700373 * @param data the comma separated BCP-47 language tags in bytes.
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700374 */
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700375 /* package */ void setLocaleData(byte[] data, int size) {
376 final Configuration conf = mContext.getResources().getConfiguration();
377
378 // Replace "_" with "-" to deal with older backups.
379 final String localeCodes = new String(data, 0, size).replace('_', '-');
380 final LocaleList localeList = LocaleList.forLanguageTags(localeCodes);
381 if (localeList.isEmpty()) {
Christopher Tate45d17582017-06-26 17:35:26 -0700382 return;
383 }
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700384
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700385 final String[] supportedLocales = LocalePicker.getSupportedLocales(mContext);
386 final LocaleList currentLocales = conf.getLocales();
387
388 final LocaleList merged = resolveLocales(localeList, currentLocales, supportedLocales);
389 if (merged.equals(currentLocales)) {
390 return;
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700391 }
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700392
393 try {
Sudheer Shankadc589ac2016-11-10 15:30:17 -0800394 IActivityManager am = ActivityManager.getService();
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700395 Configuration config = am.getConfiguration();
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700396 config.setLocales(merged);
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700397 // indicate this isn't some passing default - the user wants this remembered
398 config.userSetLocale = true;
399
Seigo Nonaka0f19cc72017-06-26 16:06:17 -0700400 am.updatePersistentConfiguration(config);
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700401 } catch (RemoteException e) {
402 // Intentionally left blank
403 }
Amith Yamasanid1582142009-07-08 20:04:55 -0700404 }
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700405
Amith Yamasanid1582142009-07-08 20:04:55 -0700406 /**
407 * Informs the audio service of changes to the settings so that
408 * they can be re-read and applied.
409 */
410 void applyAudioSettings() {
411 AudioManager am = new AudioManager(mContext);
412 am.reloadAudioSettings();
Amith Yamasani8823c0a82009-07-07 14:30:17 -0700413 }
-b master501eec92009-07-06 13:53:11 -0700414}