mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-10-04 07:08:43 +00:00
Ignore unknown methods in IDisplayWindowListener
New Android versions may add methods to IDisplayWindowListener.aidl.
When these methods are called by the system, they result in an
AbstractMethodError because they are not implemented on the scrcpy side.
To avoid releasing a new version for each newly added method, ignore
them at the Binder level.
Refs afaca80b37
Fixes #6362 <https://github.com/Genymobile/scrcpy/issues/6362>
This commit is contained in:
parent
9d56d26d45
commit
e11399aff0
2 changed files with 14 additions and 54 deletions
|
@ -48,27 +48,4 @@ oneway interface IDisplayWindowListener {
|
||||||
* Called when a display is removed from the hierarchy.
|
* Called when a display is removed from the hierarchy.
|
||||||
*/
|
*/
|
||||||
void onDisplayRemoved(int displayId);
|
void onDisplayRemoved(int displayId);
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when fixed rotation is started on a display.
|
|
||||||
*/
|
|
||||||
void onFixedRotationStarted(int displayId, int newRotation);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the previous fixed rotation on a display is finished.
|
|
||||||
*/
|
|
||||||
void onFixedRotationFinished(int displayId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the keep clear ares on a display have changed.
|
|
||||||
*/
|
|
||||||
void onKeepClearAreasChanged(int displayId, in List<Rect> restricted, in List<Rect> unrestricted);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the eligibility of the desktop mode for a display have changed.
|
|
||||||
*/
|
|
||||||
void onDesktopModeEligibleChanged(int displayId);
|
|
||||||
|
|
||||||
void onDisplayAddSystemDecorations(int displayId);
|
|
||||||
void onDisplayRemoveSystemDecorations(int displayId);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package com.genymobile.scrcpy.wrappers;
|
package com.genymobile.scrcpy.wrappers;
|
||||||
|
|
||||||
import android.content.res.Configuration;
|
import com.genymobile.scrcpy.util.Ln;
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.view.IDisplayWindowListener;
|
|
||||||
|
|
||||||
import java.util.List;
|
import android.content.res.Configuration;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
import android.view.IDisplayWindowListener;
|
||||||
|
|
||||||
public class DisplayWindowListener extends IDisplayWindowListener.Stub {
|
public class DisplayWindowListener extends IDisplayWindowListener.Stub {
|
||||||
@Override
|
@Override
|
||||||
|
@ -23,32 +24,14 @@ public class DisplayWindowListener extends IDisplayWindowListener.Stub {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFixedRotationStarted(int displayId, int newRotation) {
|
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
|
||||||
// empty default implementation
|
try {
|
||||||
}
|
return super.onTransact(code, data, reply, flags);
|
||||||
|
} catch (AbstractMethodError e) {
|
||||||
@Override
|
Ln.v("Ignoring AbstractMethodError: " + e.getMessage());
|
||||||
public void onFixedRotationFinished(int displayId) {
|
// Ignore unknown methods, write default response to reply parcel
|
||||||
// empty default implementation
|
reply.writeNoException();
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public void onKeepClearAreasChanged(int displayId, List<Rect> restricted, List<Rect> unrestricted) {
|
|
||||||
// empty default implementation
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDesktopModeEligibleChanged(int displayId) {
|
|
||||||
// empty default implementation
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisplayAddSystemDecorations(int displayId) {
|
|
||||||
// empty default implementation
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisplayRemoveSystemDecorations(int displayId) {
|
|
||||||
// empty default implementation
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue