mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-11 10:40:35 +00:00
issue6224
This commit is contained in:
parent
cd22133384
commit
6ef634977d
1 changed files with 9 additions and 2 deletions
|
@ -91,6 +91,11 @@ public final class FakeContext extends ContextWrapper {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Context createPackageContext(String packageName, int flags) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ContentResolver getContentResolver() {
|
public ContentResolver getContentResolver() {
|
||||||
return contentResolver;
|
return contentResolver;
|
||||||
|
@ -104,9 +109,11 @@ public final class FakeContext extends ContextWrapper {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Context.CLIPBOARD_SERVICE.equals(name)) {
|
// "semclipboard" is a Samsung-internal service
|
||||||
|
// See <https://github.com/Genymobile/scrcpy/issues/6224>
|
||||||
|
if (Context.CLIPBOARD_SERVICE.equals(name) || "semclipboard".equals(name)) {
|
||||||
try {
|
try {
|
||||||
Field field = ClipboardManager.class.getDeclaredField("mContext");
|
Field field = service.getClass().getDeclaredField("mContext");
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
field.set(service, this);
|
field.set(service, this);
|
||||||
} catch (ReflectiveOperationException e) {
|
} catch (ReflectiveOperationException e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue