michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.background.healthreport; michael@0: michael@0: /** michael@0: * This captures all of the details that define an 'environment' for FHR's purposes. michael@0: * Whenever this format changes, it'll be changing with a build ID, so no migration michael@0: * of values is needed. michael@0: * michael@0: * Unless you remove the build descriptors from the set, of course. michael@0: * michael@0: * Or store these in a database. michael@0: * michael@0: * Instances of this class should be considered "effectively immutable": control their michael@0: * scope such that clear creation/sharing boundaries exist. Once you've populated and michael@0: * registered an Environment, don't do so again; start from scratch. michael@0: * michael@0: */ michael@0: public abstract class Environment extends EnvironmentV1 { michael@0: // Version 2 adds osLocale, appLocale, acceptLangSet, and distribution. michael@0: public static final int CURRENT_VERSION = 2; michael@0: michael@0: public String osLocale; // The Android OS "Locale" value. michael@0: public String appLocale; michael@0: public int acceptLangSet; michael@0: public String distribution; // ID + version. Typically empty. michael@0: michael@0: public Environment() { michael@0: this(Environment.HashAppender.class); michael@0: } michael@0: michael@0: public Environment(Class appenderClass) { michael@0: super(appenderClass); michael@0: version = CURRENT_VERSION; michael@0: } michael@0: michael@0: @Override michael@0: protected void appendHash(EnvironmentAppender appender) { michael@0: super.appendHash(appender); michael@0: michael@0: // v2. michael@0: appender.append(osLocale); michael@0: appender.append(appLocale); michael@0: appender.append(acceptLangSet); michael@0: appender.append(distribution); michael@0: } michael@0: }