Skip to content

Commit

Permalink
Add clipboard workaround for IQOO device
Browse files Browse the repository at this point in the history
Fixes #4492 <#4492>
  • Loading branch information
rom1v committed Dec 3, 2023
1 parent 3001f8a commit e9f1478
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ private Method getGetPrimaryClipMethod() throws NoSuchMethodException {
getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, String.class, int.class, int.class);
getMethodVersion = 2;
} catch (NoSuchMethodException e3) {
getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, int.class, String.class);
getMethodVersion = 3;
try {
getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, int.class, String.class);
getMethodVersion = 3;
} catch (NoSuchMethodException e4) {
getPrimaryClipMethod = manager.getClass().getMethod("getPrimaryClip", String.class, String.class, int.class, int.class, boolean.class);
getMethodVersion = 4;
}
}
}
}
Expand Down Expand Up @@ -87,8 +92,10 @@ private static ClipData getPrimaryClip(Method method, int methodVersion, IInterf
return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, null, FakeContext.ROOT_UID);
case 2:
return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, null, FakeContext.ROOT_UID, 0);
default:
case 3:
return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, FakeContext.ROOT_UID, null);
default:
return (ClipData) method.invoke(manager, FakeContext.PACKAGE_NAME, null, FakeContext.ROOT_UID, 0, false);
}
}

Expand Down

0 comments on commit e9f1478

Please sign in to comment.