summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/api/current.txt1
-rw-r--r--core/api/system-current.txt1
-rw-r--r--core/java/android/view/accessibility/CaptioningManager.java12
-rw-r--r--core/res/res/values/public.xml2
-rw-r--r--core/res/res/values/symbols.xml2
5 files changed, 15 insertions, 3 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index 17beece326df..011af0fa892f 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -51937,6 +51937,7 @@ package android.view.accessibility {
method public final float getFontScale();
method @Nullable public final java.util.Locale getLocale();
method @NonNull public android.view.accessibility.CaptioningManager.CaptionStyle getUserStyle();
+ method public boolean isCallCaptioningEnabled();
method public final boolean isEnabled();
method public void removeCaptioningChangeListener(@NonNull android.view.accessibility.CaptioningManager.CaptioningChangeListener);
}
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 0be59b1c05e9..fb39fcec7fc9 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -363,7 +363,6 @@ package android {
field public static final int config_showDefaultAssistant = 17891329; // 0x1110001
field public static final int config_showDefaultEmergency = 17891330; // 0x1110002
field public static final int config_showDefaultHome = 17891331; // 0x1110003
- field public static final int config_systemCaptionsServiceCallsEnabled;
}
public static final class R.color {
diff --git a/core/java/android/view/accessibility/CaptioningManager.java b/core/java/android/view/accessibility/CaptioningManager.java
index 3d68692a3b5c..3f6a87196d70 100644
--- a/core/java/android/view/accessibility/CaptioningManager.java
+++ b/core/java/android/view/accessibility/CaptioningManager.java
@@ -22,6 +22,7 @@ import android.annotation.SystemService;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.Color;
import android.graphics.Typeface;
@@ -30,6 +31,8 @@ import android.os.Handler;
import android.provider.Settings.Secure;
import android.text.TextUtils;
+import com.android.internal.R;
+
import java.util.ArrayList;
import java.util.Locale;
@@ -51,6 +54,7 @@ public class CaptioningManager {
private final ArrayList<CaptioningChangeListener> mListeners = new ArrayList<>();
private final ContentResolver mContentResolver;
private final ContentObserver mContentObserver;
+ private final Resources mResources;
/**
* Creates a new captioning manager for the specified context.
@@ -62,6 +66,7 @@ public class CaptioningManager {
final Handler handler = new Handler(context.getMainLooper());
mContentObserver = new MyContentObserver(handler);
+ mResources = context.getResources();
}
/**
@@ -181,6 +186,13 @@ public class CaptioningManager {
}
}
+ /**
+ * Returns true if system wide call captioning is enabled for this device.
+ */
+ public boolean isCallCaptioningEnabled() {
+ return mResources.getBoolean(R.bool.config_systemCaptionsServiceCallsEnabled);
+ }
+
private void notifyEnabledChanged() {
final boolean enabled = isEnabled();
synchronized (mListeners) {
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 1f560f42141f..2764d04722ae 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -3311,8 +3311,6 @@
</staging-public-group>
<staging-public-group type="bool" first-id="0x01cf0000">
- <!-- @hide @SystemApi -->
- <public name="config_systemCaptionsServiceCallsEnabled" />
<!-- @hide @TestApi -->
<public name="config_preventImeStartupUnlessTextEditor" />
</staging-public-group>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index ba4aa81766e0..49649824df14 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3650,6 +3650,8 @@
<java-symbol type="string" name="config_retailDemoPackage" />
<java-symbol type="string" name="config_retailDemoPackageSignature" />
+ <java-symbol type="bool" name="config_systemCaptionsServiceCallsEnabled" />
+
<java-symbol type="string" name="notification_channel_foreground_service" />
<java-symbol type="string" name="foreground_service_app_in_background" />
<java-symbol type="string" name="foreground_service_apps_in_background" />