1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/AppConstants.java.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,167 @@ 1.4 +#filter substitution 1.5 +/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +package org.mozilla.gecko; 1.11 + 1.12 +import android.app.Activity; 1.13 + 1.14 +import org.mozilla.gecko.mozglue.RobocopTarget; 1.15 + 1.16 +/** 1.17 + * A collection of constants that pertain to the build and runtime state of the 1.18 + * application. Typically these are sourced from build-time definitions (see 1.19 + * Makefile.in). This is a Java-side substitute for nsIXULAppInfo, amongst 1.20 + * other things. 1.21 + * 1.22 + * See also SysInfo.java, which includes some of the values available from 1.23 + * nsSystemInfo inside Gecko. 1.24 + */ 1.25 +@RobocopTarget 1.26 +public class AppConstants { 1.27 + public static final String ANDROID_PACKAGE_NAME = "@ANDROID_PACKAGE_NAME@"; 1.28 + public static final String MANGLED_ANDROID_PACKAGE_NAME = "@MANGLED_ANDROID_PACKAGE_NAME@"; 1.29 + 1.30 + /** 1.31 + * The name of the Java class that launches the browser. 1.32 + */ 1.33 + public static final String BROWSER_INTENT_CLASS_NAME = ANDROID_PACKAGE_NAME + ".App"; 1.34 + 1.35 + public static final String GRE_MILESTONE = "@GRE_MILESTONE@"; 1.36 + 1.37 + public static final String MOZ_APP_ABI = "@MOZ_APP_ABI@"; 1.38 + public static final String MOZ_APP_BASENAME = "@MOZ_APP_BASENAME@"; 1.39 + 1.40 + // For the benefit of future archaeologists: APP_BUILDID and 1.41 + // MOZ_APP_BUILDID are *exactly* the same. 1.42 + // GRE_BUILDID is exactly the same unless you're running on XULRunner, 1.43 + // which is never the case on Android. 1.44 + public static final String MOZ_APP_BUILDID = "@MOZ_APP_BUILDID@"; 1.45 + public static final String MOZ_APP_ID = "@MOZ_APP_ID@"; 1.46 + public static final String MOZ_APP_NAME = "@MOZ_APP_NAME@"; 1.47 + public static final String MOZ_APP_VENDOR = "@MOZ_APP_VENDOR@"; 1.48 + public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@"; 1.49 + 1.50 + // MOZILLA_VERSION is already quoted when it gets substituted in. If we 1.51 + // add additional quotes we end up with ""x.y"", which is a syntax error. 1.52 + public static final String MOZILLA_VERSION = @MOZILLA_VERSION@; 1.53 + 1.54 + public static final String MOZ_CHILD_PROCESS_NAME = "@MOZ_CHILD_PROCESS_NAME@"; 1.55 + public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@"; 1.56 + public static final String OMNIJAR_NAME = "@OMNIJAR_NAME@"; 1.57 + public static final String OS_TARGET = "@OS_TARGET@"; 1.58 + public static final String TARGET_XPCOM_ABI = "@TARGET_XPCOM_ABI@"; 1.59 + 1.60 + public static final String USER_AGENT_BOT_LIKE = "Redirector/" + AppConstants.MOZ_APP_VERSION + 1.61 + " (Android; rv:" + AppConstants.MOZ_APP_VERSION + ")"; 1.62 + 1.63 + public static final String USER_AGENT_FENNEC_MOBILE = "Mozilla/5.0 (Android; Mobile; rv:" + 1.64 + AppConstants.MOZ_APP_VERSION + ") Gecko/" + 1.65 + AppConstants.MOZ_APP_VERSION + " Firefox/" + 1.66 + AppConstants.MOZ_APP_VERSION; 1.67 + 1.68 + public static final String USER_AGENT_FENNEC_TABLET = "Mozilla/5.0 (Android; Tablet; rv:" + 1.69 + AppConstants.MOZ_APP_VERSION + ") Gecko/" + 1.70 + AppConstants.MOZ_APP_VERSION + " Firefox/" + 1.71 + AppConstants.MOZ_APP_VERSION; 1.72 + 1.73 + public static final int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@; 1.74 + 1.75 + public static final boolean MOZ_ANDROID_ANR_REPORTER = 1.76 +#ifdef MOZ_ANDROID_ANR_REPORTER 1.77 + true; 1.78 +#else 1.79 + false; 1.80 +#endif 1.81 + 1.82 + public static final String MOZ_PKG_SPECIAL = 1.83 +#ifdef MOZ_PKG_SPECIAL 1.84 + "@MOZ_PKG_SPECIAL@"; 1.85 +#else 1.86 + null; 1.87 +#endif 1.88 + 1.89 + public static final boolean MOZ_SERVICES_HEALTHREPORT = 1.90 +#ifdef MOZ_SERVICES_HEALTHREPORT 1.91 + true; 1.92 +#else 1.93 + false; 1.94 +#endif 1.95 + 1.96 + public static final boolean MOZ_TELEMETRY_ON_BY_DEFAULT = 1.97 +#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT 1.98 + true; 1.99 +#else 1.100 + false; 1.101 +#endif 1.102 + 1.103 + public static final String TELEMETRY_PREF_NAME = 1.104 + "toolkit.telemetry.enabled"; 1.105 + 1.106 + public static final boolean MOZ_TELEMETRY_REPORTING = 1.107 +#ifdef MOZ_TELEMETRY_REPORTING 1.108 + true; 1.109 +#else 1.110 + false; 1.111 +#endif 1.112 + 1.113 + public static final boolean MOZ_CRASHREPORTER = 1.114 +#if MOZ_CRASHREPORTER 1.115 + true; 1.116 +#else 1.117 + false; 1.118 +#endif 1.119 + 1.120 + public static final boolean MOZ_DATA_REPORTING = 1.121 +#ifdef MOZ_DATA_REPORTING 1.122 + true; 1.123 +#else 1.124 + false; 1.125 +#endif 1.126 + 1.127 + public static final boolean MOZ_UPDATER = 1.128 +#ifdef MOZ_UPDATER 1.129 + true; 1.130 +#else 1.131 + false; 1.132 +#endif 1.133 + 1.134 + public static final boolean MOZ_WEBSMS_BACKEND = 1.135 +#ifdef MOZ_WEBSMS_BACKEND 1.136 + true; 1.137 +#else 1.138 + false; 1.139 +#endif 1.140 + 1.141 + public static final boolean MOZ_ANDROID_BEAM = 1.142 +#ifdef MOZ_ANDROID_BEAM 1.143 + true; 1.144 +#else 1.145 + false; 1.146 +#endif 1.147 + 1.148 + public static final boolean MOZ_ANDROID_SYNTHAPKS = 1.149 +#ifdef MOZ_ANDROID_SYNTHAPKS 1.150 + true; 1.151 +#else 1.152 + false; 1.153 +#endif 1.154 + 1.155 + // See this wiki page for more details about channel specific build defines: 1.156 + // https://wiki.mozilla.org/Platform/Channel-specific_build_defines 1.157 + public static final boolean RELEASE_BUILD = 1.158 +#ifdef RELEASE_BUILD 1.159 + true; 1.160 +#else 1.161 + false; 1.162 +#endif 1.163 + 1.164 + public static final boolean DEBUG_BUILD = 1.165 +#ifdef MOZ_DEBUG 1.166 + true; 1.167 +#else 1.168 + false; 1.169 +#endif 1.170 +}