From f11b0ec2043ba912e91efce8bb30ecc547dc0aef Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 27 Mar 2019 21:47:54 +0100 Subject: [PATCH] Fix server checkstyle errors Fix errors reported by: gradle -p server check --- .../src/main/java/com/genymobile/scrcpy/EventController.java | 1 - server/src/main/java/com/genymobile/scrcpy/IO.java | 2 +- .../src/main/java/com/genymobile/scrcpy/ScreenEncoder.java | 1 - server/src/main/java/com/genymobile/scrcpy/Server.java | 5 +++-- .../com/genymobile/scrcpy/wrappers/StatusBarManager.java | 2 -- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/EventController.java b/server/src/main/java/com/genymobile/scrcpy/EventController.java index 5fa2cab2..341869fa 100644 --- a/server/src/main/java/com/genymobile/scrcpy/EventController.java +++ b/server/src/main/java/com/genymobile/scrcpy/EventController.java @@ -1,7 +1,6 @@ package com.genymobile.scrcpy; import com.genymobile.scrcpy.wrappers.InputManager; -import com.genymobile.scrcpy.wrappers.ServiceManager; import android.graphics.Point; import android.os.SystemClock; diff --git a/server/src/main/java/com/genymobile/scrcpy/IO.java b/server/src/main/java/com/genymobile/scrcpy/IO.java index f1f05105..57c017db 100644 --- a/server/src/main/java/com/genymobile/scrcpy/IO.java +++ b/server/src/main/java/com/genymobile/scrcpy/IO.java @@ -8,7 +8,7 @@ import java.io.FileDescriptor; import java.io.IOException; import java.nio.ByteBuffer; -public class IO { +public final class IO { private IO() { // not instantiable } diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java index 22eb6a54..c946e990 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java @@ -3,7 +3,6 @@ package com.genymobile.scrcpy; import com.genymobile.scrcpy.wrappers.SurfaceControl; import android.graphics.Rect; -import android.media.MediaMuxer; import android.media.MediaCodec; import android.media.MediaCodecInfo; import android.media.MediaFormat; diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java index fb2ba461..b782101c 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Server.java +++ b/server/src/main/java/com/genymobile/scrcpy/Server.java @@ -4,7 +4,6 @@ import android.graphics.Rect; import java.io.File; import java.io.IOException; -import java.util.Arrays; public final class Server { @@ -49,8 +48,9 @@ public final class Server { @SuppressWarnings("checkstyle:MagicNumber") private static Options createOptions(String... args) { - if (args.length != 5) + if (args.length != 5) { throw new IllegalArgumentException("Expecting 5 parameters"); + } Options options = new Options(); @@ -73,6 +73,7 @@ public final class Server { return options; } + @SuppressWarnings("checkstyle:MagicNumber") private static Rect parseCrop(String crop) { if ("-".equals(crop)) { return null; diff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java index aacd5f1a..8f79f51f 100644 --- a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java +++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java @@ -1,8 +1,6 @@ package com.genymobile.scrcpy.wrappers; -import android.annotation.SuppressLint; import android.os.IInterface; -import android.view.InputEvent; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method;