From ff989390f9ff65af243dbc35c0b759c485e9b9d1 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Fri, 28 Aug 2015 13:49:36 +0200 Subject: [PATCH] Fix the remaining TODO #101 --- .../nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java index 91a566b9..561a45fa 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java @@ -41,8 +41,6 @@ public class GBDevice implements Parcelable { private State mState = State.NOT_CONNECTED; private short mBatteryLevel = BATTERY_UNKNOWN; private short mBatteryThresholdPercent = BATTERY_THRESHOLD_PERCENT; - //TODO: get rid of String mBatteryStatus in favor of Enum mBatteryState - private String mBatteryStatus; private BatteryState mBatteryState; private short mRssi = RSSI_UNKNOWN; private String mBusyTask; @@ -62,7 +60,7 @@ public class GBDevice implements Parcelable { mHardwareVersion = in.readString(); mState = State.values()[in.readInt()]; mBatteryLevel = (short) in.readInt(); - mBatteryStatus = in.readString(); + mBatteryState = (BatteryState) in.readSerializable(); mRssi = (short) in.readInt(); mBusyTask = in.readString(); @@ -78,7 +76,7 @@ public class GBDevice implements Parcelable { dest.writeString(mHardwareVersion); dest.writeInt(mState.ordinal()); dest.writeInt(mBatteryLevel); - dest.writeString(mBatteryStatus); + dest.writeSerializable(mBatteryState); dest.writeInt(mRssi); dest.writeString(mBusyTask); }