Skip to content

Commit 3049d56

Browse files
committed
Remove Parcelable from BaseReansportRecord
1 parent bb06b8d commit 3049d56

1 file changed

Lines changed: 1 addition & 47 deletions

File tree

base/src/main/java/com/smartdevicelink/transport/utl/BaseTransportRecord.java

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@
3232

3333
package com.smartdevicelink.transport.utl;
3434

35-
import android.os.Parcel;
36-
import android.os.Parcelable;
37-
3835
import com.smartdevicelink.transport.enums.TransportType;
3936

40-
public class BaseTransportRecord implements Parcelable{
37+
public class BaseTransportRecord{
4138

4239
private TransportType type;
4340
private String address;
@@ -80,47 +77,4 @@ public String toString(){
8077
builder.append(address);
8178
return builder.toString();
8279
}
83-
84-
public BaseTransportRecord(Parcel p){
85-
if (p.readInt() == 1) { //We should have a transport type attached
86-
String transportName = p.readString();
87-
if(transportName != null){
88-
this.type = TransportType.valueOf(transportName);
89-
}
90-
}
91-
92-
if (p.readInt() == 1) { //We should have a transport address attached
93-
address = p.readString();
94-
}
95-
}
96-
97-
@Override
98-
public int describeContents() {
99-
return 0;
100-
}
101-
102-
@Override
103-
public void writeToParcel(Parcel dest, int flags) {
104-
dest.writeInt(type!=null? 1 : 0);
105-
if(type != null){
106-
dest.writeString(type.name());
107-
}
108-
109-
dest.writeInt(address !=null? 1 : 0);
110-
if(address != null){
111-
dest.writeString(address);
112-
}
113-
}
114-
115-
public static final Parcelable.Creator<BaseTransportRecord> CREATOR = new Parcelable.Creator<BaseTransportRecord>() {
116-
public BaseTransportRecord createFromParcel(Parcel in) {
117-
return new BaseTransportRecord(in);
118-
}
119-
120-
@Override
121-
public BaseTransportRecord[] newArray(int size) {
122-
return new BaseTransportRecord[size];
123-
}
124-
125-
};
12680
}

0 commit comments

Comments
 (0)