log "getDisplayIds" methods parameters

pull/3998/head
Sergey Volkov 2 years ago
parent ac7ffeb91c
commit 428c4eef5d

@ -7,7 +7,7 @@ android {
minSdkVersion 21
targetSdkVersion 30
versionCode 11900
versionName "1.19-ws3"
versionName "1.19-ws4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {

@ -4,6 +4,7 @@ import com.genymobile.scrcpy.DisplayInfo;
import com.genymobile.scrcpy.Ln;
import com.genymobile.scrcpy.Size;
import android.os.Build;
import android.os.IInterface;
import android.view.Display;
@ -36,13 +37,28 @@ public final class DisplayManager {
}
public int[] getDisplayIds() {
Method method;
String methodName = "getDisplayIds";
try {
return (int[]) manager.getClass().getMethod("getDisplayIds").invoke(manager);
method = manager.getClass().getMethod(methodName);
return (int[]) method.invoke(manager);
} catch (NoSuchMethodException e) {
Ln.d("Failed to get display ids");
Ln.d("Available methods:");
for (Method m: manager.getClass().getMethods()) {
Ln.d(m.getName());
Ln.d(m.getName() + " parameters:");
if (m.getName().equals(methodName)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (m.getParameterCount() > 0) {
for (Class c : m.getParameterTypes()) {
Ln.d(c.getName());
}
} else {
Ln.d("No parameters");
}
}
}
Ln.d("Return type: " + m.getReturnType().getName());
}
Ln.d("///");
return new int[]{Display.DEFAULT_DISPLAY};

Loading…
Cancel
Save