mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-11-28 14:13:00 +00:00
1680 lines
51 KiB
Java
1680 lines
51 KiB
Java
// Code generated by Wire protocol buffer compiler, do not edit.
|
|
// Source file: protos-repo/checkin.proto
|
|
package org.microg.gms.checkin;
|
|
|
|
import com.squareup.wire.Message;
|
|
import com.squareup.wire.ProtoField;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
import static com.squareup.wire.Message.Datatype.BOOL;
|
|
import static com.squareup.wire.Message.Datatype.FIXED64;
|
|
import static com.squareup.wire.Message.Datatype.FLOAT;
|
|
import static com.squareup.wire.Message.Datatype.INT32;
|
|
import static com.squareup.wire.Message.Datatype.INT64;
|
|
import static com.squareup.wire.Message.Datatype.STRING;
|
|
import static com.squareup.wire.Message.Label.REPEATED;
|
|
import static com.squareup.wire.Message.Label.REQUIRED;
|
|
|
|
/**
|
|
* Sample data, if provided, is fished from a Nexus 7 (2013) / flo running Android 5.0
|
|
*/
|
|
public final class CheckinRequest extends Message {
|
|
|
|
public static final String DEFAULT_IMEI = "";
|
|
public static final Long DEFAULT_ANDROIDID = 0L;
|
|
public static final String DEFAULT_DIGEST = "";
|
|
public static final String DEFAULT_DESIREDBUILD = "";
|
|
public static final String DEFAULT_LOCALE = "";
|
|
public static final Long DEFAULT_LOGGINGID = 0L;
|
|
public static final String DEFAULT_MARKETCHECKIN = "";
|
|
public static final List<String> DEFAULT_MACADDRESS = Collections.emptyList();
|
|
public static final String DEFAULT_MEID = "";
|
|
public static final List<String> DEFAULT_ACCOUNTCOOKIE = Collections.emptyList();
|
|
public static final String DEFAULT_TIMEZONE = "";
|
|
public static final Long DEFAULT_SECURITYTOKEN = 0L;
|
|
public static final Integer DEFAULT_VERSION = 0;
|
|
public static final List<String> DEFAULT_OTACERT = Collections.emptyList();
|
|
public static final String DEFAULT_SERIAL = "";
|
|
public static final String DEFAULT_ESN = "";
|
|
public static final List<String> DEFAULT_MACADDRESSTYPE = Collections.emptyList();
|
|
public static final Integer DEFAULT_FRAGMENT = 0;
|
|
public static final String DEFAULT_USERNAME = "";
|
|
public static final Integer DEFAULT_USERSERIALNUMBER = 0;
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
@ProtoField(tag = 1, type = STRING)
|
|
public final String imei;
|
|
|
|
/**
|
|
* Gservices["android_id"] or 0 on first-checkin
|
|
*/
|
|
@ProtoField(tag = 2, type = INT64)
|
|
public final Long androidId;
|
|
|
|
/**
|
|
* Gservices["digest"] or ""
|
|
*/
|
|
@ProtoField(tag = 3, type = STRING)
|
|
public final String digest;
|
|
|
|
@ProtoField(tag = 4, label = REQUIRED)
|
|
public final Checkin checkin;
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
@ProtoField(tag = 5, type = STRING)
|
|
public final String desiredBuild;
|
|
|
|
/**
|
|
* Locale.toString
|
|
*/
|
|
@ProtoField(tag = 6, type = STRING)
|
|
public final String locale;
|
|
|
|
/**
|
|
* GoogleSettingsContract.Partner["logging_id2"] (choosen randomly on first checkin)
|
|
* eg. 12561488293572742346
|
|
*/
|
|
@ProtoField(tag = 7, type = INT64)
|
|
public final Long loggingId;
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
@ProtoField(tag = 8, type = STRING)
|
|
public final String marketCheckin;
|
|
|
|
/**
|
|
* NetworkInfo.getExtraInfo, WifiInfo.getMacAddress (12 hex-digits)
|
|
* eg. d850e6abcdef
|
|
*/
|
|
@ProtoField(tag = 9, type = STRING, label = REPEATED)
|
|
public final List<String> macAddress;
|
|
|
|
/**
|
|
* TelephonyManager.getDeviceId (14 hex-digits), not set on tablets
|
|
*/
|
|
@ProtoField(tag = 10, type = STRING)
|
|
public final String meid;
|
|
|
|
/**
|
|
* "[<email>]" followed by "<authToken>", empty string on first checkin
|
|
*/
|
|
@ProtoField(tag = 11, type = STRING, label = REPEATED)
|
|
public final List<String> accountCookie;
|
|
|
|
/**
|
|
* TimeZone.getId
|
|
* eg. GMT
|
|
*/
|
|
@ProtoField(tag = 12, type = STRING)
|
|
public final String timeZone;
|
|
|
|
/**
|
|
* security token as given on first checkin, not set on first checkin
|
|
*/
|
|
@ProtoField(tag = 13, type = FIXED64)
|
|
public final Long securityToken;
|
|
|
|
/**
|
|
* use 3
|
|
*/
|
|
@ProtoField(tag = 14, type = INT32)
|
|
public final Integer version;
|
|
|
|
/**
|
|
* SHA-1 of each in /system/etc/security/otacerts.zip or "--IOException--" or "--no-output--"
|
|
* eg. dKXTm1QH9QShGQwBM/4rg6/lCNQ=
|
|
*/
|
|
@ProtoField(tag = 15, type = STRING, label = REPEATED)
|
|
public final List<String> otaCert;
|
|
|
|
/**
|
|
* Build.SERIAL != "unknown"
|
|
* eg. 07d90b18
|
|
*/
|
|
@ProtoField(tag = 16, type = STRING)
|
|
public final String serial;
|
|
|
|
/**
|
|
* TelephonyManager.getDeviceId (8 hex-digits), not set on tablets
|
|
*/
|
|
@ProtoField(tag = 17, type = STRING)
|
|
public final String esn;
|
|
|
|
@ProtoField(tag = 18)
|
|
public final DeviceConfig deviceConfiguration;
|
|
|
|
/**
|
|
* "ethernet" or "wifi"
|
|
*/
|
|
@ProtoField(tag = 19, type = STRING, label = REPEATED)
|
|
public final List<String> macAddressType;
|
|
|
|
/**
|
|
* unknown, use 0 on pre- and first-checkin, and 1 for later checkins
|
|
* also present on pre-checkin
|
|
*/
|
|
@ProtoField(tag = 20, type = INT32, label = REQUIRED)
|
|
public final Integer fragment;
|
|
|
|
/**
|
|
* unknown
|
|
*/
|
|
@ProtoField(tag = 21, type = STRING)
|
|
public final String userName;
|
|
|
|
/**
|
|
* UserManager.getUserSerialNumber
|
|
* eg. 0
|
|
*/
|
|
@ProtoField(tag = 22, type = INT32)
|
|
public final Integer userSerialNumber;
|
|
|
|
public CheckinRequest(String imei, Long androidId, String digest, Checkin checkin, String desiredBuild, String locale, Long loggingId, String marketCheckin, List<String> macAddress, String meid, List<String> accountCookie, String timeZone, Long securityToken, Integer version, List<String> otaCert, String serial, String esn, DeviceConfig deviceConfiguration, List<String> macAddressType, Integer fragment, String userName, Integer userSerialNumber) {
|
|
this.imei = imei;
|
|
this.androidId = androidId;
|
|
this.digest = digest;
|
|
this.checkin = checkin;
|
|
this.desiredBuild = desiredBuild;
|
|
this.locale = locale;
|
|
this.loggingId = loggingId;
|
|
this.marketCheckin = marketCheckin;
|
|
this.macAddress = immutableCopyOf(macAddress);
|
|
this.meid = meid;
|
|
this.accountCookie = immutableCopyOf(accountCookie);
|
|
this.timeZone = timeZone;
|
|
this.securityToken = securityToken;
|
|
this.version = version;
|
|
this.otaCert = immutableCopyOf(otaCert);
|
|
this.serial = serial;
|
|
this.esn = esn;
|
|
this.deviceConfiguration = deviceConfiguration;
|
|
this.macAddressType = immutableCopyOf(macAddressType);
|
|
this.fragment = fragment;
|
|
this.userName = userName;
|
|
this.userSerialNumber = userSerialNumber;
|
|
}
|
|
|
|
private CheckinRequest(Builder builder) {
|
|
this(builder.imei, builder.androidId, builder.digest, builder.checkin, builder.desiredBuild, builder.locale, builder.loggingId, builder.marketCheckin, builder.macAddress, builder.meid, builder.accountCookie, builder.timeZone, builder.securityToken, builder.version, builder.otaCert, builder.serial, builder.esn, builder.deviceConfiguration, builder.macAddressType, builder.fragment, builder.userName, builder.userSerialNumber);
|
|
setBuilder(builder);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object other) {
|
|
if (other == this) return true;
|
|
if (!(other instanceof CheckinRequest)) return false;
|
|
CheckinRequest o = (CheckinRequest) other;
|
|
return equals(imei, o.imei)
|
|
&& equals(androidId, o.androidId)
|
|
&& equals(digest, o.digest)
|
|
&& equals(checkin, o.checkin)
|
|
&& equals(desiredBuild, o.desiredBuild)
|
|
&& equals(locale, o.locale)
|
|
&& equals(loggingId, o.loggingId)
|
|
&& equals(marketCheckin, o.marketCheckin)
|
|
&& equals(macAddress, o.macAddress)
|
|
&& equals(meid, o.meid)
|
|
&& equals(accountCookie, o.accountCookie)
|
|
&& equals(timeZone, o.timeZone)
|
|
&& equals(securityToken, o.securityToken)
|
|
&& equals(version, o.version)
|
|
&& equals(otaCert, o.otaCert)
|
|
&& equals(serial, o.serial)
|
|
&& equals(esn, o.esn)
|
|
&& equals(deviceConfiguration, o.deviceConfiguration)
|
|
&& equals(macAddressType, o.macAddressType)
|
|
&& equals(fragment, o.fragment)
|
|
&& equals(userName, o.userName)
|
|
&& equals(userSerialNumber, o.userSerialNumber);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int result = hashCode;
|
|
if (result == 0) {
|
|
result = imei != null ? imei.hashCode() : 0;
|
|
result = result * 37 + (androidId != null ? androidId.hashCode() : 0);
|
|
result = result * 37 + (digest != null ? digest.hashCode() : 0);
|
|
result = result * 37 + (checkin != null ? checkin.hashCode() : 0);
|
|
result = result * 37 + (desiredBuild != null ? desiredBuild.hashCode() : 0);
|
|
result = result * 37 + (locale != null ? locale.hashCode() : 0);
|
|
result = result * 37 + (loggingId != null ? loggingId.hashCode() : 0);
|
|
result = result * 37 + (marketCheckin != null ? marketCheckin.hashCode() : 0);
|
|
result = result * 37 + (macAddress != null ? macAddress.hashCode() : 1);
|
|
result = result * 37 + (meid != null ? meid.hashCode() : 0);
|
|
result = result * 37 + (accountCookie != null ? accountCookie.hashCode() : 1);
|
|
result = result * 37 + (timeZone != null ? timeZone.hashCode() : 0);
|
|
result = result * 37 + (securityToken != null ? securityToken.hashCode() : 0);
|
|
result = result * 37 + (version != null ? version.hashCode() : 0);
|
|
result = result * 37 + (otaCert != null ? otaCert.hashCode() : 1);
|
|
result = result * 37 + (serial != null ? serial.hashCode() : 0);
|
|
result = result * 37 + (esn != null ? esn.hashCode() : 0);
|
|
result = result * 37 + (deviceConfiguration != null ? deviceConfiguration.hashCode() : 0);
|
|
result = result * 37 + (macAddressType != null ? macAddressType.hashCode() : 1);
|
|
result = result * 37 + (fragment != null ? fragment.hashCode() : 0);
|
|
result = result * 37 + (userName != null ? userName.hashCode() : 0);
|
|
result = result * 37 + (userSerialNumber != null ? userSerialNumber.hashCode() : 0);
|
|
hashCode = result;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static final class Builder extends Message.Builder<CheckinRequest> {
|
|
|
|
public String imei;
|
|
public Long androidId;
|
|
public String digest;
|
|
public Checkin checkin;
|
|
public String desiredBuild;
|
|
public String locale;
|
|
public Long loggingId;
|
|
public String marketCheckin;
|
|
public List<String> macAddress;
|
|
public String meid;
|
|
public List<String> accountCookie;
|
|
public String timeZone;
|
|
public Long securityToken;
|
|
public Integer version;
|
|
public List<String> otaCert;
|
|
public String serial;
|
|
public String esn;
|
|
public DeviceConfig deviceConfiguration;
|
|
public List<String> macAddressType;
|
|
public Integer fragment;
|
|
public String userName;
|
|
public Integer userSerialNumber;
|
|
|
|
public Builder() {
|
|
}
|
|
|
|
public Builder(CheckinRequest message) {
|
|
super(message);
|
|
if (message == null) return;
|
|
this.imei = message.imei;
|
|
this.androidId = message.androidId;
|
|
this.digest = message.digest;
|
|
this.checkin = message.checkin;
|
|
this.desiredBuild = message.desiredBuild;
|
|
this.locale = message.locale;
|
|
this.loggingId = message.loggingId;
|
|
this.marketCheckin = message.marketCheckin;
|
|
this.macAddress = copyOf(message.macAddress);
|
|
this.meid = message.meid;
|
|
this.accountCookie = copyOf(message.accountCookie);
|
|
this.timeZone = message.timeZone;
|
|
this.securityToken = message.securityToken;
|
|
this.version = message.version;
|
|
this.otaCert = copyOf(message.otaCert);
|
|
this.serial = message.serial;
|
|
this.esn = message.esn;
|
|
this.deviceConfiguration = message.deviceConfiguration;
|
|
this.macAddressType = copyOf(message.macAddressType);
|
|
this.fragment = message.fragment;
|
|
this.userName = message.userName;
|
|
this.userSerialNumber = message.userSerialNumber;
|
|
}
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
public Builder imei(String imei) {
|
|
this.imei = imei;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Gservices["android_id"] or 0 on first-checkin
|
|
*/
|
|
public Builder androidId(Long androidId) {
|
|
this.androidId = androidId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Gservices["digest"] or ""
|
|
*/
|
|
public Builder digest(String digest) {
|
|
this.digest = digest;
|
|
return this;
|
|
}
|
|
|
|
public Builder checkin(Checkin checkin) {
|
|
this.checkin = checkin;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
public Builder desiredBuild(String desiredBuild) {
|
|
this.desiredBuild = desiredBuild;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Locale.toString
|
|
*/
|
|
public Builder locale(String locale) {
|
|
this.locale = locale;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* GoogleSettingsContract.Partner["logging_id2"] (choosen randomly on first checkin)
|
|
* eg. 12561488293572742346
|
|
*/
|
|
public Builder loggingId(Long loggingId) {
|
|
this.loggingId = loggingId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
public Builder marketCheckin(String marketCheckin) {
|
|
this.marketCheckin = marketCheckin;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* NetworkInfo.getExtraInfo, WifiInfo.getMacAddress (12 hex-digits)
|
|
* eg. d850e6abcdef
|
|
*/
|
|
public Builder macAddress(List<String> macAddress) {
|
|
this.macAddress = checkForNulls(macAddress);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* TelephonyManager.getDeviceId (14 hex-digits), not set on tablets
|
|
*/
|
|
public Builder meid(String meid) {
|
|
this.meid = meid;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* "[<email>]" followed by "<authToken>", empty string on first checkin
|
|
*/
|
|
public Builder accountCookie(List<String> accountCookie) {
|
|
this.accountCookie = checkForNulls(accountCookie);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* TimeZone.getId
|
|
* eg. GMT
|
|
*/
|
|
public Builder timeZone(String timeZone) {
|
|
this.timeZone = timeZone;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* security token as given on first checkin, not set on first checkin
|
|
*/
|
|
public Builder securityToken(Long securityToken) {
|
|
this.securityToken = securityToken;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* use 3
|
|
*/
|
|
public Builder version(Integer version) {
|
|
this.version = version;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* SHA-1 of each in /system/etc/security/otacerts.zip or "--IOException--" or "--no-output--"
|
|
* eg. dKXTm1QH9QShGQwBM/4rg6/lCNQ=
|
|
*/
|
|
public Builder otaCert(List<String> otaCert) {
|
|
this.otaCert = checkForNulls(otaCert);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.SERIAL != "unknown"
|
|
* eg. 07d90b18
|
|
*/
|
|
public Builder serial(String serial) {
|
|
this.serial = serial;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* TelephonyManager.getDeviceId (8 hex-digits), not set on tablets
|
|
*/
|
|
public Builder esn(String esn) {
|
|
this.esn = esn;
|
|
return this;
|
|
}
|
|
|
|
public Builder deviceConfiguration(DeviceConfig deviceConfiguration) {
|
|
this.deviceConfiguration = deviceConfiguration;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* "ethernet" or "wifi"
|
|
*/
|
|
public Builder macAddressType(List<String> macAddressType) {
|
|
this.macAddressType = checkForNulls(macAddressType);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unknown, use 0 on pre- and first-checkin, and 1 for later checkins
|
|
* also present on pre-checkin
|
|
*/
|
|
public Builder fragment(Integer fragment) {
|
|
this.fragment = fragment;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unknown
|
|
*/
|
|
public Builder userName(String userName) {
|
|
this.userName = userName;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* UserManager.getUserSerialNumber
|
|
* eg. 0
|
|
*/
|
|
public Builder userSerialNumber(Integer userSerialNumber) {
|
|
this.userSerialNumber = userSerialNumber;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public CheckinRequest build() {
|
|
checkRequiredFields();
|
|
return new CheckinRequest(this);
|
|
}
|
|
}
|
|
|
|
public static final class Checkin extends Message {
|
|
|
|
public static final Long DEFAULT_LASTCHECKINMS = 0L;
|
|
public static final List<Checkin.Event> DEFAULT_EVENT = Collections.emptyList();
|
|
public static final List<Checkin.Statistic> DEFAULT_STAT = Collections.emptyList();
|
|
public static final List<String> DEFAULT_REQUESTEDGROUP = Collections.emptyList();
|
|
public static final String DEFAULT_CELLOPERATOR = "";
|
|
public static final String DEFAULT_SIMOPERATOR = "";
|
|
public static final String DEFAULT_ROAMING = "";
|
|
public static final Integer DEFAULT_USERNUMBER = 0;
|
|
|
|
/**
|
|
* empty Build on pre-checkin
|
|
*/
|
|
@ProtoField(tag = 1, label = REQUIRED)
|
|
public final Checkin.Build build;
|
|
|
|
/**
|
|
* last checkin ms or 0 if first checkin
|
|
* eg. 0
|
|
*/
|
|
@ProtoField(tag = 2, type = INT64)
|
|
public final Long lastCheckinMs;
|
|
|
|
/**
|
|
* eg. ("event_log_start",~,1424612602652) on first checkin
|
|
*/
|
|
@ProtoField(tag = 3, label = REPEATED, messageType = Checkin.Event.class)
|
|
public final List<Checkin.Event> event;
|
|
|
|
/**
|
|
* unknown, n/a on first checkin
|
|
*/
|
|
@ProtoField(tag = 4, label = REPEATED, messageType = Checkin.Statistic.class)
|
|
public final List<Checkin.Statistic> stat;
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
@ProtoField(tag = 5, type = STRING, label = REPEATED)
|
|
public final List<String> requestedGroup;
|
|
|
|
/**
|
|
* TelephonyManager.getNetworkOperator != null|empty
|
|
*/
|
|
@ProtoField(tag = 6, type = STRING)
|
|
public final String cellOperator;
|
|
|
|
/**
|
|
* TelephonyManager.getSimOperator != null|empty
|
|
*/
|
|
@ProtoField(tag = 7, type = STRING)
|
|
public final String simOperator;
|
|
|
|
/**
|
|
* "WIFI::" | ("mobile" | "notmobile" | "unknown") + "-" + ("roaming" | "notroaming" | "unknown")
|
|
*/
|
|
@ProtoField(tag = 8, type = STRING)
|
|
public final String roaming;
|
|
|
|
/**
|
|
* UserHandle.myUserId
|
|
* eg. 0
|
|
*/
|
|
@ProtoField(tag = 9, type = INT32)
|
|
public final Integer userNumber;
|
|
|
|
public Checkin(Checkin.Build build, Long lastCheckinMs, List<Checkin.Event> event, List<Checkin.Statistic> stat, List<String> requestedGroup, String cellOperator, String simOperator, String roaming, Integer userNumber) {
|
|
this.build = build;
|
|
this.lastCheckinMs = lastCheckinMs;
|
|
this.event = immutableCopyOf(event);
|
|
this.stat = immutableCopyOf(stat);
|
|
this.requestedGroup = immutableCopyOf(requestedGroup);
|
|
this.cellOperator = cellOperator;
|
|
this.simOperator = simOperator;
|
|
this.roaming = roaming;
|
|
this.userNumber = userNumber;
|
|
}
|
|
|
|
private Checkin(Builder builder) {
|
|
this(builder.build, builder.lastCheckinMs, builder.event, builder.stat, builder.requestedGroup, builder.cellOperator, builder.simOperator, builder.roaming, builder.userNumber);
|
|
setBuilder(builder);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object other) {
|
|
if (other == this) return true;
|
|
if (!(other instanceof Checkin)) return false;
|
|
Checkin o = (Checkin) other;
|
|
return equals(build, o.build)
|
|
&& equals(lastCheckinMs, o.lastCheckinMs)
|
|
&& equals(event, o.event)
|
|
&& equals(stat, o.stat)
|
|
&& equals(requestedGroup, o.requestedGroup)
|
|
&& equals(cellOperator, o.cellOperator)
|
|
&& equals(simOperator, o.simOperator)
|
|
&& equals(roaming, o.roaming)
|
|
&& equals(userNumber, o.userNumber);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int result = hashCode;
|
|
if (result == 0) {
|
|
result = build != null ? build.hashCode() : 0;
|
|
result = result * 37 + (lastCheckinMs != null ? lastCheckinMs.hashCode() : 0);
|
|
result = result * 37 + (event != null ? event.hashCode() : 1);
|
|
result = result * 37 + (stat != null ? stat.hashCode() : 1);
|
|
result = result * 37 + (requestedGroup != null ? requestedGroup.hashCode() : 1);
|
|
result = result * 37 + (cellOperator != null ? cellOperator.hashCode() : 0);
|
|
result = result * 37 + (simOperator != null ? simOperator.hashCode() : 0);
|
|
result = result * 37 + (roaming != null ? roaming.hashCode() : 0);
|
|
result = result * 37 + (userNumber != null ? userNumber.hashCode() : 0);
|
|
hashCode = result;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static final class Builder extends Message.Builder<Checkin> {
|
|
|
|
public Checkin.Build build;
|
|
public Long lastCheckinMs;
|
|
public List<Checkin.Event> event;
|
|
public List<Checkin.Statistic> stat;
|
|
public List<String> requestedGroup;
|
|
public String cellOperator;
|
|
public String simOperator;
|
|
public String roaming;
|
|
public Integer userNumber;
|
|
|
|
public Builder() {
|
|
}
|
|
|
|
public Builder(Checkin message) {
|
|
super(message);
|
|
if (message == null) return;
|
|
this.build = message.build;
|
|
this.lastCheckinMs = message.lastCheckinMs;
|
|
this.event = copyOf(message.event);
|
|
this.stat = copyOf(message.stat);
|
|
this.requestedGroup = copyOf(message.requestedGroup);
|
|
this.cellOperator = message.cellOperator;
|
|
this.simOperator = message.simOperator;
|
|
this.roaming = message.roaming;
|
|
this.userNumber = message.userNumber;
|
|
}
|
|
|
|
/**
|
|
* empty Build on pre-checkin
|
|
*/
|
|
public Builder build(Checkin.Build build) {
|
|
this.build = build;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* last checkin ms or 0 if first checkin
|
|
* eg. 0
|
|
*/
|
|
public Builder lastCheckinMs(Long lastCheckinMs) {
|
|
this.lastCheckinMs = lastCheckinMs;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* eg. ("event_log_start",~,1424612602652) on first checkin
|
|
*/
|
|
public Builder event(List<Checkin.Event> event) {
|
|
this.event = checkForNulls(event);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unknown, n/a on first checkin
|
|
*/
|
|
public Builder stat(List<Checkin.Statistic> stat) {
|
|
this.stat = checkForNulls(stat);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
public Builder requestedGroup(List<String> requestedGroup) {
|
|
this.requestedGroup = checkForNulls(requestedGroup);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* TelephonyManager.getNetworkOperator != null|empty
|
|
*/
|
|
public Builder cellOperator(String cellOperator) {
|
|
this.cellOperator = cellOperator;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* TelephonyManager.getSimOperator != null|empty
|
|
*/
|
|
public Builder simOperator(String simOperator) {
|
|
this.simOperator = simOperator;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* "WIFI::" | ("mobile" | "notmobile" | "unknown") + "-" + ("roaming" | "notroaming" | "unknown")
|
|
*/
|
|
public Builder roaming(String roaming) {
|
|
this.roaming = roaming;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* UserHandle.myUserId
|
|
* eg. 0
|
|
*/
|
|
public Builder userNumber(Integer userNumber) {
|
|
this.userNumber = userNumber;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public Checkin build() {
|
|
checkRequiredFields();
|
|
return new Checkin(this);
|
|
}
|
|
}
|
|
|
|
public static final class Build extends Message {
|
|
|
|
public static final String DEFAULT_FINGERPRINT = "";
|
|
public static final String DEFAULT_HARDWARE = "";
|
|
public static final String DEFAULT_BRAND = "";
|
|
public static final String DEFAULT_RADIO = "";
|
|
public static final String DEFAULT_BOOTLOADER = "";
|
|
public static final String DEFAULT_CLIENTID = "";
|
|
public static final Long DEFAULT_TIME = 0L;
|
|
public static final Integer DEFAULT_PACKAGEVERSIONCODE = 0;
|
|
public static final String DEFAULT_DEVICE = "";
|
|
public static final Integer DEFAULT_SDKVERSION = 0;
|
|
public static final String DEFAULT_MODEL = "";
|
|
public static final String DEFAULT_MANUFACTURER = "";
|
|
public static final String DEFAULT_PRODUCT = "";
|
|
public static final Boolean DEFAULT_OTAINSTALLED = false;
|
|
|
|
/**
|
|
* Build.FINGERPRINT
|
|
* eg. google/razor/flo:5.0.1/LRX22C/1602158:user/release-keys
|
|
*/
|
|
@ProtoField(tag = 1, type = STRING)
|
|
public final String fingerprint;
|
|
|
|
/**
|
|
* Build.HARDWARE
|
|
* eg. flo
|
|
*/
|
|
@ProtoField(tag = 2, type = STRING)
|
|
public final String hardware;
|
|
|
|
/**
|
|
* Build.BRAND
|
|
* eg. google
|
|
*/
|
|
@ProtoField(tag = 3, type = STRING)
|
|
public final String brand;
|
|
|
|
/**
|
|
* Build.getRadioVersion()
|
|
*/
|
|
@ProtoField(tag = 4, type = STRING)
|
|
public final String radio;
|
|
|
|
/**
|
|
* Build.BOOTLOADER
|
|
* eg. FLO-04.04
|
|
*/
|
|
@ProtoField(tag = 5, type = STRING)
|
|
public final String bootloader;
|
|
|
|
/**
|
|
* GoogleSettingsContract.Partner["client_id"]
|
|
* eg. android-google
|
|
*/
|
|
@ProtoField(tag = 6, type = STRING)
|
|
public final String clientId;
|
|
|
|
/**
|
|
* Build.TIME / 1000L
|
|
* eg. 1416533192
|
|
*/
|
|
@ProtoField(tag = 7, type = INT64)
|
|
public final Long time;
|
|
|
|
/**
|
|
* PackageInfo.versionCode
|
|
* eg. 6188736
|
|
*/
|
|
@ProtoField(tag = 8, type = INT32)
|
|
public final Integer packageVersionCode;
|
|
|
|
/**
|
|
* Build.DEVICE
|
|
* eg. flo
|
|
*/
|
|
@ProtoField(tag = 9, type = STRING)
|
|
public final String device;
|
|
|
|
/**
|
|
* Build.VERSION.SDK_INT
|
|
* eg. 21
|
|
*/
|
|
@ProtoField(tag = 10, type = INT32)
|
|
public final Integer sdkVersion;
|
|
|
|
/**
|
|
* Build.MODEL
|
|
* eg. Nexus 7
|
|
*/
|
|
@ProtoField(tag = 11, type = STRING)
|
|
public final String model;
|
|
|
|
/**
|
|
* Build.MANUFACTURER
|
|
* eg. asus
|
|
*/
|
|
@ProtoField(tag = 12, type = STRING)
|
|
public final String manufacturer;
|
|
|
|
/**
|
|
* Build.PRODUCT
|
|
* eg. razor
|
|
*/
|
|
@ProtoField(tag = 13, type = STRING)
|
|
public final String product;
|
|
|
|
/**
|
|
* fileExists("/system/recovery-from-boot.p")
|
|
* eg. false
|
|
*/
|
|
@ProtoField(tag = 14, type = BOOL)
|
|
public final Boolean otaInstalled;
|
|
|
|
public Build(String fingerprint, String hardware, String brand, String radio, String bootloader, String clientId, Long time, Integer packageVersionCode, String device, Integer sdkVersion, String model, String manufacturer, String product, Boolean otaInstalled) {
|
|
this.fingerprint = fingerprint;
|
|
this.hardware = hardware;
|
|
this.brand = brand;
|
|
this.radio = radio;
|
|
this.bootloader = bootloader;
|
|
this.clientId = clientId;
|
|
this.time = time;
|
|
this.packageVersionCode = packageVersionCode;
|
|
this.device = device;
|
|
this.sdkVersion = sdkVersion;
|
|
this.model = model;
|
|
this.manufacturer = manufacturer;
|
|
this.product = product;
|
|
this.otaInstalled = otaInstalled;
|
|
}
|
|
|
|
private Build(Builder builder) {
|
|
this(builder.fingerprint, builder.hardware, builder.brand, builder.radio, builder.bootloader, builder.clientId, builder.time, builder.packageVersionCode, builder.device, builder.sdkVersion, builder.model, builder.manufacturer, builder.product, builder.otaInstalled);
|
|
setBuilder(builder);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object other) {
|
|
if (other == this) return true;
|
|
if (!(other instanceof Build)) return false;
|
|
Build o = (Build) other;
|
|
return equals(fingerprint, o.fingerprint)
|
|
&& equals(hardware, o.hardware)
|
|
&& equals(brand, o.brand)
|
|
&& equals(radio, o.radio)
|
|
&& equals(bootloader, o.bootloader)
|
|
&& equals(clientId, o.clientId)
|
|
&& equals(time, o.time)
|
|
&& equals(packageVersionCode, o.packageVersionCode)
|
|
&& equals(device, o.device)
|
|
&& equals(sdkVersion, o.sdkVersion)
|
|
&& equals(model, o.model)
|
|
&& equals(manufacturer, o.manufacturer)
|
|
&& equals(product, o.product)
|
|
&& equals(otaInstalled, o.otaInstalled);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int result = hashCode;
|
|
if (result == 0) {
|
|
result = fingerprint != null ? fingerprint.hashCode() : 0;
|
|
result = result * 37 + (hardware != null ? hardware.hashCode() : 0);
|
|
result = result * 37 + (brand != null ? brand.hashCode() : 0);
|
|
result = result * 37 + (radio != null ? radio.hashCode() : 0);
|
|
result = result * 37 + (bootloader != null ? bootloader.hashCode() : 0);
|
|
result = result * 37 + (clientId != null ? clientId.hashCode() : 0);
|
|
result = result * 37 + (time != null ? time.hashCode() : 0);
|
|
result = result * 37 + (packageVersionCode != null ? packageVersionCode.hashCode() : 0);
|
|
result = result * 37 + (device != null ? device.hashCode() : 0);
|
|
result = result * 37 + (sdkVersion != null ? sdkVersion.hashCode() : 0);
|
|
result = result * 37 + (model != null ? model.hashCode() : 0);
|
|
result = result * 37 + (manufacturer != null ? manufacturer.hashCode() : 0);
|
|
result = result * 37 + (product != null ? product.hashCode() : 0);
|
|
result = result * 37 + (otaInstalled != null ? otaInstalled.hashCode() : 0);
|
|
hashCode = result;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static final class Builder extends Message.Builder<Build> {
|
|
|
|
public String fingerprint;
|
|
public String hardware;
|
|
public String brand;
|
|
public String radio;
|
|
public String bootloader;
|
|
public String clientId;
|
|
public Long time;
|
|
public Integer packageVersionCode;
|
|
public String device;
|
|
public Integer sdkVersion;
|
|
public String model;
|
|
public String manufacturer;
|
|
public String product;
|
|
public Boolean otaInstalled;
|
|
|
|
public Builder() {
|
|
}
|
|
|
|
public Builder(Build message) {
|
|
super(message);
|
|
if (message == null) return;
|
|
this.fingerprint = message.fingerprint;
|
|
this.hardware = message.hardware;
|
|
this.brand = message.brand;
|
|
this.radio = message.radio;
|
|
this.bootloader = message.bootloader;
|
|
this.clientId = message.clientId;
|
|
this.time = message.time;
|
|
this.packageVersionCode = message.packageVersionCode;
|
|
this.device = message.device;
|
|
this.sdkVersion = message.sdkVersion;
|
|
this.model = message.model;
|
|
this.manufacturer = message.manufacturer;
|
|
this.product = message.product;
|
|
this.otaInstalled = message.otaInstalled;
|
|
}
|
|
|
|
/**
|
|
* Build.FINGERPRINT
|
|
* eg. google/razor/flo:5.0.1/LRX22C/1602158:user/release-keys
|
|
*/
|
|
public Builder fingerprint(String fingerprint) {
|
|
this.fingerprint = fingerprint;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.HARDWARE
|
|
* eg. flo
|
|
*/
|
|
public Builder hardware(String hardware) {
|
|
this.hardware = hardware;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.BRAND
|
|
* eg. google
|
|
*/
|
|
public Builder brand(String brand) {
|
|
this.brand = brand;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.getRadioVersion()
|
|
*/
|
|
public Builder radio(String radio) {
|
|
this.radio = radio;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.BOOTLOADER
|
|
* eg. FLO-04.04
|
|
*/
|
|
public Builder bootloader(String bootloader) {
|
|
this.bootloader = bootloader;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* GoogleSettingsContract.Partner["client_id"]
|
|
* eg. android-google
|
|
*/
|
|
public Builder clientId(String clientId) {
|
|
this.clientId = clientId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.TIME / 1000L
|
|
* eg. 1416533192
|
|
*/
|
|
public Builder time(Long time) {
|
|
this.time = time;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* PackageInfo.versionCode
|
|
* eg. 6188736
|
|
*/
|
|
public Builder packageVersionCode(Integer packageVersionCode) {
|
|
this.packageVersionCode = packageVersionCode;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.DEVICE
|
|
* eg. flo
|
|
*/
|
|
public Builder device(String device) {
|
|
this.device = device;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.VERSION.SDK_INT
|
|
* eg. 21
|
|
*/
|
|
public Builder sdkVersion(Integer sdkVersion) {
|
|
this.sdkVersion = sdkVersion;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.MODEL
|
|
* eg. Nexus 7
|
|
*/
|
|
public Builder model(String model) {
|
|
this.model = model;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.MANUFACTURER
|
|
* eg. asus
|
|
*/
|
|
public Builder manufacturer(String manufacturer) {
|
|
this.manufacturer = manufacturer;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.PRODUCT
|
|
* eg. razor
|
|
*/
|
|
public Builder product(String product) {
|
|
this.product = product;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* fileExists("/system/recovery-from-boot.p")
|
|
* eg. false
|
|
*/
|
|
public Builder otaInstalled(Boolean otaInstalled) {
|
|
this.otaInstalled = otaInstalled;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public Build build() {
|
|
return new Build(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static final class Event extends Message {
|
|
|
|
public static final String DEFAULT_TAG = "";
|
|
public static final String DEFAULT_VALUE = "";
|
|
public static final Long DEFAULT_TIMEMS = 0L;
|
|
|
|
@ProtoField(tag = 1, type = STRING)
|
|
public final String tag;
|
|
|
|
@ProtoField(tag = 2, type = STRING)
|
|
public final String value;
|
|
|
|
@ProtoField(tag = 3, type = INT64)
|
|
public final Long timeMs;
|
|
|
|
public Event(String tag, String value, Long timeMs) {
|
|
this.tag = tag;
|
|
this.value = value;
|
|
this.timeMs = timeMs;
|
|
}
|
|
|
|
private Event(Builder builder) {
|
|
this(builder.tag, builder.value, builder.timeMs);
|
|
setBuilder(builder);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object other) {
|
|
if (other == this) return true;
|
|
if (!(other instanceof Event)) return false;
|
|
Event o = (Event) other;
|
|
return equals(tag, o.tag)
|
|
&& equals(value, o.value)
|
|
&& equals(timeMs, o.timeMs);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int result = hashCode;
|
|
if (result == 0) {
|
|
result = tag != null ? tag.hashCode() : 0;
|
|
result = result * 37 + (value != null ? value.hashCode() : 0);
|
|
result = result * 37 + (timeMs != null ? timeMs.hashCode() : 0);
|
|
hashCode = result;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static final class Builder extends Message.Builder<Event> {
|
|
|
|
public String tag;
|
|
public String value;
|
|
public Long timeMs;
|
|
|
|
public Builder() {
|
|
}
|
|
|
|
public Builder(Event message) {
|
|
super(message);
|
|
if (message == null) return;
|
|
this.tag = message.tag;
|
|
this.value = message.value;
|
|
this.timeMs = message.timeMs;
|
|
}
|
|
|
|
public Builder tag(String tag) {
|
|
this.tag = tag;
|
|
return this;
|
|
}
|
|
|
|
public Builder value(String value) {
|
|
this.value = value;
|
|
return this;
|
|
}
|
|
|
|
public Builder timeMs(Long timeMs) {
|
|
this.timeMs = timeMs;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public Event build() {
|
|
return new Event(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static final class Statistic extends Message {
|
|
|
|
public static final String DEFAULT_TAG = "";
|
|
public static final Integer DEFAULT_COUNT = 0;
|
|
public static final Float DEFAULT_SUM = 0F;
|
|
|
|
@ProtoField(tag = 1, type = STRING, label = REQUIRED)
|
|
public final String tag;
|
|
|
|
@ProtoField(tag = 2, type = INT32)
|
|
public final Integer count;
|
|
|
|
@ProtoField(tag = 3, type = FLOAT)
|
|
public final Float sum;
|
|
|
|
public Statistic(String tag, Integer count, Float sum) {
|
|
this.tag = tag;
|
|
this.count = count;
|
|
this.sum = sum;
|
|
}
|
|
|
|
private Statistic(Builder builder) {
|
|
this(builder.tag, builder.count, builder.sum);
|
|
setBuilder(builder);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object other) {
|
|
if (other == this) return true;
|
|
if (!(other instanceof Statistic)) return false;
|
|
Statistic o = (Statistic) other;
|
|
return equals(tag, o.tag)
|
|
&& equals(count, o.count)
|
|
&& equals(sum, o.sum);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int result = hashCode;
|
|
if (result == 0) {
|
|
result = tag != null ? tag.hashCode() : 0;
|
|
result = result * 37 + (count != null ? count.hashCode() : 0);
|
|
result = result * 37 + (sum != null ? sum.hashCode() : 0);
|
|
hashCode = result;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static final class Builder extends Message.Builder<Statistic> {
|
|
|
|
public String tag;
|
|
public Integer count;
|
|
public Float sum;
|
|
|
|
public Builder() {
|
|
}
|
|
|
|
public Builder(Statistic message) {
|
|
super(message);
|
|
if (message == null) return;
|
|
this.tag = message.tag;
|
|
this.count = message.count;
|
|
this.sum = message.sum;
|
|
}
|
|
|
|
public Builder tag(String tag) {
|
|
this.tag = tag;
|
|
return this;
|
|
}
|
|
|
|
public Builder count(Integer count) {
|
|
this.count = count;
|
|
return this;
|
|
}
|
|
|
|
public Builder sum(Float sum) {
|
|
this.sum = sum;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public Statistic build() {
|
|
checkRequiredFields();
|
|
return new Statistic(this);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static final class DeviceConfig extends Message {
|
|
|
|
public static final Integer DEFAULT_TOUCHSCREEN = 0;
|
|
public static final Integer DEFAULT_KEYBOARDTYPE = 0;
|
|
public static final Integer DEFAULT_NAVIGATION = 0;
|
|
public static final Integer DEFAULT_SCREENLAYOUT = 0;
|
|
public static final Boolean DEFAULT_HASHARDKEYBOARD = false;
|
|
public static final Boolean DEFAULT_HASFIVEWAYNAVIGATION = false;
|
|
public static final Integer DEFAULT_DENSITYDPI = 0;
|
|
public static final Integer DEFAULT_GLESVERSION = 0;
|
|
public static final List<String> DEFAULT_SHAREDLIBRARY = Collections.emptyList();
|
|
public static final List<String> DEFAULT_AVAILABLEFEATURE = Collections.emptyList();
|
|
public static final List<String> DEFAULT_NATIVEPLATFORM = Collections.emptyList();
|
|
public static final Integer DEFAULT_WIDTHPIXELS = 0;
|
|
public static final Integer DEFAULT_HEIGHTPIXELS = 0;
|
|
public static final List<String> DEFAULT_LOCALE = Collections.emptyList();
|
|
public static final List<String> DEFAULT_GLEXTENSION = Collections.emptyList();
|
|
public static final Integer DEFAULT_DEVICECLASS = 0;
|
|
public static final Integer DEFAULT_MAXAPKDOWNLOADSIZEMB = 0;
|
|
|
|
/**
|
|
* ConfigurationInfo.reqTouchScreen
|
|
* eg. 3
|
|
*/
|
|
@ProtoField(tag = 1, type = INT32)
|
|
public final Integer touchScreen;
|
|
|
|
/**
|
|
* ConfigurationInfo.reqKeyboardType
|
|
* eg. 1
|
|
*/
|
|
@ProtoField(tag = 2, type = INT32)
|
|
public final Integer keyboardType;
|
|
|
|
/**
|
|
* ConfigurationInfo.reqNavigation
|
|
* eg. 1
|
|
*/
|
|
@ProtoField(tag = 3, type = INT32)
|
|
public final Integer navigation;
|
|
|
|
/**
|
|
* ConfigurationInfo.screenLayout
|
|
* eg. 3
|
|
*/
|
|
@ProtoField(tag = 4, type = INT32)
|
|
public final Integer screenLayout;
|
|
|
|
/**
|
|
* ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD
|
|
* eg. 0
|
|
*/
|
|
@ProtoField(tag = 5, type = BOOL)
|
|
public final Boolean hasHardKeyboard;
|
|
|
|
/**
|
|
* ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV
|
|
* eg. 0
|
|
*/
|
|
@ProtoField(tag = 6, type = BOOL)
|
|
public final Boolean hasFiveWayNavigation;
|
|
|
|
/**
|
|
* DisplayMetrics.densityDpi
|
|
* eg. 320
|
|
*/
|
|
@ProtoField(tag = 7, type = INT32)
|
|
public final Integer densityDpi;
|
|
|
|
/**
|
|
* ConfigurationInfo.reqGlEsVersion
|
|
* eg. 196608
|
|
*/
|
|
@ProtoField(tag = 8, type = INT32)
|
|
public final Integer glEsVersion;
|
|
|
|
/**
|
|
* PackageManager.getSystemSharedLibraryNames
|
|
* eg. "android.test.runner", "com.android.future.usb.accessory", "com.android.location.provider",
|
|
* "com.android.media.remotedisplay", "com.android.mediadrm.signer", "com.google.android.maps",
|
|
* "com.google.android.media.effects", "com.google.widevine.software.drm", "javax.obex"
|
|
*/
|
|
@ProtoField(tag = 9, type = STRING, label = REPEATED)
|
|
public final List<String> sharedLibrary;
|
|
|
|
/**
|
|
* PackageManager.getSystemAvailableFeatures
|
|
* eg. android.hardware.[...]
|
|
*/
|
|
@ProtoField(tag = 10, type = STRING, label = REPEATED)
|
|
public final List<String> availableFeature;
|
|
|
|
/**
|
|
* Build.CPU_ABI and Build.CPU_ABI2 != "unknown"
|
|
* eg. "armeabi-v7a", "armeabi"
|
|
*/
|
|
@ProtoField(tag = 11, type = STRING, label = REPEATED)
|
|
public final List<String> nativePlatform;
|
|
|
|
/**
|
|
* DisplayMetrics.widthPixels
|
|
* eg. 1200
|
|
*/
|
|
@ProtoField(tag = 12, type = INT32)
|
|
public final Integer widthPixels;
|
|
|
|
/**
|
|
* DisplayMetrics.heightPixels
|
|
* eg. 1824
|
|
*/
|
|
@ProtoField(tag = 13, type = INT32)
|
|
public final Integer heightPixels;
|
|
|
|
/**
|
|
* Context.getAssets.getLocales
|
|
* eg. [...], "en-US", [...]
|
|
*/
|
|
@ProtoField(tag = 14, type = STRING, label = REPEATED)
|
|
public final List<String> locale;
|
|
|
|
/**
|
|
* GLES10.glGetString(GLES10.GL_EXTENSIONS)
|
|
* eg. "GL_AMD_compressed_ATC_texture", [...]
|
|
*/
|
|
@ProtoField(tag = 15, type = STRING, label = REPEATED)
|
|
public final List<String> glExtension;
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
@ProtoField(tag = 16, type = INT32)
|
|
public final Integer deviceClass;
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
@ProtoField(tag = 17, type = INT32)
|
|
public final Integer maxApkDownloadSizeMb;
|
|
|
|
public DeviceConfig(Integer touchScreen, Integer keyboardType, Integer navigation, Integer screenLayout, Boolean hasHardKeyboard, Boolean hasFiveWayNavigation, Integer densityDpi, Integer glEsVersion, List<String> sharedLibrary, List<String> availableFeature, List<String> nativePlatform, Integer widthPixels, Integer heightPixels, List<String> locale, List<String> glExtension, Integer deviceClass, Integer maxApkDownloadSizeMb) {
|
|
this.touchScreen = touchScreen;
|
|
this.keyboardType = keyboardType;
|
|
this.navigation = navigation;
|
|
this.screenLayout = screenLayout;
|
|
this.hasHardKeyboard = hasHardKeyboard;
|
|
this.hasFiveWayNavigation = hasFiveWayNavigation;
|
|
this.densityDpi = densityDpi;
|
|
this.glEsVersion = glEsVersion;
|
|
this.sharedLibrary = immutableCopyOf(sharedLibrary);
|
|
this.availableFeature = immutableCopyOf(availableFeature);
|
|
this.nativePlatform = immutableCopyOf(nativePlatform);
|
|
this.widthPixels = widthPixels;
|
|
this.heightPixels = heightPixels;
|
|
this.locale = immutableCopyOf(locale);
|
|
this.glExtension = immutableCopyOf(glExtension);
|
|
this.deviceClass = deviceClass;
|
|
this.maxApkDownloadSizeMb = maxApkDownloadSizeMb;
|
|
}
|
|
|
|
private DeviceConfig(Builder builder) {
|
|
this(builder.touchScreen, builder.keyboardType, builder.navigation, builder.screenLayout, builder.hasHardKeyboard, builder.hasFiveWayNavigation, builder.densityDpi, builder.glEsVersion, builder.sharedLibrary, builder.availableFeature, builder.nativePlatform, builder.widthPixels, builder.heightPixels, builder.locale, builder.glExtension, builder.deviceClass, builder.maxApkDownloadSizeMb);
|
|
setBuilder(builder);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object other) {
|
|
if (other == this) return true;
|
|
if (!(other instanceof DeviceConfig)) return false;
|
|
DeviceConfig o = (DeviceConfig) other;
|
|
return equals(touchScreen, o.touchScreen)
|
|
&& equals(keyboardType, o.keyboardType)
|
|
&& equals(navigation, o.navigation)
|
|
&& equals(screenLayout, o.screenLayout)
|
|
&& equals(hasHardKeyboard, o.hasHardKeyboard)
|
|
&& equals(hasFiveWayNavigation, o.hasFiveWayNavigation)
|
|
&& equals(densityDpi, o.densityDpi)
|
|
&& equals(glEsVersion, o.glEsVersion)
|
|
&& equals(sharedLibrary, o.sharedLibrary)
|
|
&& equals(availableFeature, o.availableFeature)
|
|
&& equals(nativePlatform, o.nativePlatform)
|
|
&& equals(widthPixels, o.widthPixels)
|
|
&& equals(heightPixels, o.heightPixels)
|
|
&& equals(locale, o.locale)
|
|
&& equals(glExtension, o.glExtension)
|
|
&& equals(deviceClass, o.deviceClass)
|
|
&& equals(maxApkDownloadSizeMb, o.maxApkDownloadSizeMb);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int result = hashCode;
|
|
if (result == 0) {
|
|
result = touchScreen != null ? touchScreen.hashCode() : 0;
|
|
result = result * 37 + (keyboardType != null ? keyboardType.hashCode() : 0);
|
|
result = result * 37 + (navigation != null ? navigation.hashCode() : 0);
|
|
result = result * 37 + (screenLayout != null ? screenLayout.hashCode() : 0);
|
|
result = result * 37 + (hasHardKeyboard != null ? hasHardKeyboard.hashCode() : 0);
|
|
result = result * 37 + (hasFiveWayNavigation != null ? hasFiveWayNavigation.hashCode() : 0);
|
|
result = result * 37 + (densityDpi != null ? densityDpi.hashCode() : 0);
|
|
result = result * 37 + (glEsVersion != null ? glEsVersion.hashCode() : 0);
|
|
result = result * 37 + (sharedLibrary != null ? sharedLibrary.hashCode() : 1);
|
|
result = result * 37 + (availableFeature != null ? availableFeature.hashCode() : 1);
|
|
result = result * 37 + (nativePlatform != null ? nativePlatform.hashCode() : 1);
|
|
result = result * 37 + (widthPixels != null ? widthPixels.hashCode() : 0);
|
|
result = result * 37 + (heightPixels != null ? heightPixels.hashCode() : 0);
|
|
result = result * 37 + (locale != null ? locale.hashCode() : 1);
|
|
result = result * 37 + (glExtension != null ? glExtension.hashCode() : 1);
|
|
result = result * 37 + (deviceClass != null ? deviceClass.hashCode() : 0);
|
|
result = result * 37 + (maxApkDownloadSizeMb != null ? maxApkDownloadSizeMb.hashCode() : 0);
|
|
hashCode = result;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static final class Builder extends Message.Builder<DeviceConfig> {
|
|
|
|
public Integer touchScreen;
|
|
public Integer keyboardType;
|
|
public Integer navigation;
|
|
public Integer screenLayout;
|
|
public Boolean hasHardKeyboard;
|
|
public Boolean hasFiveWayNavigation;
|
|
public Integer densityDpi;
|
|
public Integer glEsVersion;
|
|
public List<String> sharedLibrary;
|
|
public List<String> availableFeature;
|
|
public List<String> nativePlatform;
|
|
public Integer widthPixels;
|
|
public Integer heightPixels;
|
|
public List<String> locale;
|
|
public List<String> glExtension;
|
|
public Integer deviceClass;
|
|
public Integer maxApkDownloadSizeMb;
|
|
|
|
public Builder() {
|
|
}
|
|
|
|
public Builder(DeviceConfig message) {
|
|
super(message);
|
|
if (message == null) return;
|
|
this.touchScreen = message.touchScreen;
|
|
this.keyboardType = message.keyboardType;
|
|
this.navigation = message.navigation;
|
|
this.screenLayout = message.screenLayout;
|
|
this.hasHardKeyboard = message.hasHardKeyboard;
|
|
this.hasFiveWayNavigation = message.hasFiveWayNavigation;
|
|
this.densityDpi = message.densityDpi;
|
|
this.glEsVersion = message.glEsVersion;
|
|
this.sharedLibrary = copyOf(message.sharedLibrary);
|
|
this.availableFeature = copyOf(message.availableFeature);
|
|
this.nativePlatform = copyOf(message.nativePlatform);
|
|
this.widthPixels = message.widthPixels;
|
|
this.heightPixels = message.heightPixels;
|
|
this.locale = copyOf(message.locale);
|
|
this.glExtension = copyOf(message.glExtension);
|
|
this.deviceClass = message.deviceClass;
|
|
this.maxApkDownloadSizeMb = message.maxApkDownloadSizeMb;
|
|
}
|
|
|
|
/**
|
|
* ConfigurationInfo.reqTouchScreen
|
|
* eg. 3
|
|
*/
|
|
public Builder touchScreen(Integer touchScreen) {
|
|
this.touchScreen = touchScreen;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* ConfigurationInfo.reqKeyboardType
|
|
* eg. 1
|
|
*/
|
|
public Builder keyboardType(Integer keyboardType) {
|
|
this.keyboardType = keyboardType;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* ConfigurationInfo.reqNavigation
|
|
* eg. 1
|
|
*/
|
|
public Builder navigation(Integer navigation) {
|
|
this.navigation = navigation;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* ConfigurationInfo.screenLayout
|
|
* eg. 3
|
|
*/
|
|
public Builder screenLayout(Integer screenLayout) {
|
|
this.screenLayout = screenLayout;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD
|
|
* eg. 0
|
|
*/
|
|
public Builder hasHardKeyboard(Boolean hasHardKeyboard) {
|
|
this.hasHardKeyboard = hasHardKeyboard;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV
|
|
* eg. 0
|
|
*/
|
|
public Builder hasFiveWayNavigation(Boolean hasFiveWayNavigation) {
|
|
this.hasFiveWayNavigation = hasFiveWayNavigation;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* DisplayMetrics.densityDpi
|
|
* eg. 320
|
|
*/
|
|
public Builder densityDpi(Integer densityDpi) {
|
|
this.densityDpi = densityDpi;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* ConfigurationInfo.reqGlEsVersion
|
|
* eg. 196608
|
|
*/
|
|
public Builder glEsVersion(Integer glEsVersion) {
|
|
this.glEsVersion = glEsVersion;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* PackageManager.getSystemSharedLibraryNames
|
|
* eg. "android.test.runner", "com.android.future.usb.accessory", "com.android.location.provider",
|
|
* "com.android.media.remotedisplay", "com.android.mediadrm.signer", "com.google.android.maps",
|
|
* "com.google.android.media.effects", "com.google.widevine.software.drm", "javax.obex"
|
|
*/
|
|
public Builder sharedLibrary(List<String> sharedLibrary) {
|
|
this.sharedLibrary = checkForNulls(sharedLibrary);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* PackageManager.getSystemAvailableFeatures
|
|
* eg. android.hardware.[...]
|
|
*/
|
|
public Builder availableFeature(List<String> availableFeature) {
|
|
this.availableFeature = checkForNulls(availableFeature);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Build.CPU_ABI and Build.CPU_ABI2 != "unknown"
|
|
* eg. "armeabi-v7a", "armeabi"
|
|
*/
|
|
public Builder nativePlatform(List<String> nativePlatform) {
|
|
this.nativePlatform = checkForNulls(nativePlatform);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* DisplayMetrics.widthPixels
|
|
* eg. 1200
|
|
*/
|
|
public Builder widthPixels(Integer widthPixels) {
|
|
this.widthPixels = widthPixels;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* DisplayMetrics.heightPixels
|
|
* eg. 1824
|
|
*/
|
|
public Builder heightPixels(Integer heightPixels) {
|
|
this.heightPixels = heightPixels;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Context.getAssets.getLocales
|
|
* eg. [...], "en-US", [...]
|
|
*/
|
|
public Builder locale(List<String> locale) {
|
|
this.locale = checkForNulls(locale);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* GLES10.glGetString(GLES10.GL_EXTENSIONS)
|
|
* eg. "GL_AMD_compressed_ATC_texture", [...]
|
|
*/
|
|
public Builder glExtension(List<String> glExtension) {
|
|
this.glExtension = checkForNulls(glExtension);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
public Builder deviceClass(Integer deviceClass) {
|
|
this.deviceClass = deviceClass;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* unused
|
|
*/
|
|
public Builder maxApkDownloadSizeMb(Integer maxApkDownloadSizeMb) {
|
|
this.maxApkDownloadSizeMb = maxApkDownloadSizeMb;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public DeviceConfig build() {
|
|
return new DeviceConfig(this);
|
|
}
|
|
}
|
|
}
|
|
}
|