Commit 410e614c by tonihei Committed by Oliver Woodman

Run custom messages executed on playback thread immediately.

This ensures message order if multiple custom messages running on the
playback thread and direct player commands are called immedately after
each other.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179925852
parent f2bb2d27
...@@ -904,6 +904,9 @@ import java.util.Collections; ...@@ -904,6 +904,9 @@ import java.util.Collections;
} }
} }
}; };
if (customMessageInfo.message.getHandler().getLooper() == handler.getLooper()) {
handleMessageRunnable.run();
} else {
handler.post( handler.post(
new Runnable() { new Runnable() {
@Override @Override
...@@ -912,6 +915,7 @@ import java.util.Collections; ...@@ -912,6 +915,7 @@ import java.util.Collections;
} }
}); });
} }
}
private void resolveCustomMessagePositions() { private void resolveCustomMessagePositions() {
for (int i = customMessageInfos.size() - 1; i >= 0; i--) { for (int i = customMessageInfos.size() - 1; i >= 0; i--) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment