Skip to content

Commit eac711a

Browse files
committed
Remove unused rotation and fold listeners
IRotationWatcher and IDisplayFoldListener are no longer used since commit 39d51ff.
1 parent af15c72 commit eac711a

File tree

4 files changed

+0
-101
lines changed

4 files changed

+0
-101
lines changed

server/build_without_gradle.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ EOF
4747

4848
echo "Generating java from aidl..."
4949
cd "$SERVER_DIR/src/main/aidl"
50-
"$BUILD_TOOLS_DIR/aidl" -o"$GEN_DIR" -I. android/view/IRotationWatcher.aidl
5150
"$BUILD_TOOLS_DIR/aidl" -o"$GEN_DIR" -I. \
5251
android/content/IOnPrimaryClipChangedListener.aidl
53-
"$BUILD_TOOLS_DIR/aidl" -o"$GEN_DIR" -I. android/view/IDisplayFoldListener.aidl
5452
"$BUILD_TOOLS_DIR/aidl" -o"$GEN_DIR" -I. -p "$ANDROID_AIDL" \
5553
android/view/IDisplayWindowListener.aidl
5654

server/src/main/aidl/android/view/IDisplayFoldListener.aidl

Lines changed: 0 additions & 26 deletions
This file was deleted.

server/src/main/aidl/android/view/IRotationWatcher.aidl

Lines changed: 0 additions & 25 deletions
This file was deleted.

server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
import android.annotation.TargetApi;
77
import android.os.IInterface;
8-
import android.view.IDisplayFoldListener;
98
import android.view.IDisplayWindowListener;
10-
import android.view.IRotationWatcher;
119

1210
import java.lang.reflect.Method;
1311

@@ -182,52 +180,6 @@ public void thawRotation(int displayId) {
182180
}
183181
}
184182

185-
public void registerRotationWatcher(IRotationWatcher rotationWatcher, int displayId) {
186-
try {
187-
Class<?> cls = manager.getClass();
188-
try {
189-
// display parameter added since this commit:
190-
// https://android.googlesource.com/platform/frameworks/base/+/35fa3c26adcb5f6577849fd0df5228b1f67cf2c6%5E%21/#F1
191-
cls.getMethod("watchRotation", IRotationWatcher.class, int.class).invoke(manager, rotationWatcher, displayId);
192-
} catch (NoSuchMethodException e) {
193-
// old version
194-
if (displayId != 0) {
195-
Ln.e("Secondary display rotation not supported on this device");
196-
return;
197-
}
198-
cls.getMethod("watchRotation", IRotationWatcher.class).invoke(manager, rotationWatcher);
199-
}
200-
} catch (Exception e) {
201-
Ln.e("Could not register rotation watcher", e);
202-
}
203-
}
204-
205-
public void unregisterRotationWatcher(IRotationWatcher rotationWatcher) {
206-
try {
207-
manager.getClass().getMethod("removeRotationWatcher", IRotationWatcher.class).invoke(manager, rotationWatcher);
208-
} catch (Exception e) {
209-
Ln.e("Could not unregister rotation watcher", e);
210-
}
211-
}
212-
213-
@TargetApi(AndroidVersions.API_29_ANDROID_10)
214-
public void registerDisplayFoldListener(IDisplayFoldListener foldListener) {
215-
try {
216-
manager.getClass().getMethod("registerDisplayFoldListener", IDisplayFoldListener.class).invoke(manager, foldListener);
217-
} catch (Exception e) {
218-
Ln.e("Could not register display fold listener", e);
219-
}
220-
}
221-
222-
@TargetApi(AndroidVersions.API_29_ANDROID_10)
223-
public void unregisterDisplayFoldListener(IDisplayFoldListener foldListener) {
224-
try {
225-
manager.getClass().getMethod("unregisterDisplayFoldListener", IDisplayFoldListener.class).invoke(manager, foldListener);
226-
} catch (Exception e) {
227-
Ln.e("Could not unregister display fold listener", e);
228-
}
229-
}
230-
231183
@TargetApi(AndroidVersions.API_30_ANDROID_11)
232184
public int[] registerDisplayWindowListener(IDisplayWindowListener listener) {
233185
try {

0 commit comments

Comments
 (0)