41abe021e2
If the client provided a sequence number on SET_CLIPBOARD request, make the device send back an acknowledgement once the clipboard is set. PR #2814 <https://github.com/Genymobile/scrcpy/pull/2814>
43 lines
972 B
Java
43 lines
972 B
Java
package com.genymobile.scrcpy;
|
|
|
|
public final class DeviceMessage {
|
|
|
|
public static final int TYPE_CLIPBOARD = 0;
|
|
public static final int TYPE_ACK_CLIPBOARD = 1;
|
|
|
|
public static final long SEQUENCE_INVALID = ControlMessage.SEQUENCE_INVALID;
|
|
|
|
private int type;
|
|
private String text;
|
|
private long sequence;
|
|
|
|
private DeviceMessage() {
|
|
}
|
|
|
|
public static DeviceMessage createClipboard(String text) {
|
|
DeviceMessage event = new DeviceMessage();
|
|
event.type = TYPE_CLIPBOARD;
|
|
event.text = text;
|
|
return event;
|
|
}
|
|
|
|
public static DeviceMessage createAckClipboard(long sequence) {
|
|
DeviceMessage event = new DeviceMessage();
|
|
event.type = TYPE_ACK_CLIPBOARD;
|
|
event.sequence = sequence;
|
|
return event;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public String getText() {
|
|
return text;
|
|
}
|
|
|
|
public long getSequence() {
|
|
return sequence;
|
|
}
|
|
}
|