Skip to content

Commit

Permalink
[wpe] Suppress synthetic accessor warnings for now
Browse files Browse the repository at this point in the history
  • Loading branch information
zhani committed Sep 6, 2024
1 parent 48d60e2 commit 9c56aa4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class TestWPEViewClient implements WPEViewClient {
public class TestWPEViewClient extends WPEViewClient {

private final CallbackHelper onPageFinishedHelper;
private final OnEvaluateJavaScriptResultHelper onEvaluateJavascriptResultHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void tearDown() {
}

@Test
public void testOnReceiveHttpError404() {
public void testOnReceiveHttpError404() throws Throwable {
AtomicBoolean received404 = new AtomicBoolean(false);
CountDownLatch latch = new CountDownLatch(1);
ActivityScenario<WPEViewTestActivity> scenario = wpeViewActivityTestRule.getScenario();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class WPEViewImeTest {
public ActivityScenarioRule<WPEViewTestActivity> wpeViewActivityTestRule =
new ActivityScenarioRule<>(WPEViewTestActivity.class);
@Test
public void testIMEVisible() {
public void testIMEVisible() throws Throwable {
CountDownLatch latch = new CountDownLatch(1);
ActivityScenario<WPEViewTestActivity> scenario = wpeViewActivityTestRule.getScenario();
scenario
Expand Down
6 changes: 6 additions & 0 deletions wpe/src/main/java/org/wpewebkit/wpe/WKWebView.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,25 +238,29 @@ public void evaluateJavascript(@NonNull String script, @Nullable WKCallback<Stri

protected final class PageSurfaceHolderCallback implements SurfaceHolder.Callback2 {
@Override
@SuppressWarnings("SyntheticAccessor")
public void surfaceCreated(SurfaceHolder holder) {
Log.d(LOGTAG, "PageSurfaceHolderCallback::surfaceCreated()");
nativeSurfaceCreated(nativePtr, holder.getSurface());
}

@Override
@SuppressWarnings("SyntheticAccessor")
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.d(LOGTAG, "PageSurfaceHolderCallback::surfaceChanged() with format: " + format + " and size: " + width +
" x " + height);
nativeSurfaceChanged(nativePtr, format, width, height);
}

@Override
@SuppressWarnings("SyntheticAccessor")
public void surfaceRedrawNeeded(SurfaceHolder holder) {
Log.d(LOGTAG, "PageSurfaceHolderCallback::surfaceRedrawNeeded()");
nativeSurfaceRedrawNeeded(nativePtr);
}

@Override
@SuppressWarnings("SyntheticAccessor")
public void surfaceDestroyed(SurfaceHolder holder) {
Log.d(LOGTAG, "PageSurfaceHolderCallback::surfaceDestroyed()");
nativeSurfaceDestroyed(nativePtr);
Expand All @@ -267,6 +271,7 @@ protected final class PageScaleListener extends ScaleGestureDetector.SimpleOnSca
private float m_scaleFactor = 1.f;

@Override
@SuppressWarnings("SyntheticAccessor")
public boolean onScale(ScaleGestureDetector detector) {
Log.d(LOGTAG, "PageScaleListener::onScale()");

Expand All @@ -284,6 +289,7 @@ private final class PageSurfaceView extends SurfaceView {

@Override
@SuppressLint("ClickableViewAccessibility")
@SuppressWarnings("SyntheticAccessor")
public boolean onTouchEvent(MotionEvent event) {
int pointerCount = event.getPointerCount();
if (pointerCount < 1)
Expand Down

0 comments on commit 9c56aa4

Please sign in to comment.