[expo-sms][android] fix flicker on sendSMSAsync if there are no attachments #8639
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.
Why
Found during QA that after #7967, if the messages app is not already open in the background, calling
sendSMSAsync
causes a weird flicker where the home screen flashes for a second, then goes back to the app, then finally to the messages app. This happens on both an Android 10 device and emulator.Determined that the change in Intent type was the cause, tried experimenting with different intent types (
ACTION_SENDTO
,ACTION_SEND
,ACTION_SEND_MULTIPLE
) and usingIntent.createChooser
but could not find a combination that successfully opened Messages without a flicker AND worked with attachments.How
Work around this issue by using the previous logic (
ACTION_SENDTO
intent) for messages without attachments, and the new logic (with the flicker) only for messages with attachments. This prevents regressions for people who aren't using the new feature and reduces the chances end users will encounter this flicker.Test Plan
SMS tests in test-suite all pass, and the test without an attachment no longer causes a flicker when Messages is not already open in the background.