2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-05 08:35:10 +00:00

Hack to make packet types match those of older versions

This commit is contained in:
Albert Vaca
2016-06-02 15:22:40 +02:00
parent 541cd97c71
commit 43467aedd8
2 changed files with 12 additions and 1 deletions

View File

@@ -535,6 +535,8 @@ public class Device implements BaseLink.PackageReceiver {
@Override
public void onPackageReceived(NetworkPackage np) {
hackToMakeRetrocompatiblePacketTypes(np);
if (NetworkPackage.PACKAGE_TYPE_PAIR.equals(np.getType())) {
Log.i("KDE/Device", "Pair package");
@@ -638,6 +640,8 @@ public class Device implements BaseLink.PackageReceiver {
//Async
public void sendPackage(final NetworkPackage np, final SendPackageStatusCallback callback) {
hackToMakeRetrocompatiblePacketTypes(np);
//Log.e("sendPackage", "Sending package...");
//Log.e("sendPackage", np.serialize());
@@ -904,4 +908,11 @@ public class Device implements BaseLink.PackageReceiver {
return false;
}
public void hackToMakeRetrocompatiblePacketTypes(NetworkPackage np) {
if (protocolVersion >= 6) return;
String type = np.getType();
type.replace(".request","");
np.mType = type;
}
}