|
|
@ -52,10 +52,17 @@ public final class WindowManager {
|
|
|
|
freezeDisplayRotationMethod = manager.getClass().getMethod("freezeRotation", int.class);
|
|
|
|
freezeDisplayRotationMethod = manager.getClass().getMethod("freezeRotation", int.class);
|
|
|
|
freezeDisplayRotationMethodVersion = 0;
|
|
|
|
freezeDisplayRotationMethodVersion = 0;
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
// New method added by this commit:
|
|
|
|
// New method added by this commit:
|
|
|
|
// <https://android.googlesource.com/platform/frameworks/base/+/90c9005e687aa0f63f1ac391adc1e8878ab31759%5E%21/>
|
|
|
|
// <https://android.googlesource.com/platform/frameworks/base/+/90c9005e687aa0f63f1ac391adc1e8878ab31759%5E%21/>
|
|
|
|
freezeDisplayRotationMethod = manager.getClass().getMethod("freezeDisplayRotation", int.class, int.class);
|
|
|
|
freezeDisplayRotationMethod = manager.getClass().getMethod("freezeDisplayRotation", int.class, int.class);
|
|
|
|
freezeDisplayRotationMethodVersion = 1;
|
|
|
|
freezeDisplayRotationMethodVersion = 1;
|
|
|
|
|
|
|
|
} catch (NoSuchMethodException e1) {
|
|
|
|
|
|
|
|
// Android 15 preview and 14 QPR3 Beta added a String caller parameter for debugging:
|
|
|
|
|
|
|
|
// <https://android.googlesource.com/platform/frameworks/base/+/670fb7f5c0d23cf51ead25538bcb017e03ed73ac%5E%21/>
|
|
|
|
|
|
|
|
freezeDisplayRotationMethod = manager.getClass().getMethod("freezeDisplayRotation", int.class, int.class, String.class);
|
|
|
|
|
|
|
|
freezeDisplayRotationMethodVersion = 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return freezeDisplayRotationMethod;
|
|
|
|
return freezeDisplayRotationMethod;
|
|
|
@ -82,10 +89,17 @@ public final class WindowManager {
|
|
|
|
thawDisplayRotationMethod = manager.getClass().getMethod("thawRotation");
|
|
|
|
thawDisplayRotationMethod = manager.getClass().getMethod("thawRotation");
|
|
|
|
thawDisplayRotationMethodVersion = 0;
|
|
|
|
thawDisplayRotationMethodVersion = 0;
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
// New method added by this commit:
|
|
|
|
// New method added by this commit:
|
|
|
|
// <https://android.googlesource.com/platform/frameworks/base/+/90c9005e687aa0f63f1ac391adc1e8878ab31759%5E%21/>
|
|
|
|
// <https://android.googlesource.com/platform/frameworks/base/+/90c9005e687aa0f63f1ac391adc1e8878ab31759%5E%21/>
|
|
|
|
thawDisplayRotationMethod = manager.getClass().getMethod("thawDisplayRotation", int.class);
|
|
|
|
thawDisplayRotationMethod = manager.getClass().getMethod("thawDisplayRotation", int.class);
|
|
|
|
thawDisplayRotationMethodVersion = 1;
|
|
|
|
thawDisplayRotationMethodVersion = 1;
|
|
|
|
|
|
|
|
} catch (NoSuchMethodException e1) {
|
|
|
|
|
|
|
|
// Android 15 preview and 14 QPR3 Beta added a String caller parameter for debugging:
|
|
|
|
|
|
|
|
// <https://android.googlesource.com/platform/frameworks/base/+/670fb7f5c0d23cf51ead25538bcb017e03ed73ac%5E%21/>
|
|
|
|
|
|
|
|
thawDisplayRotationMethod = manager.getClass().getMethod("thawDisplayRotation", int.class, String.class);
|
|
|
|
|
|
|
|
thawDisplayRotationMethodVersion = 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return thawDisplayRotationMethod;
|
|
|
|
return thawDisplayRotationMethod;
|
|
|
@ -112,9 +126,12 @@ public final class WindowManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
method.invoke(manager, rotation);
|
|
|
|
method.invoke(manager, rotation);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case 1:
|
|
|
|
method.invoke(manager, displayId, rotation);
|
|
|
|
method.invoke(manager, displayId, rotation);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
method.invoke(manager, displayId, rotation, "scrcpy#freezeRotation");
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (ReflectiveOperationException e) {
|
|
|
|
} catch (ReflectiveOperationException e) {
|
|
|
|
Ln.e("Could not invoke method", e);
|
|
|
|
Ln.e("Could not invoke method", e);
|
|
|
@ -151,9 +168,12 @@ public final class WindowManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
method.invoke(manager);
|
|
|
|
method.invoke(manager);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case 1:
|
|
|
|
method.invoke(manager, displayId);
|
|
|
|
method.invoke(manager, displayId);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
method.invoke(manager, displayId, "scrcpy#thawRotation");
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (ReflectiveOperationException e) {
|
|
|
|
} catch (ReflectiveOperationException e) {
|
|
|
|
Ln.e("Could not invoke method", e);
|
|
|
|
Ln.e("Could not invoke method", e);
|
|
|
|