Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Fix loading from intents in noapi #3009

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions app/src/noapi/java/org/mozilla/vrbrowser/PlatformActivity.java
Original file line number Diff line number Diff line change
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