File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
android/src/main/java/io/wazo/callkeep Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 35
35
import android .net .Uri ;
36
36
import android .os .Build ;
37
37
import android .os .Bundle ;
38
+ import android .os .Looper ;
38
39
import android .view .WindowManager ;
39
40
import androidx .annotation .NonNull ;
40
41
import androidx .annotation .Nullable ;
@@ -303,6 +304,7 @@ public void stopListenToNativeCallsState() {
303
304
telephonyManager .unregisterTelephonyCallback (callStateListener );
304
305
} else if (Build .VERSION .SDK_INT < Build .VERSION_CODES .S && legacyCallStateListener != null ){
305
306
telephonyManager .listen (legacyCallStateListener , PhoneStateListener .LISTEN_NONE );
307
+ Looper .myLooper ().quit ();
306
308
}
307
309
}
308
310
@@ -316,8 +318,10 @@ public void listenToNativeCallsState() {
316
318
callStateListener = new CallStateListener ();
317
319
telephonyManager .registerTelephonyCallback (context .getMainExecutor (),callStateListener );
318
320
} else {
321
+ Looper .prepare ();
319
322
legacyCallStateListener = new LegacyCallStateListener ();
320
323
telephonyManager .listen (legacyCallStateListener , PhoneStateListener .LISTEN_CALL_STATE );
324
+ Looper .loop ();
321
325
}
322
326
}
323
327
}
You can’t perform that action at this time.
0 commit comments