|
5 | 5 |
|
6 | 6 | import android.annotation.TargetApi;
|
7 | 7 | import android.os.IInterface;
|
8 |
| -import android.view.IDisplayFoldListener; |
9 | 8 | import android.view.IDisplayWindowListener;
|
10 |
| -import android.view.IRotationWatcher; |
11 | 9 |
|
12 | 10 | import java.lang.reflect.Method;
|
13 | 11 |
|
@@ -182,52 +180,6 @@ public void thawRotation(int displayId) {
|
182 | 180 | }
|
183 | 181 | }
|
184 | 182 |
|
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 |
| - |
231 | 183 | @TargetApi(AndroidVersions.API_30_ANDROID_11)
|
232 | 184 | public int[] registerDisplayWindowListener(IDisplayWindowListener listener) {
|
233 | 185 | try {
|
|
0 commit comments