-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Remove dead code to set the call state #4359
Conversation
/backport to stable-20.0 |
"IN_CONVERSATION" was set when the activity was created and "state" in the intent extras had the value "resume". However, there is no "state" extra set by default in Android intents, it should be explicitly set, but as it is not set anywhere in Talk Android code that would make it dead code and safe to remove. Moreover, the connection to the call should be initialized again in any case rather than resumed when "onCreate" is called, as it is likely that any previous connection would have been ended if the previous activity instance was destroyed. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
68d8698
to
fdb8692
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @danxuliu, all your comments are correct. This should have been removed when controllers were migrated to activities.
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4359-talk.apk |
Great, thanks for the confirmation :-) |
This change was part of another fix, but I have extracted it to its own pull request for better reviewing, as it is related to the Android activity lifecycle and I am a bit worried to be missing something.
IN_CONVERSATION
was set when the activity was created andstate
in the intent extras has the valueresume
. As far as I know there is nostate
extra set by default in Android intents, it should be explicitly set, but it is not set anywhere in Talk Android code, so that would make it dead code and safe to remove.Moreover, it was added when switching between call view and chat during a call was introduced. At that time the check was done on a BlueLine Labs Controller rather than on an Android Activity, so maybe back then the controller received the
resume
state when switching between controllers in the same activity, but that would be no longer the case after dropping the controllers in favour of standard activities.And even if resuming an activity provided a
resume
state, if I am not mistakenonCreate
is called when the activity is initially created (so it would not make sense to receive aresume
state) or after it was destroyed while in the background and recreated again when moving it to the foregroud again, which I guess would have caused the call to be interrupted anyway, and thus it should start the connection again rather than being marked asIN_CONVERSATION
.But as mentioned I am a bit worried to be missing something in all of the above, so please verify it :-) Thanks!