File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
android/src/main/java/com/incomingcall Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 11package com .incomingcall ;
22
3+ import android .app .KeyguardManager ;
34import android .content .Intent ;
5+ import android .os .Build ;
46import android .os .Bundle ;
57import android .util .Log ;
68import android .view .WindowManager ;
@@ -142,9 +144,20 @@ private void acceptDialing() {
142144 if (!IncomingCallModule .reactContext .hasCurrentActivity ()) {
143145 params .putBoolean ("isHeadless" , true );
144146 }
147+ KeyguardManager mKeyguardManager = (KeyguardManager ) getSystemService (Context .KEYGUARD_SERVICE );
148+
149+ if (mKeyguardManager .isDeviceLocked ()) {
150+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
151+ mKeyguardManager .requestDismissKeyguard (this , new KeyguardManager .KeyguardDismissCallback () {
152+ @ Override
153+ public void onDismissSucceeded () {
154+ super .onDismissSucceeded ();
155+ }
156+ });
157+ }
158+ }
145159
146160 sendEvent ("answerCall" , params );
147-
148161 finish ();
149162 }
150163
You can’t perform that action at this time.
0 commit comments