Skip to content

Commit

Permalink
Fix loading from intents in noapi (#3009)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin committed Mar 20, 2020
1 parent a6ae172 commit 39a7799
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/src/noapi/java/org/mozilla/vrbrowser/PlatformActivity.java
Expand Up @@ -38,17 +38,19 @@ public static boolean filterPermission(final String aPermission) {
private int mFrameCount;
private long mLastFrameTime = System.currentTimeMillis();

final Object mRenderLock = new Object();

private final Runnable activityDestroyedRunnable = () -> {
synchronized (this) {
synchronized (mRenderLock) {
activityDestroyed();
notifyAll();
mRenderLock.notifyAll();
}
};

private final Runnable activityPausedRunnable = () -> {
synchronized (this) {
synchronized (mRenderLock) {
activityPaused();
notifyAll();
mRenderLock.notifyAll();
}
};

Expand Down Expand Up @@ -145,10 +147,10 @@ public boolean onGenericMotionEvent(MotionEvent aEvent) {
@Override
protected void onPause() {
Log.d(LOGTAG, "PlatformActivity onPause");
synchronized (activityPausedRunnable) {
synchronized (mRenderLock) {
queueRunnable(activityPausedRunnable);
try {
activityPausedRunnable.wait();
mRenderLock.wait();
} catch(InterruptedException e) {
Log.e(LOGTAG, "activityPausedRunnable interrupted: " + e.toString());
}
Expand Down

0 comments on commit 39a7799

Please sign in to comment.