Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
[CP-beta][Android] post image task to main handler. (#52166)
Browse files Browse the repository at this point in the history
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

Test failures in Impeller migration PR: flutter/packages#6461

### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/wiki/Hotfix-Documentation-Best-Practices) for examples

Ensure that Android platform view updates are posted on correct thread when platform view is created on background handler.

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

Migration to Impeller plugin APIs is blocked.

### Workaround:
Is there a workaround for this issue?

Disable impeller

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

  However the tests are in flutter/packages and not flutter/engine.

### Validation Steps:
What are the steps to validate that this fix works?

Run the unit tests on the linked PR in flutter/packages
  • Loading branch information
flutteractionsbot authored Apr 18, 2024
1 parent 41d578d commit 1deeac8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.media.ImageReader;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.view.Surface;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -479,7 +480,8 @@ private class PerImageReader {

public PerImageReader(ImageReader reader) {
this.reader = reader;
reader.setOnImageAvailableListener(onImageAvailableListener, new Handler());
reader.setOnImageAvailableListener(
onImageAvailableListener, new Handler(Looper.getMainLooper()));
}

PerImage queueImage(Image image) {
Expand Down

0 comments on commit 1deeac8

Please sign in to comment.