package org.commcare.suite.model;

import org.javarosa.core.util.externalizable.DeserializationException;
import org.javarosa.core.util.externalizable.ExtUtil;
import org.javarosa.core.util.externalizable.Externalizable;
import org.javarosa.core.util.externalizable.PrototypeFactory;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public class AndroidPackageDependency implements Externalizable {
    private String id;
    private String name;

    // Set later during dependency check
    private boolean installed = false;

    /**
     * Serialization Only!!!
     */
    public AndroidPackageDependency() {
    }

    public AndroidPackageDependency(String id, String name) {
        this.id = id;
        this.name = name;
    }

    @Override
    public void readExternal(DataInputStream in, PrototypeFactory pf)
            throws IOException, DeserializationException {
        id = ExtUtil.readString(in);
        name = ExtUtil.readString(in);
    }

    @Override
    public void writeExternal(DataOutputStream out) throws IOException {
        ExtUtil.writeString(out, id);
        ExtUtil.writeString(out, name);
    }

    public String getId() {
        return id;
    }


    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "AndroidPackageDependency{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                '}';
    }

    public boolean isInstalled() {
        return installed;
    }

    public void setInstalled(boolean installed) {
        this.installed = installed;
    }
}

@@ -491,89 +491,8 @@
 e;%0A%0A
-    // Set later during dependency check%0A    private boolean installed = false;%0A%0A
     
@@ -1407,168 +1407,7 @@
    %7D
-%0A%0A    public boolean isInstalled() %7B%0A        return installed;%0A    %7D%0A%0A    public void setInstalled(boolean installed) %7B%0A        this.installed = installed;%0A    %7D
 %0A%7D%0A

remove installed status as it's no longer needed