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

Cleanup warnings in noapi PlatformActivity #2950

Merged
merged 1 commit into from
Mar 17, 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
36 changes: 14 additions & 22 deletions app/src/noapi/java/org/mozilla/vrbrowser/PlatformActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,51 +26,40 @@ public class PlatformActivity extends Activity {
static String LOGTAG = SystemUtils.createLogtag(PlatformActivity.class);
static final float ROTATION = 0.098174770424681f;

@SuppressWarnings("unused")
public static boolean filterPermission(final String aPermission) {
return false;
}

private GLSurfaceView mView;
private TextView mFrameRate;
private ArrayList<Runnable> mPendingEvents;
private final ArrayList<Runnable> mPendingEvents = new ArrayList<>();
private boolean mSurfaceCreated = false;
private int mFrameCount;
private long mLastFrameTime = System.currentTimeMillis();

private final Runnable activityDestroyedRunnable = new Runnable() {
@Override
public void run() {
synchronized (this) {
activityDestroyed();
notifyAll();
}
private final Runnable activityDestroyedRunnable = () -> {
synchronized (this) {
activityDestroyed();
notifyAll();
}
};

private final Runnable activityPausedRunnable = new Runnable() {
@Override
public void run() {
synchronized (this) {
activityPaused();
notifyAll();
}
private final Runnable activityPausedRunnable = () -> {
synchronized (this) {
activityPaused();
notifyAll();
}
};

private final Runnable activityResumedRunnable = new Runnable() {
@Override
public void run() {
activityResumed();
}
};
private final Runnable activityResumedRunnable = this::activityResumed;

@Override
protected void onCreate(Bundle savedInstanceState) {
Log.e(LOGTAG, "PlatformActivity onCreate");
super.onCreate(savedInstanceState);

setContentView(R.layout.noapi_layout);
mPendingEvents = new ArrayList<>();
mFrameRate = findViewById(R.id.frame_rate_text);
mView = findViewById(R.id.gl_view);
mView.setEGLContextClientVersion(3);
Expand Down Expand Up @@ -252,6 +241,7 @@ private void setupUI() {
}
return false;
});
setImmersiveSticky();
keianhzo marked this conversation as resolved.
Show resolved Hide resolved
}

private void updateUI(final int aMode) {
Expand All @@ -262,6 +252,7 @@ private void updateUI(final int aMode) {
Log.d(LOGTAG, "Got render mode of Immersive");
findViewById(R.id.click_button).setVisibility(View.VISIBLE);
}
setImmersiveSticky();
}

private void dispatchMoveAxis(final float aX, final float aY, final float aZ) {
Expand All @@ -281,6 +272,7 @@ private void buttonClicked(final boolean aPressed) {
}

@Keep
@SuppressWarnings("unused")
private void setRenderMode(final int aMode) {
runOnUiThread(() -> updateUI(aMode));
}
Expand Down