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

Commit 87399fc2 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

SubtitleController: update to new CaptioningManager APIs



This resolves the build issue.

Change-Id: I4db018c1abd9677ceb6d355921e4f7fa4be3b037
Signed-off-by: default avatarLajos Molnar <lajos@google.com>
Bug: 10326117
parent 85e479b3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ public class SubtitleController {
    private Vector<SubtitleTrack> mTracks;
    private SubtitleTrack mSelectedTrack;
    private boolean mShowing;
    private CaptioningManager mCaptioningManager;

    /**
     * Creates a subtitle controller for a media playback object that implements
@@ -56,6 +57,8 @@ public class SubtitleController {
        mRenderers = new Vector<Renderer>();
        mShowing = false;
        mTracks = new Vector<SubtitleTrack>();
        mCaptioningManager =
            (CaptioningManager)context.getSystemService(Context.CAPTIONING_SERVICE);
    }

    /**
@@ -125,7 +128,7 @@ public class SubtitleController {
     * if no such track exists in this manager.
     */
    public SubtitleTrack getDefaultTrack() {
        Locale locale = CaptioningManager.getLocale(mContext.getContentResolver());
        Locale locale = mCaptioningManager.getLocale();

        for (SubtitleTrack track: mTracks) {
            MediaFormat format = track.getFormat();
@@ -156,7 +159,7 @@ public class SubtitleController {
            selectTrack(track);
            mTrackIsExplicit = false;
            if (!mVisibilityIsExplicit) {
                if (CaptioningManager.isEnabled(mContext.getContentResolver())) {
                if (mCaptioningManager.isEnabled()) {
                    show();
                } else {
                    hide();