Skip to content

aosp: Show the network error dialog - #13273

Merged
sacuff merged 2 commits into
youtube:mainfrom
ogarai:yts/fix_aosp_network_error_dialog
Oct 12, 2026
Merged

sacuff merged 2 commits into
youtube:mainfrom
ogarai:yts/fix_aosp_network_error_dialog

Conversation

@ogarai

@ogarai ogarai commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

SbSystemRaisePlatformError() was a stub on AOSP that returned false. So when the first page failed to load, for example on an offline cold launch, no network dialog appeared and the app stayed on a black screen.

Use the Android implementation. Add an AOSP version of PlatformError, raised from the AOSP StarboardBridge, since the Android TV one depends on classes AOSP doesn't build. Like on Android TV, retry once the device is back online.

Test: A cold launch with Wi-Fi off shows the network dialog instead of a black screen. Turning Wi-Fi back on reloads the page. Try again reloads, and Dismiss exits.

Fixed: 570462369

SbSystemRaisePlatformError() was a stub on AOSP that returned false.
So when the first page failed to load, for example on an offline cold
launch, no network dialog appeared and the app stayed on a black
screen.

Use the Android implementation. Add an AOSP version of PlatformError,
raised from the AOSP StarboardBridge, since the Android TV one depends
on classes AOSP doesn't build. Like on Android TV, retry once the
device is back online.

Test: A cold launch with Wi-Fi off shows the network dialog instead
of a black screen. Turning Wi-Fi back on reloads the page. Try again
reloads, and Dismiss exits.

Bug: 570462369
@ogarai
ogarai requested a review from a team as a code owner October 9, 2026 17:35
@ogarai
ogarai requested a review from andrewsavage1 October 9, 2026 17:35
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ⏳ PENDING Checks are running
CI / android ⏳ PENDING Checks are running
CI / evergreen ⏳ PENDING Checks are running
CI / linux ⏳ PENDING Checks are running
CI / tvos ⏳ PENDING Checks are running
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


android: Show network error dialog on AOSP

Implement SbSystemRaisePlatformError for AOSP by introducing an
AOSP-specific PlatformError class and updating StarboardBridge.

Previously, SbSystemRaisePlatformError was a stub on AOSP that
returned false. This caused the application to display a black
screen during failures like an offline cold launch, as no error
dialog was presented. The new implementation shows a network
error dialog and automatically retries once the device is back
online, matching the behavior of the Android TV implementation.

Bug: 570462369

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an AOSP-specific implementation of PlatformError to handle platform error dialogs and network retry logic, integrating it into the Starboard build configuration and updating StarboardBridge and MainActivity to use it. Feedback on these changes highlights two key areas: first, the new PlatformError class needs a comprehensive class comment documenting its purpose, lifetime, and threading model to comply with the repository style guide; second, a potential memory leak in unregisterNetworkCallback should be addressed by safely falling back to the dialog's context if the activity has already been destroyed.

@sacuff
sacuff enabled auto-merge (squash) October 9, 2026 21:45
@sacuff
sacuff merged commit 2416ea7 into youtube:main Oct 12, 2026
1012 of 1025 checks passed
briantting pushed a commit that referenced this pull request Oct 14, 2026
Refer to original PR: #13273

SbSystemRaisePlatformError() was a stub on AOSP that returned false. So
when the first page failed to load, for example on an offline cold
launch, no network dialog appeared and the app stayed on a black screen.

Use the Android implementation. Add an AOSP version of PlatformError,
raised from the AOSP StarboardBridge, since the Android TV one depends
on classes AOSP doesn't build. Like on Android TV, retry once the device
is back online.

Test: A cold launch with Wi-Fi off shows the network dialog instead of a
black screen. Turning Wi-Fi back on reloads the page. Try again reloads,
and Dismiss exits.

Fixed: 570462369

(cherry picked from commit 2416ea7)
briantting pushed a commit that referenced this pull request Oct 16, 2026
Refer to original PR: #13273

SbSystemRaisePlatformError() was a stub on AOSP that returned false. So
when the first page failed to load, for example on an offline cold
launch, no network dialog appeared and the app stayed on a black screen.

Use the Android implementation. Add an AOSP version of PlatformError,
raised from the AOSP StarboardBridge, since the Android TV one depends
on classes AOSP doesn't build. Like on Android TV, retry once the device
is back online.

Test: A cold launch with Wi-Fi off shows the network dialog instead of a
black screen. Turning Wi-Fi back on reloads the page. Try again reloads,
and Dismiss exits.

Fixed: 570462369

(cherry picked from commit 2416ea7)
@ogarai
ogarai deleted the yts/fix_aosp_network_error_dialog branch November 4, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants