2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 22:25:08 +00:00

Reintroduced hack as we broke compatibility with devices using version 0.9

And bumped version to release
This commit is contained in:
Albert Vaca
2016-07-14 07:13:50 +02:00
parent fd2102b432
commit edc3075763
2 changed files with 13 additions and 2 deletions

View File

@@ -518,6 +518,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");
@@ -612,6 +614,9 @@ public class Device implements BaseLink.PackageReceiver {
//Async
public void sendPackage(final NetworkPackage np, final SendPackageStatusCallback callback) {
hackToMakeRetrocompatiblePacketTypes(np);
/*
if (!m_outgoingCapabilities.contains(np.getType()) && !NetworkPackage.protocolPackageTypes.contains(np.getType())) {
Log.e("Device/sendPackage", "Plugin tried to send an undeclared package: " + np.getType());
@@ -831,4 +836,10 @@ public class Device implements BaseLink.PackageReceiver {
return m_supportedPlugins;
}
public void hackToMakeRetrocompatiblePacketTypes(NetworkPackage np) {
if (protocolVersion >= 6) return;
np.mType = np.getType().replace(".request","");
}
}