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

Commit 538470b

Browse files
authored
Cleanup warnings in noapi PlatformActivity (#2950)
1 parent 685f2cf commit 538470b

1 file changed

Lines changed: 14 additions & 22 deletions

File tree

app/src/noapi/java/org/mozilla/vrbrowser/PlatformActivity.java

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,51 +26,40 @@ public class PlatformActivity extends Activity {
2626
static String LOGTAG = SystemUtils.createLogtag(PlatformActivity.class);
2727
static final float ROTATION = 0.098174770424681f;
2828

29+
@SuppressWarnings("unused")
2930
public static boolean filterPermission(final String aPermission) {
3031
return false;
3132
}
3233

3334
private GLSurfaceView mView;
3435
private TextView mFrameRate;
35-
private ArrayList<Runnable> mPendingEvents;
36+
private final ArrayList<Runnable> mPendingEvents = new ArrayList<>();
3637
private boolean mSurfaceCreated = false;
3738
private int mFrameCount;
3839
private long mLastFrameTime = System.currentTimeMillis();
3940

40-
private final Runnable activityDestroyedRunnable = new Runnable() {
41-
@Override
42-
public void run() {
43-
synchronized (this) {
44-
activityDestroyed();
45-
notifyAll();
46-
}
41+
private final Runnable activityDestroyedRunnable = () -> {
42+
synchronized (this) {
43+
activityDestroyed();
44+
notifyAll();
4745
}
4846
};
4947

50-
private final Runnable activityPausedRunnable = new Runnable() {
51-
@Override
52-
public void run() {
53-
synchronized (this) {
54-
activityPaused();
55-
notifyAll();
56-
}
48+
private final Runnable activityPausedRunnable = () -> {
49+
synchronized (this) {
50+
activityPaused();
51+
notifyAll();
5752
}
5853
};
5954

60-
private final Runnable activityResumedRunnable = new Runnable() {
61-
@Override
62-
public void run() {
63-
activityResumed();
64-
}
65-
};
55+
private final Runnable activityResumedRunnable = this::activityResumed;
6656

6757
@Override
6858
protected void onCreate(Bundle savedInstanceState) {
6959
Log.e(LOGTAG, "PlatformActivity onCreate");
7060
super.onCreate(savedInstanceState);
7161

7262
setContentView(R.layout.noapi_layout);
73-
mPendingEvents = new ArrayList<>();
7463
mFrameRate = findViewById(R.id.frame_rate_text);
7564
mView = findViewById(R.id.gl_view);
7665
mView.setEGLContextClientVersion(3);
@@ -252,6 +241,7 @@ private void setupUI() {
252241
}
253242
return false;
254243
});
244+
setImmersiveSticky();
255245
}
256246

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

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

283274
@Keep
275+
@SuppressWarnings("unused")
284276
private void setRenderMode(final int aMode) {
285277
runOnUiThread(() -> updateUI(aMode));
286278
}

0 commit comments

Comments
 (0)