Android: Fix a bunch of lints

This commit is contained in:
Henrik Rydgård 2024-10-10 10:06:46 +02:00
parent 7e9bc0df26
commit 14a78e51b0
6 changed files with 56 additions and 52 deletions

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">
<!-- We use version codes in the format xyyzzrrrr. Example: 110030000
In this same case, versionName should be 1.10.3.0
Also note that we are overriding these values automatically from a gradle plugin,
so we don't need to set them manually. -->
so we don't need to set them manually. -->
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
@ -39,7 +39,6 @@
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
@ -52,7 +51,6 @@
<activity
android:name=".PpssppActivity"
android:configChanges="locale|keyboard|keyboardHidden|navigation|uiMode"
android:label="@string/app_name"
android:theme="@style/ppsspp_style"
android:exported="true">
<!-- android:screenOrientation="landscape" -->
@ -64,41 +62,40 @@
<category android:name="tv.ouya.intent.category.GAME"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:host="*" />
<data android:pathPattern=".*\\.iso" />
<data android:pathPattern=".*\\..*\\.iso" />
<data android:pathPattern=".*\\..*\\..*\\.iso" />
<data android:pathPattern=".*\\.cso" />
<data android:pathPattern=".*\\..*\\.cso" />
<data android:pathPattern=".*\\..*\\..*\\.cso" />
<data android:pathPattern=".*\\.chd" />
<data android:pathPattern=".*\\..*\\.chd" />
<data android:pathPattern=".*\\..*\\..*\\.chd" />
<data android:pathPattern=".*\\.elf" />
<data android:pathPattern=".*\\..*\\.elf" />
<data android:pathPattern=".*\\..*\\..*\\.elf" />
<data android:pathPattern=".*\\.ISO" />
<data android:pathPattern=".*\\..*\\.ISO" />
<data android:pathPattern=".*\\..*\\..*\\.ISO" />
<data android:pathPattern=".*\\.CSO" />
<data android:pathPattern=".*\\..*\\.CSO" />
<data android:pathPattern=".*\\..*\\..*\\.CSO" />
<data android:pathPattern=".*\\.ELF" />
<data android:pathPattern=".*\\..*\\.ELF" />
<data android:pathPattern=".*\\..*\\..*\\.ELF" />
<data android:pathPattern=".*\\.CHD" />
<data android:pathPattern=".*\\..*\\.CHD" />
<data android:pathPattern=".*\\..*\\..*\\.CHD" />
<data android:pathPattern=".*\\.ppdmp" />
</intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:host="*" />
<data android:pathPattern=".*\\.iso" />
<data android:pathPattern=".*\\..*\\.iso" />
<data android:pathPattern=".*\\..*\\..*\\.iso" />
<data android:pathPattern=".*\\.cso" />
<data android:pathPattern=".*\\..*\\.cso" />
<data android:pathPattern=".*\\..*\\..*\\.cso" />
<data android:pathPattern=".*\\.chd" />
<data android:pathPattern=".*\\..*\\.chd" />
<data android:pathPattern=".*\\..*\\..*\\.chd" />
<data android:pathPattern=".*\\.elf" />
<data android:pathPattern=".*\\..*\\.elf" />
<data android:pathPattern=".*\\..*\\..*\\.elf" />
<data android:pathPattern=".*\\.ISO" />
<data android:pathPattern=".*\\..*\\.ISO" />
<data android:pathPattern=".*\\..*\\..*\\.ISO" />
<data android:pathPattern=".*\\.CSO" />
<data android:pathPattern=".*\\..*\\.CSO" />
<data android:pathPattern=".*\\..*\\..*\\.CSO" />
<data android:pathPattern=".*\\.ELF" />
<data android:pathPattern=".*\\..*\\.ELF" />
<data android:pathPattern=".*\\..*\\..*\\.ELF" />
<data android:pathPattern=".*\\.CHD" />
<data android:pathPattern=".*\\..*\\.CHD" />
<data android:pathPattern=".*\\..*\\..*\\.CHD" />
<data android:pathPattern=".*\\.ppdmp" />
<data android:pathPattern=".*\\.pbp" />
</intent-filter>
</activity>
<meta-data android:name="isGame" android:value="true" />
<activity
@ -115,6 +112,8 @@
<meta-data
android:name="xperiaplayoptimized_content"
android:resource="@drawable/ic_launcher" />
<profileable android:shell="true" android:enabled="true" />
</application>
</manifest>

View file

@ -212,6 +212,7 @@ android {
'normalDebug', // for debugging
'normalOptimized', // for testing/user build
'normalRelease', // for Google Play releases
'goldDebug',
'goldRelease', // for Google Play releases
'vrDebug', // for VR debugging
'vrOptimized', // for VR testing

View file

@ -975,7 +975,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) {
// JavaEGL. This doesn't get called on the Vulkan path.
// This gets called from onSurfaceCreated.
extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, jobject obj) {
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, jobject obj) {
_assert_(useCPUThread);
INFO_LOG(Log::G3D, "NativeApp.displayInit()");
@ -1294,7 +1294,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_joystickAxis(
}
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_mouseWheelEvent(
JNIEnv *env, jclass, jint stick, jfloat x, jfloat y) {
JNIEnv *env, jclass, jfloat x, jfloat y) {
if (!renderer_inited)
return false;
// TODO: Mousewheel should probably be an axis instead.
@ -1474,7 +1474,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JN
}
}
extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_computeDesiredBackbufferDimensions() {
extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_computeDesiredBackbufferDimensions(JNIEnv *, jclass) {
getDesiredBackbufferSize(desiredBackbufferSizeX, desiredBackbufferSizeY);
}
@ -1563,7 +1563,7 @@ static void VulkanEmuThread(ANativeWindow *wnd);
// This runs in Vulkan mode only.
// This handles the entire lifecycle of the Vulkan context, init and exit.
extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runVulkanRenderLoop(JNIEnv * env, jobject obj, jobject _surf) {
extern "C" jboolean JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runVulkanRenderLoop(JNIEnv * env, jobject obj, jobject _surf) {
_assert_(!useCPUThread);
if (!graphicsContext) {

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, PpssppActivity!</string>
<string name="app_name">PPSSPP</string>
<string name="shortcut_name">PPSSPP game</string>

View file

@ -504,7 +504,6 @@ public abstract class NativeActivity extends Activity {
}
}
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
private void updateScreenRotation(String cause) {
// Query the native application on the desired rotation.
int rot;
@ -954,7 +953,6 @@ public abstract class NativeActivity extends Activity {
}
}
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
private InputDeviceState getInputDeviceState(InputEvent event) {
InputDevice device = event.getDevice();
if (device == null) {
@ -1060,6 +1058,11 @@ public abstract class NativeActivity extends Activity {
}
}
@TargetApi(Build.VERSION_CODES.N)
void sendMouseDelta(float dx, float dy) {
NativeApp.mouseDelta(dx, dy);
}
@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
public boolean onGenericMotionEvent(MotionEvent event) {
@ -1078,9 +1081,11 @@ public abstract class NativeActivity extends Activity {
if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) {
if ((event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
float dx = event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
float dy = event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
NativeApp.mouseDelta(dx, dy);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
float dx = event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
float dy = event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
sendMouseDelta(dx, dy);
}
}
switch (event.getAction()) {
@ -1594,7 +1599,7 @@ public abstract class NativeActivity extends Activity {
if (mInfraredHelper == null) {
return false;
}
if (params.startsWith("sircs")) {
if (params.startsWith("sircs") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Pattern pattern = Pattern.compile("sircs_(\\d+)_(\\d+)_(\\d+)_(\\d+)");
Matcher matcher = pattern.matcher(params);
if (!matcher.matches())

View file

@ -61,7 +61,7 @@ public class NativeSurfaceView extends SurfaceView implements SensorEventListene
return ev.getToolType(pointer);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
@TargetApi(Build.VERSION_CODES.N)
private void processMouseDelta(final MotionEvent ev) {
if ((ev.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
float dx = ev.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
@ -95,7 +95,7 @@ public class NativeSurfaceView extends SurfaceView implements SensorEventListene
break;
case MotionEvent.ACTION_MOVE: {
code = 1;
if (Build.VERSION.SDK_INT >= 12) {
if (Build.VERSION.SDK_INT >= 24) {
processMouseDelta(ev);
}
break;