mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-01 06:35:09 +00:00
Device type should be "desktop", no "computer"
This commit is contained in:
@@ -77,13 +77,13 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
|
|
||||||
public static DeviceType FromString(String s) {
|
public static DeviceType FromString(String s) {
|
||||||
if ("tablet".equals(s)) return Tablet;
|
if ("tablet".equals(s)) return Tablet;
|
||||||
if ("computer".equals(s)) return Computer;
|
if ("desktop".equals(s)) return Computer;
|
||||||
return Phone; //Default
|
return Phone; //Default
|
||||||
}
|
}
|
||||||
public String toString() {
|
public String toString() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case Tablet: return "tablet";
|
case Tablet: return "tablet";
|
||||||
case Computer: return "computer";
|
case Computer: return "desktop";
|
||||||
default: return "phone";
|
default: return "phone";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
this.name = settings.getString("deviceName", context.getString(R.string.unknown_device));
|
this.name = settings.getString("deviceName", context.getString(R.string.unknown_device));
|
||||||
this.pairStatus = PairStatus.Paired;
|
this.pairStatus = PairStatus.Paired;
|
||||||
this.protocolVersion = NetworkPackage.ProtocolVersion; //We don't know it yet
|
this.protocolVersion = NetworkPackage.ProtocolVersion; //We don't know it yet
|
||||||
this.deviceType = DeviceType.FromString(settings.getString("deviceType", "computer"));
|
this.deviceType = DeviceType.FromString(settings.getString("deviceType", "desktop"));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
byte[] publicKeyBytes = Base64.decode(settings.getString("publicKey", ""), 0);
|
byte[] publicKeyBytes = Base64.decode(settings.getString("publicKey", ""), 0);
|
||||||
@@ -139,10 +139,10 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
|
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.deviceId = np.getString("deviceId");
|
this.deviceId = np.getString("deviceId");
|
||||||
this.name = np.getString("deviceName", context.getString(R.string.unknown_device));
|
this.name = context.getString(R.string.unknown_device); //We read it in addLink
|
||||||
this.pairStatus = PairStatus.NotPaired;
|
this.pairStatus = PairStatus.NotPaired;
|
||||||
this.protocolVersion = np.getInt("protocolVersion");
|
this.protocolVersion = 0;
|
||||||
this.deviceType = DeviceType.FromString(np.getString("deviceType", "computer"));
|
this.deviceType = DeviceType.Computer;
|
||||||
this.publicKey = null;
|
this.publicKey = null;
|
||||||
|
|
||||||
settings = context.getSharedPreferences(deviceId, Context.MODE_PRIVATE);
|
settings = context.getSharedPreferences(deviceId, Context.MODE_PRIVATE);
|
||||||
@@ -381,7 +381,7 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (identityPackage.has("deviceType")) {
|
if (identityPackage.has("deviceType")) {
|
||||||
this.deviceType = DeviceType.FromString(identityPackage.getString("deviceType", "computer"));
|
this.deviceType = DeviceType.FromString(identityPackage.getString("deviceType", "desktop"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user