Avoid CalledFromWrongThreadException in BubbleController

Problem: {
            1.CalledFromWrongThreadException can happen if OneHandedTransitionCallback is called from another thread
}

Solution: {
    1. Update the views in UI thread to avoid CalledFromWrongThreadException
}

Bug: 288588813
Change-Id: I23f535f89be9a14491d19dd16ec844d946dc486a
This commit is contained in:
sai.gairuboina-IN009276
2023-06-24 22:32:51 +05:30
parent 037244751d
commit 59eaf312d5

View File

@@ -277,16 +277,20 @@ public class BubbleController implements ConfigurationChangeListener {
new OneHandedTransitionCallback() {
@Override
public void onStartFinished(Rect bounds) {
if (mStackView != null) {
mStackView.onVerticalOffsetChanged(bounds.top);
}
mMainExecutor.execute(() -> {
if (mStackView != null) {
mStackView.onVerticalOffsetChanged(bounds.top);
}
});
}
@Override
public void onStopFinished(Rect bounds) {
if (mStackView != null) {
mStackView.onVerticalOffsetChanged(bounds.top);
}
mMainExecutor.execute(() -> {
if (mStackView != null) {
mStackView.onVerticalOffsetChanged(bounds.top);
}
});
}
});
}