mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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.
|
* 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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue