@qusaieilouti99/call-manager 0.1.59 → 0.1.60
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/margelo/nitro/qusaieilouti99/callmanager/CallForegroundService.kt
CHANGED
|
@@ -171,11 +171,23 @@ class CallForegroundService : Service() {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
override fun onTaskRemoved(rootIntent: Intent?) {
|
|
174
|
-
|
|
174
|
+
// Figure out which Activity’s task was just removed:
|
|
175
|
+
val removed = rootIntent?.component?.className
|
|
176
|
+
Log.d(TAG, "onTaskRemoved: removedActivity=$removed")
|
|
177
|
+
|
|
178
|
+
// If it was our lock-screen CallActivity, ignore —
|
|
179
|
+
// we only want to clean up when the MAIN app task is swiped away.
|
|
180
|
+
if (removed == CallActivity::class.java.name) {
|
|
181
|
+
Log.d(TAG, "CallActivity was removed; keeping call alive.")
|
|
182
|
+
return
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Otherwise (e.g. MainActivity removed), tear everything down:
|
|
186
|
+
Log.d(TAG, "Main task removed; ending all calls.")
|
|
175
187
|
CallEngine.onApplicationTerminate()
|
|
176
|
-
super.onTaskRemoved(rootIntent)
|
|
177
188
|
stopSelf()
|
|
178
|
-
|
|
189
|
+
super.onTaskRemoved(rootIntent)
|
|
190
|
+
}
|
|
179
191
|
|
|
180
192
|
override fun onDestroy() {
|
|
181
193
|
super.onDestroy()
|