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
shortcut for expand notifications panel doesn't work #2551
Comments
They probably customized the method in their private ROM. Could you add a log to find the existing methods if you know how to? |
i provided the output from console. |
Any update please? |
Take this file, replace it in the v1.19:
Then run diffdiff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java
index 5b1e5f5e..52b1a90e 100644
--- a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java
+++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java
@@ -20,6 +20,8 @@ public class StatusBarManager {
}
private Method getExpandNotificationsPanelMethod() throws NoSuchMethodException {
+ for (Method method : manager.getClass().getMethods())
+ System.err.println("=== " + method);
if (expandNotificationsPanelMethod == null) {
expandNotificationsPanelMethod = manager.getClass().getMethod("expandNotificationsPanel");
} |
|
As expected, they modified the method in the custom ROM (they added an Let's try to just pass 0:
diffdiff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java
index 5b1e5f5e..0ddd8311 100644
--- a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java
+++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java
@@ -11,6 +11,7 @@ public class StatusBarManager {
private final IInterface manager;
private Method expandNotificationsPanelMethod;
+ private boolean expandNotificationPanelMethodCustomVersion;
private Method expandSettingsPanelMethod;
private boolean expandSettingsPanelMethodNewVersion = true;
private Method collapsePanelsMethod;
@@ -21,7 +22,13 @@ public class StatusBarManager {
private Method getExpandNotificationsPanelMethod() throws NoSuchMethodException {
if (expandNotificationsPanelMethod == null) {
- expandNotificationsPanelMethod = manager.getClass().getMethod("expandNotificationsPanel");
+ try {
+ expandNotificationsPanelMethod = manager.getClass().getMethod("expandNotificationsPanel");
+ } catch (NoSuchMethodException e) {
+ // https://github.com/Genymobile/scrcpy/issues/2551
+ expandNotificationsPanelMethod = manager.getClass().getMethod("expandNotificationsPanel", int.class);
+ expandNotificationPanelMethodCustomVersion = true;
+ }
}
return expandNotificationsPanelMethod;
}
@@ -50,7 +57,11 @@ public class StatusBarManager {
public void expandNotificationsPanel() {
try {
Method method = getExpandNotificationsPanelMethod();
- method.invoke(manager);
+ if (expandNotificationPanelMethodCustomVersion) {
+ method.invoke(manager, 0);
+ } else {
+ method.invoke(manager);
+ }
} catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
Ln.e("Could not invoke method", e);
} |
great! it works. |
👍
I just merged in into |
thx a lot. appreciate it. |
unfortunately doesn't work on oneplus 3, Android 8.0, Windows ADB, scrcpy 1.18
The text was updated successfully, but these errors were encountered: