mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-03 15:45:10 +00:00
Hack got hackier
This commit is contained in:
@@ -831,6 +831,7 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
newSupportedOutgoingInterfaces.addAll(outgoingInterfaces);
|
newSupportedOutgoingInterfaces.addAll(outgoingInterfaces);
|
||||||
|
|
||||||
for (String packageType : incomingInterfaces) {
|
for (String packageType : incomingInterfaces) {
|
||||||
|
packageType = hackToMakeRetrocompatiblePacketTypes(packageType);
|
||||||
ArrayList<String> plugins = newPluginsByIncomingInterface.get(packageType);
|
ArrayList<String> plugins = newPluginsByIncomingInterface.get(packageType);
|
||||||
if (plugins == null) plugins = new ArrayList<>();
|
if (plugins == null) plugins = new ArrayList<>();
|
||||||
plugins.add(pluginKey);
|
plugins.add(pluginKey);
|
||||||
@@ -838,6 +839,7 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (String packageType : outgoingInterfaces) {
|
for (String packageType : outgoingInterfaces) {
|
||||||
|
packageType = hackToMakeRetrocompatiblePacketTypes(packageType);
|
||||||
ArrayList<String> plugins = newPluginsByOutgoingInterface.get(packageType);
|
ArrayList<String> plugins = newPluginsByOutgoingInterface.get(packageType);
|
||||||
if (plugins == null) plugins = new ArrayList<>();
|
if (plugins == null) plugins = new ArrayList<>();
|
||||||
plugins.add(pluginKey);
|
plugins.add(pluginKey);
|
||||||
@@ -916,9 +918,12 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
|
|
||||||
public void hackToMakeRetrocompatiblePacketTypes(NetworkPackage np) {
|
public void hackToMakeRetrocompatiblePacketTypes(NetworkPackage np) {
|
||||||
if (protocolVersion >= 6) return;
|
if (protocolVersion >= 6) return;
|
||||||
String type = np.getType();
|
np.mType = np.getType().replace(".request","").replace(".input",".mousepad");
|
||||||
type.replace(".request","");
|
}
|
||||||
np.mType = type;
|
|
||||||
|
public String hackToMakeRetrocompatiblePacketTypes(String type) {
|
||||||
|
if (protocolVersion >= 6) return type;
|
||||||
|
return type.replace(".request","").replace(".input",".mousepad");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user