-
Notifications
You must be signed in to change notification settings - Fork 56
Improve CallService lifecycle, notification handling, and ringing-to-active transition #1588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rahul-lohra
wants to merge
46
commits into
develop
Choose a base branch
from
bugfix/rahullohra/refactor-call-service
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
f3990a7
Refactor call service into smaller classes
rahul-lohra 7b0942c
chore: add logging to notification and lifecycle managers
rahul-lohra dc7f077
feat: Add logging to CallEventObserver
rahul-lohra 55f48bb
feat: Update createdBy on call rejected event
rahul-lohra 6f190b7
chore: add createdByUserId in LocalCallMissedEvent
rahul-lohra 67ffeae
chore: fix missed imports
rahul-lohra d164b57
chore: fix service cancellation from LocalCallMissedEvent
rahul-lohra 9ae4455
chore: refactor
rahul-lohra 2992616
chore: fix notification id for missed-call
rahul-lohra 5cb2299
chore: add logic for time-sensitive services
rahul-lohra 594cc89
chore: temp
rahul-lohra 215fc02
feat: Introduce local call events for better state handling
rahul-lohra 0998fac
Merge branch 'develop' into bugfix/rahullohra/refactor-call-service
rahul-lohra 58afb52
feat: Add reason when leaving call from service
rahul-lohra b5b95e1
Merge branch 'develop' into bugfix/rahullohra/refactor-call-service
aleksandar-apostolov b0702cf
refactor: Rename CallService components and add tests
rahul-lohra 3527dd2
refactor: Rename local call events
rahul-lohra 5a14940
feat: Add notificationId to updateNotification
rahul-lohra 776b4b5
feat: Add `updateNotification` without notification ID
rahul-lohra 697b82a
feat: Make `transitionToAcceptCall` internal
rahul-lohra 8346b9e
fix: Remove stopService call from ServiceLauncher
rahul-lohra 94138cc
chore: Add a TODO comment
rahul-lohra c60b687
chore: Add a TODO comment
rahul-lohra cd1cf38
Merge branch 'develop' into bugfix/rahullohra/refactor-call-service
rahul-lohra 8452835
test: Use RobolectricTestRunner in ServiceStateTest
rahul-lohra ab9b2be
chore: Improve documentation and make local events internal
rahul-lohra ed98b04
feat: Add support for outgoing call notifications
rahul-lohra db54cee
Refactor: Improve notification and service handling for calls
rahul-lohra 53896eb
fix: Remove leftover comments and add clarity
rahul-lohra bbdd712
chore: Remove temporary logging
rahul-lohra bbbbe3f
fix: Correctly report service running state
rahul-lohra 5d38f6f
refactor: Improve service running check
rahul-lohra 9c7d498
refactor: Extract Throttler from Debouncer
rahul-lohra 309e3d6
feat: Throttle call service stop requests
rahul-lohra e5641b5
chore: Re-enable graceful service stop
rahul-lohra d96cdef
chore: Remove TODO comment
rahul-lohra 85dd868
chore: Use notificationId from call state
rahul-lohra 6b073d8
refactor: Use Call specific notification ID in tests
rahul-lohra 4068127
fix: Cancel correct notification ID for calls
rahul-lohra 332a399
chore: Add logging and fix notification ID usage
rahul-lohra b52fe23
Refactor: Improve call service logic and logging
rahul-lohra 1800f99
refactor: Improve incoming call and service stop logic
rahul-lohra 3436f6d
Merge branch 'develop' into bugfix/rahullohra/refactor-call-service
rahul-lohra 2d18d42
chore: Improve foreground service stability and test coverage
rahul-lohra d1f3843
Fix: Make `CallService` safer against null `StreamVideo` instance
rahul-lohra b0c6405
Refactor: Move debugPrintLastStackFrames to AndroidUtils
rahul-lohra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...src/main/kotlin/io/getstream/android/video/generated/models/LocalCallAcceptedPostEvent.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. | ||
| * | ||
| * Licensed under the Stream License; | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://github.com/GetStream/stream-video-android/blob/main/LICENSE | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| @file:Suppress( | ||
| "ArrayInDataClass", | ||
| "EnumEntryName", | ||
| "RemoveRedundantQualifierName", | ||
| "UnusedImport" | ||
| ) | ||
|
|
||
| package io.getstream.android.video.generated.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
| import org.threeten.bp.OffsetDateTime | ||
|
|
||
| /** | ||
| * This event is sent after [CallAcceptedEvent] is consumed in [io.getstream.video.android.core.CallState] | ||
| */ | ||
|
|
||
| internal data class LocalCallAcceptedPostEvent ( | ||
| @Json(name = "call_cid") | ||
| val callCid: String, | ||
|
|
||
| @Json(name = "created_at") | ||
| val createdAt: OffsetDateTime, | ||
|
|
||
| @Json(name = "call") | ||
| val call: CallResponse, | ||
|
|
||
| @Json(name = "user") | ||
| val user: UserResponse, | ||
|
|
||
| @Json(name = "type") | ||
| val type: String | ||
| ) | ||
| : VideoEvent(), WSCallEvent | ||
| { | ||
|
|
||
| override fun getEventType(): String { | ||
| return type | ||
| } | ||
|
|
||
| override fun getCallCID(): String { | ||
| return callCid | ||
| } | ||
| } |
62 changes: 62 additions & 0 deletions
62
...src/main/kotlin/io/getstream/android/video/generated/models/LocalCallRejectedPostEvent.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. | ||
| * | ||
| * Licensed under the Stream License; | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://github.com/GetStream/stream-video-android/blob/main/LICENSE | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| @file:Suppress( | ||
| "ArrayInDataClass", | ||
| "EnumEntryName", | ||
| "RemoveRedundantQualifierName", | ||
| "UnusedImport" | ||
| ) | ||
|
|
||
| package io.getstream.android.video.generated.models | ||
|
|
||
| import com.squareup.moshi.Json | ||
| import org.threeten.bp.OffsetDateTime | ||
|
|
||
| /** | ||
| * This event is sent after [CallRejectedEvent] is consumed in [io.getstream.video.android.core.CallState] | ||
| */ | ||
|
|
||
| internal data class LocalCallRejectedPostEvent ( | ||
| @Json(name = "call_cid") | ||
| val callCid: String, | ||
|
|
||
| @Json(name = "created_at") | ||
| val createdAt: OffsetDateTime, | ||
|
|
||
| @Json(name = "call") | ||
| val call: CallResponse, | ||
|
|
||
| @Json(name = "user") | ||
| val user: UserResponse, | ||
|
|
||
| @Json(name = "type") | ||
| val type: String, | ||
|
|
||
| @Json(name = "reason") | ||
| val reason: String? = null | ||
| ) | ||
| : VideoEvent(), WSCallEvent | ||
| { | ||
|
|
||
| override fun getEventType(): String { | ||
| return type | ||
| } | ||
|
|
||
| override fun getCallCID(): String { | ||
| return callCid | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.