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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user