Commit 43713abe by sungsoo Committed by Andrew Lewis

Add MediaUtilsTest

PiperOrigin-RevId: 344384426
parent 4602e3a9
...@@ -508,6 +508,10 @@ public final class Util { ...@@ -508,6 +508,10 @@ public final class Util {
* run. {@code false} otherwise. * run. {@code false} otherwise.
*/ */
public static boolean postOrRun(Handler handler, Runnable runnable) { public static boolean postOrRun(Handler handler, Runnable runnable) {
Looper looper = handler.getLooper();
if (!looper.getThread().isAlive()) {
return false;
}
if (handler.getLooper() == Looper.myLooper()) { if (handler.getLooper() == Looper.myLooper()) {
runnable.run(); runnable.run();
return true; return true;
......
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