From 6d6329621e8881683008fde201f8d5f41eabb1b1 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Wed, 24 Aug 2011 11:51:37 +0100 Subject: [PATCH] Deprecate old TTS settings that are no longer in use. These settings can never be written to by engines and apps anyway, and reading them does not serve any useful purpose. The only code that needs to read these settings are the framework TTS classes. bug:5149036 Change-Id: I1f95977d241eb6b550105f45d29fee889da3fbd1 --- api/current.txt | 8 +++--- core/java/android/provider/Settings.java | 32 ++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/api/current.txt b/api/current.txt index 033cccbe33567..4f3986126309b 100644 --- a/api/current.txt +++ b/api/current.txt @@ -17120,14 +17120,14 @@ package android.provider { field public static final java.lang.String SETTINGS_CLASSNAME = "settings_classname"; field public static final java.lang.String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; field public static final java.lang.String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; - field public static final java.lang.String TTS_DEFAULT_COUNTRY = "tts_default_country"; - field public static final java.lang.String TTS_DEFAULT_LANG = "tts_default_lang"; + field public static final deprecated java.lang.String TTS_DEFAULT_COUNTRY = "tts_default_country"; + field public static final deprecated java.lang.String TTS_DEFAULT_LANG = "tts_default_lang"; field public static final java.lang.String TTS_DEFAULT_PITCH = "tts_default_pitch"; field public static final java.lang.String TTS_DEFAULT_RATE = "tts_default_rate"; field public static final java.lang.String TTS_DEFAULT_SYNTH = "tts_default_synth"; - field public static final java.lang.String TTS_DEFAULT_VARIANT = "tts_default_variant"; + field public static final deprecated java.lang.String TTS_DEFAULT_VARIANT = "tts_default_variant"; field public static final java.lang.String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; - field public static final java.lang.String TTS_USE_DEFAULTS = "tts_use_defaults"; + field public static final deprecated java.lang.String TTS_USE_DEFAULTS = "tts_use_defaults"; field public static final java.lang.String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; field public static final java.lang.String USE_GOOGLE_MAIL = "use_google_mail"; field public static final java.lang.String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 15c57e6745e14..a789e305207a5 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -38,6 +38,7 @@ import android.os.BatteryManager; import android.os.Bundle; import android.os.RemoteException; import android.os.SystemProperties; +import android.speech.tts.TextToSpeech; import android.text.TextUtils; import android.util.AndroidException; import android.util.Log; @@ -1062,7 +1063,7 @@ public final class Settings { public static void clearConfiguration(Configuration inoutConfig) { inoutConfig.fontScale = 0; } - + /** * Convenience function to write a batch of configuration-related * settings from a {@link Configuration} object. @@ -2781,7 +2782,11 @@ public final class Settings { * of the application settings. * 1 = override application settings, * 0 = use application settings (if specified). + * + * @deprecated The value of this setting is no longer respected by + * the framework text to speech APIs as of the Ice Cream Sandwich release. */ + @Deprecated public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; /** @@ -2801,24 +2806,46 @@ public final class Settings { /** * Default text-to-speech language. + * + * @deprecated this setting is no longer in use, as of the Ice Cream + * Sandwich release. Apps should never need to read this setting directly, + * instead can query the TextToSpeech framework classes for the default + * locale. {@link TextToSpeech#getLanguage()}. */ + @Deprecated public static final String TTS_DEFAULT_LANG = "tts_default_lang"; /** * Default text-to-speech country. + * + * @deprecated this setting is no longer in use, as of the Ice Cream + * Sandwich release. Apps should never need to read this setting directly, + * instead can query the TextToSpeech framework classes for the default + * locale. {@link TextToSpeech#getLanguage()}. */ + @Deprecated public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; /** * Default text-to-speech locale variant. + * + * @deprecated this setting is no longer in use, as of the Ice Cream + * Sandwich release. Apps should never need to read this setting directly, + * instead can query the TextToSpeech framework classes for the + * locale that is in use {@link TextToSpeech#getLanguage()}. */ + @Deprecated public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; /** * Stores the default tts locales on a per engine basis. Stored as * a comma seperated list of values, each value being of the form * {@code engine_name:locale} for example, - * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. + * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This + * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and + * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this + * setting directly, and can query the TextToSpeech framework classes + * for the locale that is in use. * * @hide */ @@ -4007,6 +4034,7 @@ public final class Settings { TTS_DEFAULT_LANG, TTS_DEFAULT_COUNTRY, TTS_ENABLED_PLUGINS, + TTS_DEFAULT_LOCALE, WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, WIFI_NUM_OPEN_NETWORKS_KEPT,