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

* commit '3688439287948303ad0652df69565168f4c7f2bf':
  Obtain handler from context in CaptioningManager
This commit is contained in:
Alan Viverette
2015-06-15 18:27:47 +00:00
committed by Android Git Automerger

View File

@@ -52,11 +52,9 @@ public class CaptioningManager {
/** Default scaling value for caption fonts. */
private static final float DEFAULT_FONT_SCALE = 1;
private final ArrayList<CaptioningChangeListener>
mListeners = new ArrayList<CaptioningChangeListener>();
private final Handler mHandler = new Handler();
private final ArrayList<CaptioningChangeListener> mListeners = new ArrayList<>();
private final ContentResolver mContentResolver;
private final ContentObserver mContentObserver;
/**
* Creates a new captioning manager for the specified context.
@@ -65,6 +63,9 @@ public class CaptioningManager {
*/
public CaptioningManager(Context context) {
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
public void onChange(boolean selfChange, Uri uri) {
final String uriPath = uri.getPath();