Skip to content

fix(android-edge-to-edge-support): run setBackgroundColor(...) on ui thread#502

Merged
robingenz merged 1 commit into
mainfrom
3268723623
Apr 29, 2025
Merged

fix(android-edge-to-edge-support): run setBackgroundColor(...) on ui thread#502
robingenz merged 1 commit into
mainfrom
3268723623

Conversation

@robingenz
Copy link
Copy Markdown
Member

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

Close #501
Close #481

@robingenz robingenz requested a review from Copilot April 29, 2025 12:41
@robingenz robingenz self-assigned this Apr 29, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that the execution of setBackgroundColor is shifted to the UI thread, thereby addressing thread safety issues in the Android plugin.

  • Wraps the background color setting and call resolution in runOnUiThread
  • Updates the changeset documentation accordingly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/android-edge-to-edge-support/android/src/main/java/io/capawesome/capacitorjs/plugins/androidedgetoedgesupport/EdgeToEdgePlugin.java Wrap setBackgroundColor() and call.resolve() within runOnUiThread for UI thread safety
.changeset/tender-pears-laugh.md Document the fix in the changeset

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 29, 2025

Open in StackBlitz

@capawesome-team/capacitor-android-battery-optimization

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-android-battery-optimization@502

@capawesome/capacitor-android-dark-mode-support

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-android-dark-mode-support@502

@capawesome/capacitor-android-edge-to-edge-support

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-android-edge-to-edge-support@502

@capawesome-team/capacitor-android-foreground-service

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-android-foreground-service@502

@capawesome/capacitor-app-review

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-review@502

@capawesome/capacitor-app-shortcuts

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-shortcuts@502

@capawesome/capacitor-app-update

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-update@502

@capawesome/capacitor-asset-manager

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-asset-manager@502

@capawesome/capacitor-background-task

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-background-task@502

@capawesome/capacitor-badge

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-badge@502

@capawesome/capacitor-cloudinary

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-cloudinary@502

@capawesome-team/capacitor-datetime-picker

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-datetime-picker@502

@capawesome-team/capacitor-file-opener

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-file-opener@502

@capawesome/capacitor-file-picker

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-file-picker@502

@capawesome/capacitor-live-update

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-live-update@502

@capawesome/capacitor-managed-configurations

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-managed-configurations@502

@capawesome/capacitor-photo-editor

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-photo-editor@502

@capawesome/capacitor-posthog

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-posthog@502

@capawesome/capacitor-screen-orientation

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-screen-orientation@502

@capawesome/capacitor-screenshot

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-screenshot@502

@capawesome/capacitor-torch

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-torch@502

commit: 987be35

@robingenz robingenz merged commit eea01ec into main Apr 29, 2025
4 checks passed
@robingenz robingenz deleted the 3268723623 branch April 29, 2025 12:56
@github-actions github-actions Bot mentioned this pull request Apr 29, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: The plugin is trying to modify the UI (set background color) from a background thread, not the main (UI) thread

2 participants