rns-nativecall 0.7.9 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rnsnativecall/AcceptCallActivity.kt +13 -62
- package/android/src/main/java/com/rnsnativecall/CallActionReceiver.kt +46 -25
- package/android/src/main/java/com/rnsnativecall/CallForegroundService.kt +54 -31
- package/android/src/main/java/com/rnsnativecall/CallMessagingService.kt +0 -1
- package/android/src/main/java/com/rnsnativecall/CallModule.kt +26 -5
- package/android/src/main/java/com/rnsnativecall/NativeCallManager.kt +89 -98
- package/android/src/main/java/com/rnsnativecall/NotificationOverlayActivity.kt +26 -0
- package/android/src/main/java/com/rnsnativecall/UnlockReceiver.kt +22 -0
- package/android/src/main/res/drawable/circle_background.xml +4 -0
- package/android/src/main/res/drawable/ic_call_answer_white.xml +9 -0
- package/android/src/main/res/drawable/ic_call_end_white.xml +9 -0
- package/android/src/main/res/layout/activity_incoming_call.xml +139 -0
- package/index.d.ts +6 -0
- package/index.js +15 -0
- package/ios/CallModule.m +56 -26
- package/package.json +1 -1
- package/withNativeCallVoip.js +130 -68
- package/android/src/main/java/com/rnsnativecall/UnlockPromptActivity.kt +0 -55
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
package com.rnsnativecall
|
|
2
|
-
|
|
3
|
-
import android.app.Activity
|
|
4
|
-
import android.app.KeyguardManager
|
|
5
|
-
import android.content.Context
|
|
6
|
-
import android.content.Intent
|
|
7
|
-
import android.os.Build
|
|
8
|
-
import android.os.Bundle
|
|
9
|
-
import android.view.WindowManager
|
|
10
|
-
|
|
11
|
-
class UnlockPromptActivity : Activity() {
|
|
12
|
-
override fun onCreate(savedInstanceState: Bundle?) {
|
|
13
|
-
super.onCreate(savedInstanceState)
|
|
14
|
-
|
|
15
|
-
// Ensure this activity shows over the lockscreen to trigger the prompt
|
|
16
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
|
17
|
-
setShowWhenLocked(true)
|
|
18
|
-
setTurnScreenOn(true)
|
|
19
|
-
} else {
|
|
20
|
-
window.addFlags(
|
|
21
|
-
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
|
|
22
|
-
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
val km = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
|
|
27
|
-
|
|
28
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
29
|
-
km.requestDismissKeyguard(this, object : KeyguardManager.KeyguardDismissCallback() {
|
|
30
|
-
override fun onDismissSucceeded() {
|
|
31
|
-
super.onDismissSucceeded()
|
|
32
|
-
// Unlock successful, launch the main app
|
|
33
|
-
val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
|
|
34
|
-
startActivity(launchIntent)
|
|
35
|
-
finish()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
override fun onDismissCancelled() {
|
|
39
|
-
super.onDismissCancelled()
|
|
40
|
-
finish()
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
override fun onDismissError() {
|
|
44
|
-
super.onDismissError()
|
|
45
|
-
finish()
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
} else {
|
|
49
|
-
// Fallback for older Android versions
|
|
50
|
-
val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
|
|
51
|
-
startActivity(launchIntent)
|
|
52
|
-
finish()
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|