Skip to content

Commit 3dff8c8

Browse files
authored
Merge pull request #21 from aguedob/master
Show pincode screen after accepting the call
2 parents 793a436 + 68ac889 commit 3dff8c8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

android/src/main/java/com/incomingcall/UnlockScreenActivity.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.incomingcall;
22

3+
import android.app.KeyguardManager;
34
import android.content.Intent;
5+
import android.os.Build;
46
import android.os.Bundle;
57
import android.util.Log;
68
import 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

0 commit comments

Comments
 (0)