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

Commit 68ae7b3d authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am 61c9ca8e: am 36884392: am 2d4dc8db: Merge "Obtain handler from context in...

am 61c9ca8e: am 36884392: am 2d4dc8db: Merge "Obtain handler from context in CaptioningManager" into mnc-dev

* commit '61c9ca8e':
  Obtain handler from context in CaptioningManager
parents c7abf0fd 61c9ca8e
Loading
Loading
Loading
Loading
+14 −5
Original line number Original line Diff line number Diff line
@@ -52,11 +52,9 @@ public class CaptioningManager {
    /** Default scaling value for caption fonts. */
    /** Default scaling value for caption fonts. */
    private static final float DEFAULT_FONT_SCALE = 1;
    private static final float DEFAULT_FONT_SCALE = 1;


    private final ArrayList<CaptioningChangeListener>
    private final ArrayList<CaptioningChangeListener> mListeners = new ArrayList<>();
            mListeners = new ArrayList<CaptioningChangeListener>();
    private final Handler mHandler = new Handler();

    private final ContentResolver mContentResolver;
    private final ContentResolver mContentResolver;
    private final ContentObserver mContentObserver;


    /**
    /**
     * Creates a new captioning manager for the specified context.
     * Creates a new captioning manager for the specified context.
@@ -65,6 +63,9 @@ public class CaptioningManager {
     */
     */
    public CaptioningManager(Context context) {
    public CaptioningManager(Context context) {
        mContentResolver = context.getContentResolver();
        mContentResolver = context.getContentResolver();

        final Handler handler = new Handler(context.getMainLooper());
        mContentObserver = new MyContentObserver(handler);
    }
    }


    /**
    /**
@@ -220,7 +221,15 @@ public class CaptioningManager {
        }
        }
    }
    }


    private final ContentObserver mContentObserver = new ContentObserver(mHandler) {
    private class MyContentObserver extends ContentObserver {
        private final Handler mHandler;

        public MyContentObserver(Handler handler) {
            super(handler);

            mHandler = handler;
        }

        @Override
        @Override
        public void onChange(boolean selfChange, Uri uri) {
        public void onChange(boolean selfChange, Uri uri) {
            final String uriPath = uri.getPath();
            final String uriPath = uri.getPath();