@qusaieilouti99/call-manager 0.1.75 → 0.1.76
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.
|
@@ -92,14 +92,21 @@ class CallActivity : Activity() {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// NEW: Register broadcast receiver
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
val filter = IntentFilter("com.qusaieilouti99.callmanager.CLOSE_CALL_ACTIVITY")
|
|
96
|
+
try {
|
|
97
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
98
|
+
registerReceiver(closeReceiver, filter, Context.RECEIVER_NOT_EXPORTED)
|
|
99
|
+
Log.d(TAG, "Broadcast receiver registered successfully (API 33+)")
|
|
100
|
+
} else {
|
|
101
|
+
registerReceiver(closeReceiver, filter)
|
|
102
|
+
Log.d(TAG, "Broadcast receiver registered successfully (API < 33)")
|
|
103
|
+
}
|
|
104
|
+
} catch (e: Exception) {
|
|
105
|
+
Log.e(TAG, "Failed to register broadcast receiver: ${e.message}", e)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
timeoutHandler.postDelayed(timeoutRunnable, 60_000)
|
|
109
|
+
Log.d(TAG, "CallActivity onCreate - END")
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
override fun onDestroy() {
|
|
@@ -1094,16 +1094,21 @@ object CallEngine {
|
|
|
1094
1094
|
// --- Media Management ---
|
|
1095
1095
|
private fun playRingtone() {
|
|
1096
1096
|
val context = requireContext()
|
|
1097
|
-
|
|
1098
|
-
return // System handles it
|
|
1099
|
-
}
|
|
1097
|
+
Log.d(TAG, "playRingtone() called")
|
|
1100
1098
|
|
|
1101
1099
|
try {
|
|
1102
1100
|
val uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)
|
|
1101
|
+
Log.d(TAG, "Ringtone URI: $uri")
|
|
1102
|
+
|
|
1103
1103
|
ringtone = RingtoneManager.getRingtone(context, uri)
|
|
1104
|
-
ringtone
|
|
1104
|
+
if (ringtone != null) {
|
|
1105
|
+
ringtone?.play()
|
|
1106
|
+
Log.d(TAG, "Ringtone started playing successfully")
|
|
1107
|
+
} else {
|
|
1108
|
+
Log.w(TAG, "Ringtone is null, cannot play")
|
|
1109
|
+
}
|
|
1105
1110
|
} catch (e: Exception) {
|
|
1106
|
-
Log.e(TAG, "Failed to play ringtone: ${e.message}")
|
|
1111
|
+
Log.e(TAG, "Failed to play ringtone: ${e.message}", e)
|
|
1107
1112
|
}
|
|
1108
1113
|
}
|
|
1109
1114
|
|