-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Turn screen off" doesn't work on my device #4544
Comments
Thank you for your report. Please post your
(Meizu developers definitely like to modify the Android ROM a lot, it's always this model which causes problems with many scrcpy features.) |
Here the files you asked for. Since GitHub doesn't support the jar file, please unzip the file manually. |
There is no such Could you please list them all:
|
Here is the list.
|
Maybe |
Please check this: |
Not in this one either. Send the whole folder |
It seems too large to upload to GitHub. Check this OneDrive sharelink: |
(it is not expected to be in the jar directly, you must decompile But indeed, none of them contains this In import meizu.os.IDeviceControlService;
// …
IDeviceControlService asInterface = IDeviceControlService.Stub.asInterface(ServiceManager.getService("device_control")); |
Got it. Please check if the |
这个问题解决了吗?是不是没法解决了 |
估计是吧😂flyme魔改的问题 不知道aicy识屏是不是依赖了这个 跟flyme反馈下试试呢 |
和flyme反馈也白扯吧,我也没想和作者说,这个问题好像作者那边也不好解决 |
Could you please copy-paste the text (so that it can be translated into English easily)? |
Translation: Please contact the software developer, or try other screen casting software instead. |
I got the same problem after I updated my Honor 60pro to Android 14 |
So it should be caused by the |
Yes, there were changes in Android 14. You need a recent version of scrcpy (the latest is 2.5). |
The problem still exists.
|
您好,解决了吗?我也是魅族21,升级了最新的系统。这一个功能也是不可用了,请问您解决了吗?方便分享一下解决方案吗? |
Sorry, I have no solution for this device. |
Please test scrcpy-server.zip (with client version 3.0.2) Diff: diff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayControl.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayControl.java
index a57f7948..7c6f9b6b 100644
--- a/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayControl.java
+++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/DisplayControl.java
@@ -6,6 +6,7 @@ import com.genymobile.scrcpy.util.Ln;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.os.IBinder;
+import android.system.Os;
import java.lang.reflect.Method;
@@ -21,7 +22,11 @@ public final class DisplayControl {
Class<?> classLoaderFactoryClass = Class.forName("com.android.internal.os.ClassLoaderFactory");
Method createClassLoaderMethod = classLoaderFactoryClass.getDeclaredMethod("createClassLoader", String.class, String.class, String.class,
ClassLoader.class, int.class, boolean.class, String.class);
- ClassLoader classLoader = (ClassLoader) createClassLoaderMethod.invoke(null, "/system/framework/services.jar", null, null,
+
+ String systemServerClasspath = Os.getenv("SYSTEMSERVERCLASSPATH");
+ Ln.i("Loading DisplayControl");
+ Ln.i("SYSTEMSERVERCLASSPATH: " + systemServerClasspath);
+ ClassLoader classLoader = (ClassLoader) createClassLoaderMethod.invoke(null, systemServerClasspath, null, null,
ClassLoader.getSystemClassLoader(), 0, true, null);
displayControlClass = classLoader.loadClass("com.android.server.display.DisplayControl"); |
As a workaround, scrcpy uses another method for Android 14: #4456. But this method fails for some Xiaomi devices. Please test the workaround from @yume-chan in the previous comment 🙂 |
It worked, I successfully turned off the screen after using @yume-chan's solution. |
@CudtMFrag Awesome. And can you confirm that it did not work in official 3.0.2? |
@CudtMFrag Also, in the solution from @yume-chan, some logs have been added. Could you please copy-paste the whole console output of scrcpy when you turn the screen off? |
@rom1v Yes, when I use the official 3.0.2 whenever I try to turn off the screen scrcpy will crash.
|
Thank you @yume-chan, I will merge a507b4f. |
Environment
Describe the bug
While I try to turn screen off using "scrcpy -S" or alt+o, the scrcpy will crash and abort.
The error information shows like this:
The text was updated successfully, but these errors were encountered: