Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36b13f36 authored by Mathew Inwood's avatar Mathew Inwood
Browse files

Add @UnsupportedAppUsage annotations

For packages:
  android.speech.tts
  android.speech

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I578e17b05247d77e33b846e7e56633b0b4e4c69f
parent c0ba1b5f
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -4349,17 +4349,6 @@ Landroid/service/wallpaper/WallpaperService$Engine;->mPendingXOffset:F
Landroid/service/wallpaper/WallpaperService$Engine;->setFixedSizeAllowed(Z)V
Landroid/service/wallpaper/WallpaperService$Engine;->setFixedSizeAllowed(Z)V
Landroid/service/wallpaper/WallpaperService;->MSG_WINDOW_RESIZED:I
Landroid/service/wallpaper/WallpaperService;->MSG_WINDOW_RESIZED:I
Landroid/speech/IRecognitionListener;->onEvent(ILandroid/os/Bundle;)V
Landroid/speech/IRecognitionListener;->onEvent(ILandroid/os/Bundle;)V
Landroid/speech/tts/TextToSpeech;->getCurrentEngine()Ljava/lang/String;
Landroid/speech/tts/TextToSpeech;->mConnectingServiceConnection:Landroid/speech/tts/TextToSpeech$Connection;
Landroid/speech/tts/TextToSpeech;->mCurrentEngine:Ljava/lang/String;
Landroid/speech/tts/TextToSpeech;->mInitListener:Landroid/speech/tts/TextToSpeech$OnInitListener;
Landroid/speech/tts/TtsEngines;-><init>(Landroid/content/Context;)V
Landroid/speech/tts/TtsEngines;->getEngines()Ljava/util/List;
Landroid/speech/tts/TtsEngines;->getLocalePrefForEngine(Ljava/lang/String;)Ljava/util/Locale;
Landroid/speech/tts/TtsEngines;->getSettingsIntent(Ljava/lang/String;)Landroid/content/Intent;
Landroid/speech/tts/TtsEngines;->normalizeTTSLocale(Ljava/util/Locale;)Ljava/util/Locale;
Landroid/speech/tts/TtsEngines;->parseLocaleString(Ljava/lang/String;)Ljava/util/Locale;
Landroid/speech/tts/TtsEngines;->updateLocalePrefForEngine(Ljava/lang/String;Ljava/util/Locale;)V
Landroid/system/Int32Ref;->value:I
Landroid/system/Int32Ref;->value:I
Landroid/system/OsConstants;-><init>()V
Landroid/system/OsConstants;-><init>()V
Landroid/system/OsConstants;->AF_NETLINK:I
Landroid/system/OsConstants;->AF_NETLINK:I
+5 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.Nullable;
import android.annotation.RawRes;
import android.annotation.RawRes;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Context;
@@ -668,8 +669,10 @@ public class TextToSpeech {
    }
    }


    private final Context mContext;
    private final Context mContext;
    @UnsupportedAppUsage
    private Connection mConnectingServiceConnection;
    private Connection mConnectingServiceConnection;
    private Connection mServiceConnection;
    private Connection mServiceConnection;
    @UnsupportedAppUsage
    private OnInitListener mInitListener;
    private OnInitListener mInitListener;
    // Written from an unspecified application thread, read from
    // Written from an unspecified application thread, read from
    // a binder thread.
    // a binder thread.
@@ -686,6 +689,7 @@ public class TextToSpeech {
    private final Map<CharSequence, Uri> mUtterances;
    private final Map<CharSequence, Uri> mUtterances;
    private final Bundle mParams = new Bundle();
    private final Bundle mParams = new Bundle();
    private final TtsEngines mEnginesHelper;
    private final TtsEngines mEnginesHelper;
    @UnsupportedAppUsage
    private volatile String mCurrentEngine = null;
    private volatile String mCurrentEngine = null;


    /**
    /**
@@ -1425,6 +1429,7 @@ public class TextToSpeech {
     * @return the engine currently in use by this TextToSpeech instance.
     * @return the engine currently in use by this TextToSpeech instance.
     * @hide
     * @hide
     */
     */
    @UnsupportedAppUsage
    public String getCurrentEngine() {
    public String getCurrentEngine() {
        return mCurrentEngine;
        return mCurrentEngine;
    }
    }
+8 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ import android.content.res.XmlResourceParser;


import static android.provider.Settings.Secure.getString;
import static android.provider.Settings.Secure.getString;


import android.annotation.UnsupportedAppUsage;
import android.provider.Settings;
import android.provider.Settings;
import android.speech.tts.TextToSpeech.Engine;
import android.speech.tts.TextToSpeech.Engine;
import android.speech.tts.TextToSpeech.EngineInfo;
import android.speech.tts.TextToSpeech.EngineInfo;
@@ -101,6 +102,7 @@ public class TtsEngines {
        sNormalizeCountry = Collections.unmodifiableMap(normalizeCountry);
        sNormalizeCountry = Collections.unmodifiableMap(normalizeCountry);
    }
    }


    @UnsupportedAppUsage
    public TtsEngines(Context ctx) {
    public TtsEngines(Context ctx) {
        mContext = ctx;
        mContext = ctx;
    }
    }
@@ -155,6 +157,7 @@ public class TtsEngines {
     *
     *
     * @return A list of engine info objects. The list can be empty, but never {@code null}.
     * @return A list of engine info objects. The list can be empty, but never {@code null}.
     */
     */
    @UnsupportedAppUsage
    public List<EngineInfo> getEngines() {
    public List<EngineInfo> getEngines() {
        PackageManager pm = mContext.getPackageManager();
        PackageManager pm = mContext.getPackageManager();
        Intent intent = new Intent(Engine.INTENT_ACTION_TTS_SERVICE);
        Intent intent = new Intent(Engine.INTENT_ACTION_TTS_SERVICE);
@@ -194,6 +197,7 @@ public class TtsEngines {
    /**
    /**
     * @return an intent that can launch the settings activity for a given tts engine.
     * @return an intent that can launch the settings activity for a given tts engine.
     */
     */
    @UnsupportedAppUsage
    public Intent getSettingsIntent(String engine) {
    public Intent getSettingsIntent(String engine) {
        PackageManager pm = mContext.getPackageManager();
        PackageManager pm = mContext.getPackageManager();
        Intent intent = new Intent(Engine.INTENT_ACTION_TTS_SERVICE);
        Intent intent = new Intent(Engine.INTENT_ACTION_TTS_SERVICE);
@@ -327,6 +331,7 @@ public class TtsEngines {
     * @param engineName the engine to return the locale for.
     * @param engineName the engine to return the locale for.
     * @return the locale preference for this engine. Will be non null.
     * @return the locale preference for this engine. Will be non null.
     */
     */
    @UnsupportedAppUsage
    public Locale getLocalePrefForEngine(String engineName) {
    public Locale getLocalePrefForEngine(String engineName) {
        return getLocalePrefForEngine(engineName,
        return getLocalePrefForEngine(engineName,
                getString(mContext.getContentResolver(), Settings.Secure.TTS_DEFAULT_LOCALE));
                getString(mContext.getContentResolver(), Settings.Secure.TTS_DEFAULT_LOCALE));
@@ -376,6 +381,7 @@ public class TtsEngines {
     * country codes ({@link Locale#getISO3Language()} and {@link Locale#getISO3Country()}),
     * country codes ({@link Locale#getISO3Language()} and {@link Locale#getISO3Country()}),
     * if it fails to do so, we return null.
     * if it fails to do so, we return null.
     */
     */
    @UnsupportedAppUsage
    public Locale parseLocaleString(String localeString) {
    public Locale parseLocaleString(String localeString) {
        String language = "", country = "", variant = "";
        String language = "", country = "", variant = "";
        if (!TextUtils.isEmpty(localeString)) {
        if (!TextUtils.isEmpty(localeString)) {
@@ -436,6 +442,7 @@ public class TtsEngines {
     * This method tries to convert three-letter language and country codes into their two-letter
     * This method tries to convert three-letter language and country codes into their two-letter
     * equivalents. If it fails to do so, it keeps the value from the TTS locale.
     * equivalents. If it fails to do so, it keeps the value from the TTS locale.
     */
     */
    @UnsupportedAppUsage
    public static Locale normalizeTTSLocale(Locale ttsLocale) {
    public static Locale normalizeTTSLocale(Locale ttsLocale) {
        String language = ttsLocale.getLanguage();
        String language = ttsLocale.getLanguage();
        if (!TextUtils.isEmpty(language)) {
        if (!TextUtils.isEmpty(language)) {
@@ -514,6 +521,7 @@ public class TtsEngines {
     * the passed locale is null, an empty string will be serialized; that empty string, when
     * the passed locale is null, an empty string will be serialized; that empty string, when
     * read back, will evaluate to {@link Locale#getDefault()}.
     * read back, will evaluate to {@link Locale#getDefault()}.
     */
     */
    @UnsupportedAppUsage
    public synchronized void updateLocalePrefForEngine(String engineName, Locale newLocale) {
    public synchronized void updateLocalePrefForEngine(String engineName, Locale newLocale) {
        final String prefList = Settings.Secure.getString(mContext.getContentResolver(),
        final String prefList = Settings.Secure.getString(mContext.getContentResolver(),
                Settings.Secure.TTS_DEFAULT_LOCALE);
                Settings.Secure.TTS_DEFAULT_LOCALE);