FileDocCategorySizeDatePackage
BuildData.javaAPI DocAndroid 1.5 API2772Wed May 06 22:41:56 BST 2009android.server.data

BuildData

public class BuildData extends Object
Build data transfer object. Keep in sync. with the server side version.

Fields Summary
private static final int
VERSION
The version of the data returned by write() and understood by the constructor.
private final String
fingerprint
private final String
incrementalVersion
private final long
time
Constructors Summary
public BuildData()

    // in *seconds* since the epoch (not msec!)

      
        this.fingerprint = "android:" + Build.FINGERPRINT;
        this.incrementalVersion = Build.VERSION.INCREMENTAL;
        this.time = Build.TIME / 1000;  // msec -> sec
    
public BuildData(String fingerprint, String incrementalVersion, long time)

        this.fingerprint = nonNull(fingerprint);
        this.incrementalVersion = incrementalVersion;
        this.time = time;
    
BuildData(DataInput in)

        int dataVersion = in.readInt();
        if (dataVersion != VERSION) {
            throw new IOException("Expected " + VERSION + ". Got: " + dataVersion);
        }

        this.fingerprint = in.readUTF();
        this.incrementalVersion = Long.toString(in.readLong());
        this.time = in.readLong();
    
Methods Summary
public java.lang.StringgetFingerprint()

        return fingerprint;
    
public java.lang.StringgetIncrementalVersion()

        return incrementalVersion;
    
public longgetTime()

        return time;
    
voidwrite(java.io.DataOutput out)

        out.writeInt(VERSION);
        out.writeUTF(fingerprint);

        // TODO: change the format/version to expect a string for this field.
        // Version 0, still used by the server side, expects a long.
        long changelist;
        try {
            changelist = Long.parseLong(incrementalVersion);
        } catch (NumberFormatException ex) {
            changelist = -1;
        }
        out.writeLong(changelist);
        out.writeLong(time);