@qusaieilouti99/call-manager 0.1.41 → 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.
|
@@ -1,67 +1,22 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
package="com.margelo.nitro.qusaieilouti99.callmanager">
|
|
2
3
|
|
|
3
|
-
<!--
|
|
4
|
+
<!-- Essential permissions that the library requires -->
|
|
4
5
|
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
|
|
5
|
-
|
|
6
|
+
<uses-permission android:name="android.permission.BIND_TELECOM_CONNECTION_SERVICE" />
|
|
6
7
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
7
|
-
<!-- Required for changing audio routes like speakerphone -->
|
|
8
8
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
|
9
|
-
<!-- For keeping screen awake during calls -->
|
|
10
9
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
11
|
-
<!-- For vibrating the device (e.g., incoming call) -->
|
|
12
10
|
<uses-permission android:name="android.permission.VIBRATE" />
|
|
11
|
+
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
|
12
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
13
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
14
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
|
13
15
|
|
|
14
|
-
<!-- Bluetooth permissions
|
|
15
|
-
<!-- For Android 11 (API 30) and lower -->
|
|
16
|
+
<!-- Bluetooth permissions -->
|
|
16
17
|
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
|
|
17
18
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
|
|
18
|
-
<!-- For Android 12 (API 31) and higher -->
|
|
19
19
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
|
20
20
|
|
|
21
|
-
<!--
|
|
22
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
23
|
-
<!-- Required for foreground service with phoneCall type on Android 12 (API 31) and higher -->
|
|
24
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
|
25
|
-
|
|
26
|
-
<application>
|
|
27
|
-
<!-- Your CallActivity for full-screen incoming call UI -->
|
|
28
|
-
<activity
|
|
29
|
-
android:name=".CallActivity"
|
|
30
|
-
android:exported="true"
|
|
31
|
-
android:showOnLockScreen="true"
|
|
32
|
-
android:turnScreenOn="true"
|
|
33
|
-
android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
|
|
34
|
-
android:screenOrientation="portrait"
|
|
35
|
-
android:launchMode="singleTop"
|
|
36
|
-
android:excludeFromRecents="true"
|
|
37
|
-
android:taskAffinity=""
|
|
38
|
-
android:windowSoftInputMode="adjustResize">
|
|
39
|
-
<intent-filter>
|
|
40
|
-
<action android:name="android.intent.action.VIEW"/>
|
|
41
|
-
<category android:name="android.intent.category.DEFAULT"/>
|
|
42
|
-
</intent-filter>
|
|
43
|
-
</activity>
|
|
44
|
-
|
|
45
|
-
<!-- The ConnectionService, crucial for Telecom API integration -->
|
|
46
|
-
<service
|
|
47
|
-
android:name=".MyConnectionService"
|
|
48
|
-
android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
|
|
49
|
-
android:exported="true">
|
|
50
|
-
<intent-filter>
|
|
51
|
-
<action android:name="android.telecom.ConnectionService" />
|
|
52
|
-
</intent-filter>
|
|
53
|
-
</service>
|
|
54
|
-
|
|
55
|
-
<!-- The foreground service to keep the call alive in the background -->
|
|
56
|
-
<service
|
|
57
|
-
android:name=".CallForegroundService"
|
|
58
|
-
android:enabled="true"
|
|
59
|
-
android:exported="false"
|
|
60
|
-
android:foregroundServiceType="phoneCall" />
|
|
61
|
-
|
|
62
|
-
<!-- Receiver for notification actions (Answer/Decline) -->
|
|
63
|
-
<receiver
|
|
64
|
-
android:name=".CallNotificationActionReceiver"
|
|
65
|
-
android:exported="false" />
|
|
66
|
-
</application>
|
|
21
|
+
<!-- No components needed here - they're declared in app manifest -->
|
|
67
22
|
</manifest>
|
|
@@ -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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
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
|
}
|