mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove unreachable code
Since the compile sdk is 19, the if check is always true since it's checking 19 >= 17. This also removes the need for the success boolean which would always be true.
This commit is contained in:
parent
44f62a97c2
commit
512d77e011
|
@ -28,8 +28,6 @@ import java.io.File;
|
|||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -65,34 +63,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
display.getMetrics(metrics);
|
||||
|
||||
boolean success = false;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
display.getRealSize(pixelSize);
|
||||
display.getRealMetrics(metrics);
|
||||
|
||||
success = true;
|
||||
} else {
|
||||
try {
|
||||
Method getRawHeight = Display.class.getMethod("getRawHeight");
|
||||
Method getRawWidth = Display.class.getMethod("getRawWidth");
|
||||
pixelSize.x = (Integer) getRawWidth.invoke(display);
|
||||
pixelSize.y = (Integer) getRawHeight.invoke(display);
|
||||
|
||||
success = true;
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
// Fall back to viewport size
|
||||
display.getSize(pixelSize);
|
||||
}
|
||||
display.getRealSize(pixelSize);
|
||||
display.getRealMetrics(metrics);
|
||||
|
||||
int rotation = display.getRotation();
|
||||
if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) {
|
||||
|
|
Loading…
Reference in New Issue