File tree Expand file tree Collapse file tree
android/src/main/java/io/rumors/reactnativesettings/listeners Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313import java .util .concurrent .CountDownLatch ;
1414
15-
1615public class CaptioningChangeListener extends CaptioningManager .CaptioningChangeListener {
1716 private Context mContext ;
1817
1918 private CaptioningManager mCaptioningManager ;
2019
2120 private CaptioningManager getCaptioningManager () {
22- if (Build .VERSION .SDK_INT > Build .VERSION_CODES .LOLLIPOP ) {
21+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
2322 return (CaptioningManager ) mContext .getSystemService (Context .CAPTIONING_SERVICE );
2423 } else {
2524 // Android <= 5 bug workaround
@@ -28,19 +27,19 @@ private CaptioningManager getCaptioningManager() {
2827
2928 Handler handler = new Handler (Looper .getMainLooper ());
3029 handler .post (new Runnable () {
31- @ Override
32- public void run () {
33- mCaptioningManager = (CaptioningManager ) mContext .getSystemService (Context .CAPTIONING_SERVICE );
34- latch .countDown ();
35- }
30+ @ Override
31+ public void run () {
32+ mCaptioningManager = (CaptioningManager ) mContext .getSystemService (Context .CAPTIONING_SERVICE );
33+ latch .countDown ();
34+ }
3635 });
37-
36+
3837 try {
39- latch .await ();
38+ latch .await ();
4039 } catch (InterruptedException e ) {
41- e .printStackTrace ();
40+ e .printStackTrace ();
4241 }
43-
42+
4443 return mCaptioningManager ;
4544 }
4645 }
You can’t perform that action at this time.
0 commit comments