Skip to content

Commit

Permalink
Cleanup warnings in noapi PlatformActivity (#2950)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin committed Mar 17, 2020
1 parent 685f2cf commit 538470b
Showing 1 changed file with 14 additions and 22 deletions.
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();
}

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

0 comments on commit 538470b

Please sign in to comment.