mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-21 03:55:05 +00:00
expandSettingsPanel() changed API with android 9
Now it gets a parameter. However, it can be null https://code.yawk.at/android/android-9.0.0_r35/android/app/StatusBarManager.java#android.app.StatusBarManager%23expandSettingsPanel(java.lang.String) For now, I don't have android 10's but it's probably a version without the noargument method
This commit is contained in:
parent
499f595088
commit
cd533a9ab2
1 changed files with 15 additions and 2 deletions
|
@ -12,6 +12,7 @@ public class StatusBarManager {
|
|||
private final IInterface manager;
|
||||
private Method expandNotificationsPanelMethod;
|
||||
private Method expandSettingsPanelMethod;
|
||||
private Object[] expandSettingsPanelArgs;
|
||||
private Method collapsePanelsMethod;
|
||||
|
||||
public StatusBarManager(IInterface manager) {
|
||||
|
@ -27,7 +28,19 @@ public class StatusBarManager {
|
|||
|
||||
private Method getExpandSettingsPanel() throws NoSuchMethodException {
|
||||
if (expandSettingsPanelMethod == null) {
|
||||
expandSettingsPanelMethod = manager.getClass().getMethod("expandSettingsPanel");
|
||||
try{
|
||||
expandSettingsPanelMethod = manager.getClass().getMethod("expandSettingsPanel");
|
||||
expandSettingsPanelArgs = new Object[] {};
|
||||
} catch (NoSuchMethodException e){
|
||||
try{
|
||||
expandSettingsPanelMethod = manager.getClass().getMethod("expandSettingsPanel", String.class);
|
||||
expandSettingsPanelArgs = new Object[] {null};
|
||||
} catch (NoSuchMethodException f){
|
||||
f.initCause(e);
|
||||
throw f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return expandSettingsPanelMethod;
|
||||
}
|
||||
|
@ -50,7 +63,7 @@ public class StatusBarManager {
|
|||
public void expandSettingsPanel() {
|
||||
try {
|
||||
Method method = getExpandSettingsPanel();
|
||||
method.invoke(manager);
|
||||
method.invoke(manager, expandSettingsPanelArgs);
|
||||
} catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
|
||||
Ln.e("Could not invoke method", e);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue