mirror of
https://github.com/samsonjs/media.git
synced 2026-04-17 13:15:47 +00:00
Add MediaUtilsTest
PiperOrigin-RevId: 344384426
This commit is contained in:
parent
4602e3a927
commit
43713abe79
1 changed files with 4 additions and 0 deletions
|
|
@ -508,6 +508,10 @@ public final class Util {
|
|||
* run. {@code false} otherwise.
|
||||
*/
|
||||
public static boolean postOrRun(Handler handler, Runnable runnable) {
|
||||
Looper looper = handler.getLooper();
|
||||
if (!looper.getThread().isAlive()) {
|
||||
return false;
|
||||
}
|
||||
if (handler.getLooper() == Looper.myLooper()) {
|
||||
runnable.run();
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue