@qusaieilouti99/call-manager 0.1.42 → 0.1.43

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.
@@ -28,11 +28,20 @@ class CallActivity : Activity() {
28
28
  override fun onCreate(savedInstanceState: Bundle?) {
29
29
  super.onCreate(savedInstanceState)
30
30
  Log.d(TAG, "CallActivity onCreate")
31
- window.addFlags(
32
- WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
33
- WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON or
34
- WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
35
- )
31
+
32
+ // Modern way to handle lock screen bypass (API 27+)
33
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
34
+ setShowWhenLocked(true)
35
+ setTurnScreenOn(true)
36
+ } else {
37
+ // Legacy approach for older versions
38
+ window.addFlags(
39
+ WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
40
+ WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON or
41
+ WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
42
+ )
43
+ }
44
+
36
45
  setContentView(R.layout.activity_call)
37
46
 
38
47
  callId = intent.getStringExtra("callId") ?: ""
@@ -443,14 +443,10 @@ object CallEngine {
443
443
  val launchIntent = context.packageManager.getLaunchIntentForPackage(packageName)
444
444
  launchIntent?.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
445
445
 
446
- // If there are active calls, add the lock screen bypass flags
446
+ // The deprecated lock screen flags have been removed
447
+ // Lock screen bypass is now handled in the target activity (CallActivity, MainActivity)
447
448
  if (isCallActive()) {
448
- launchIntent?.addFlags(
449
- Intent.FLAG_ACTIVITY_SHOW_WHEN_LOCKED or
450
- Intent.FLAG_ACTIVITY_TURN_SCREEN_ON or
451
- Intent.FLAG_ACTIVITY_DISMISS_KEYGUARD
452
- )
453
- Log.d(TAG, "App brought to foreground with lock screen bypass flags due to active call")
449
+ Log.d(TAG, "App brought to foreground due to active call - lock screen handling in target activity")
454
450
  } else {
455
451
  Log.d(TAG, "App brought to foreground via normal launchIntent")
456
452
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qusaieilouti99/call-manager",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "Call manager",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",