package com.amazon.ads.ema.api.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Device data containing detailed device information
 */
public class DeviceData implements Parcelable {
    public static final Creator<DeviceData> CREATOR = new Creator<>() {
        @Override
        public DeviceData createFromParcel(Parcel in) {
            return new DeviceData(in);
        }

        @Override
        public DeviceData[] newArray(int size) {
            return new DeviceData[size];
        }
    };
    public String dsn;              // Device Serial Number
    public String emaVersion;       // EMA version
    public String versionName;      // OS version name
    public int versionCode;         // OS version code
    public String kioskApp;         // Current kiosk app package
    public String timezone;         // Device timezone
    public String monitorInfo;      // Monitor information
    public String edid;             // Raw EDID hex string
    public long elapsedMs;          // Uptime in milliseconds
    public String model;            // Device model identifier (e.g., "AFKLNK")

    public DeviceData() {
    }

    protected DeviceData(Parcel in) {
        dsn = in.readString();
        emaVersion = in.readString();
        versionName = in.readString();
        versionCode = in.readInt();
        kioskApp = in.readString();
        timezone = in.readString();
        monitorInfo = in.readString();
        edid = in.readString();
        elapsedMs = in.readLong();
        model = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(dsn);
        dest.writeString(emaVersion);
        dest.writeString(versionName);
        dest.writeInt(versionCode);
        dest.writeString(kioskApp);
        dest.writeString(timezone);
        dest.writeString(monitorInfo);
        dest.writeString(edid);
        dest.writeLong(elapsedMs);
        dest.writeString(model);
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
