Merge "Fix Live Caption does not follow caption size if caption is not enabled" into tm-dev
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.accessibility;
|
package com.android.settings.accessibility;
|
||||||
|
|
||||||
|
import static com.android.settings.accessibility.AccessibilityUtil.State.ON;
|
||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -400,6 +402,7 @@ public class CaptionAppearanceFragment extends DashboardFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshPreviewText();
|
refreshPreviewText();
|
||||||
|
enableCaptioningManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -409,16 +412,26 @@ public class CaptionAppearanceFragment extends DashboardFragment
|
|||||||
Settings.Secure.putString(
|
Settings.Secure.putString(
|
||||||
cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_TYPEFACE, (String) value);
|
cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_TYPEFACE, (String) value);
|
||||||
refreshPreviewText();
|
refreshPreviewText();
|
||||||
|
enableCaptioningManager();
|
||||||
} else if (mFontSize == preference) {
|
} else if (mFontSize == preference) {
|
||||||
Settings.Secure.putFloat(
|
Settings.Secure.putFloat(
|
||||||
cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE,
|
cr, Settings.Secure.ACCESSIBILITY_CAPTIONING_FONT_SCALE,
|
||||||
Float.parseFloat((String) value));
|
Float.parseFloat((String) value));
|
||||||
refreshPreviewText();
|
refreshPreviewText();
|
||||||
|
enableCaptioningManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void enableCaptioningManager() {
|
||||||
|
if (mCaptioningManager.isEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Settings.Secure.putInt(getContentResolver(),
|
||||||
|
Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, ON);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHelpResource() {
|
public int getHelpResource() {
|
||||||
return R.string.help_url_caption;
|
return R.string.help_url_caption;
|
||||||
|
Reference in New Issue
Block a user