michael@0: #filter substitution michael@0: /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- 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; michael@0: michael@0: import android.app.Activity; michael@0: michael@0: import org.mozilla.gecko.mozglue.RobocopTarget; michael@0: michael@0: /** michael@0: * A collection of constants that pertain to the build and runtime state of the michael@0: * application. Typically these are sourced from build-time definitions (see michael@0: * Makefile.in). This is a Java-side substitute for nsIXULAppInfo, amongst michael@0: * other things. michael@0: * michael@0: * See also SysInfo.java, which includes some of the values available from michael@0: * nsSystemInfo inside Gecko. michael@0: */ michael@0: @RobocopTarget michael@0: public class AppConstants { michael@0: public static final String ANDROID_PACKAGE_NAME = "@ANDROID_PACKAGE_NAME@"; michael@0: public static final String MANGLED_ANDROID_PACKAGE_NAME = "@MANGLED_ANDROID_PACKAGE_NAME@"; michael@0: michael@0: /** michael@0: * The name of the Java class that launches the browser. michael@0: */ michael@0: public static final String BROWSER_INTENT_CLASS_NAME = ANDROID_PACKAGE_NAME + ".App"; michael@0: michael@0: public static final String GRE_MILESTONE = "@GRE_MILESTONE@"; michael@0: michael@0: public static final String MOZ_APP_ABI = "@MOZ_APP_ABI@"; michael@0: public static final String MOZ_APP_BASENAME = "@MOZ_APP_BASENAME@"; michael@0: michael@0: // For the benefit of future archaeologists: APP_BUILDID and michael@0: // MOZ_APP_BUILDID are *exactly* the same. michael@0: // GRE_BUILDID is exactly the same unless you're running on XULRunner, michael@0: // which is never the case on Android. michael@0: public static final String MOZ_APP_BUILDID = "@MOZ_APP_BUILDID@"; michael@0: public static final String MOZ_APP_ID = "@MOZ_APP_ID@"; michael@0: public static final String MOZ_APP_NAME = "@MOZ_APP_NAME@"; michael@0: public static final String MOZ_APP_VENDOR = "@MOZ_APP_VENDOR@"; michael@0: public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@"; michael@0: michael@0: // MOZILLA_VERSION is already quoted when it gets substituted in. If we michael@0: // add additional quotes we end up with ""x.y"", which is a syntax error. michael@0: public static final String MOZILLA_VERSION = @MOZILLA_VERSION@; michael@0: michael@0: public static final String MOZ_CHILD_PROCESS_NAME = "@MOZ_CHILD_PROCESS_NAME@"; michael@0: public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@"; michael@0: public static final String OMNIJAR_NAME = "@OMNIJAR_NAME@"; michael@0: public static final String OS_TARGET = "@OS_TARGET@"; michael@0: public static final String TARGET_XPCOM_ABI = "@TARGET_XPCOM_ABI@"; michael@0: michael@0: public static final String USER_AGENT_BOT_LIKE = "Redirector/" + AppConstants.MOZ_APP_VERSION + michael@0: " (Android; rv:" + AppConstants.MOZ_APP_VERSION + ")"; michael@0: michael@0: public static final String USER_AGENT_FENNEC_MOBILE = "Mozilla/5.0 (Android; Mobile; rv:" + michael@0: AppConstants.MOZ_APP_VERSION + ") Gecko/" + michael@0: AppConstants.MOZ_APP_VERSION + " Firefox/" + michael@0: AppConstants.MOZ_APP_VERSION; michael@0: michael@0: public static final String USER_AGENT_FENNEC_TABLET = "Mozilla/5.0 (Android; Tablet; rv:" + michael@0: AppConstants.MOZ_APP_VERSION + ") Gecko/" + michael@0: AppConstants.MOZ_APP_VERSION + " Firefox/" + michael@0: AppConstants.MOZ_APP_VERSION; michael@0: michael@0: public static final int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@; michael@0: michael@0: public static final boolean MOZ_ANDROID_ANR_REPORTER = michael@0: #ifdef MOZ_ANDROID_ANR_REPORTER michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final String MOZ_PKG_SPECIAL = michael@0: #ifdef MOZ_PKG_SPECIAL michael@0: "@MOZ_PKG_SPECIAL@"; michael@0: #else michael@0: null; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_SERVICES_HEALTHREPORT = michael@0: #ifdef MOZ_SERVICES_HEALTHREPORT michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_TELEMETRY_ON_BY_DEFAULT = michael@0: #ifdef MOZ_TELEMETRY_ON_BY_DEFAULT michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final String TELEMETRY_PREF_NAME = michael@0: "toolkit.telemetry.enabled"; michael@0: michael@0: public static final boolean MOZ_TELEMETRY_REPORTING = michael@0: #ifdef MOZ_TELEMETRY_REPORTING michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_CRASHREPORTER = michael@0: #if MOZ_CRASHREPORTER michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_DATA_REPORTING = michael@0: #ifdef MOZ_DATA_REPORTING michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_UPDATER = michael@0: #ifdef MOZ_UPDATER michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_WEBSMS_BACKEND = michael@0: #ifdef MOZ_WEBSMS_BACKEND michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_ANDROID_BEAM = michael@0: #ifdef MOZ_ANDROID_BEAM michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean MOZ_ANDROID_SYNTHAPKS = michael@0: #ifdef MOZ_ANDROID_SYNTHAPKS michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: // See this wiki page for more details about channel specific build defines: michael@0: // https://wiki.mozilla.org/Platform/Channel-specific_build_defines michael@0: public static final boolean RELEASE_BUILD = michael@0: #ifdef RELEASE_BUILD michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: michael@0: public static final boolean DEBUG_BUILD = michael@0: #ifdef MOZ_DEBUG michael@0: true; michael@0: #else michael@0: false; michael@0: #endif michael@0: }