Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2019-04-27 09:01:02 +08:00
commit 2cb30a238c
4110 changed files with 343 additions and 435849 deletions

View file

@ -346,18 +346,6 @@ pref("browser.search.order.1", "chrome://browser-region/locale/re
pref("browser.search.order.2", "chrome://browser-region/locale/region.properties");
pref("browser.search.order.3", "chrome://browser-region/locale/region.properties");
// Market-specific search defaults
// This is disabled globally, and then enabled for individual locales
// in firefox-l10n.js (eg. it's enabled for en-US).
pref("browser.search.geoSpecificDefaults", false);
pref("browser.search.geoSpecificDefaults.url", "https://search.services.mozilla.com/1/%APP%/%VERSION%/%CHANNEL%/%LOCALE%/%REGION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%");
// US specific default (used as a fallback if the geoSpecificDefaults request fails).
pref("browser.search.defaultenginename.US", "data:text/plain,browser.search.defaultenginename.US=Google");
pref("browser.search.order.US.1", "data:text/plain,browser.search.order.US.1=Google");
pref("browser.search.order.US.2", "data:text/plain,browser.search.order.US.2=Yahoo");
pref("browser.search.order.US.3", "data:text/plain,browser.search.order.US.3=Bing");
// search bar results always open in a new tab
pref("browser.search.openintab", false);

View file

@ -362,7 +362,7 @@
// First, find the index of the <a> tag we care about, being
// careful not to use an over-greedy regex.
var re = /<a id="cert_domain_link" title="([^"]+)">/;
var result = domainRe.exec(desc);
var result = re.exec(desc);
if (!result)
return;

View file

@ -145,10 +145,6 @@ const gXPInstallObserver = {
for (let install of installInfo.installs)
install.install();
installInfo = null;
Services.telemetry
.getHistogramById("SECURITY_UI")
.add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH);
};
break;
}
@ -208,10 +204,6 @@ const gXPInstallObserver = {
options);
removeNotificationOnEnd(popup, installInfo.installs);
Services.telemetry
.getHistogramById("SECURITY_UI")
.add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
},
observe: function (aSubject, aTopic, aData)
@ -262,8 +254,6 @@ const gXPInstallObserver = {
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage",
[brandShortName]);
let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI");
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED);
let popup = PopupNotifications.show(browser, notificationID,
messageString, anchorID,
null, null, options);
@ -273,17 +263,14 @@ const gXPInstallObserver = {
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage",
[brandShortName]);
let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI");
action = {
label: gNavigatorBundle.getString("xpinstallPromptAllowButton"),
accessKey: gNavigatorBundle.getString("xpinstallPromptAllowButton.accesskey"),
callback: function() {
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED_CLICK_THROUGH);
installInfo.install();
}
};
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED);
let popup = PopupNotifications.show(browser, notificationID,
messageString, anchorID,
action, null, options);

View file

@ -275,7 +275,6 @@ var gSyncUI = {
openPreferences("paneSync");
},
// Helpers
_updateLastSyncTime: function SUI__updateLastSyncTime() {
if (!gBrowser)

View file

@ -2628,15 +2628,9 @@ var gMenuButtonUpdateBadge = {
cancelObserverRegistered: false,
init: function () {
try {
this.enabled = Services.prefs.getBoolPref("app.update.badge");
} catch (e) {}
this.enabled = Services.prefs.getBoolPref("app.update.badge", false);
if (this.enabled) {
try {
this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime");
} catch (e) {
this.badgeWaitTime = 345600; // 4 days
}
this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime", 345600); // 4 days
Services.obs.addObserver(this, "update-staged", false);
Services.obs.addObserver(this, "update-downloaded", false);
}
@ -2853,15 +2847,10 @@ var BrowserOnClick = {
},
onCertError: function (browser, elementId, isTopFrame, location, securityInfoAsString) {
let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
let securityInfo;
switch (elementId) {
case "exceptionDialogButton":
if (isTopFrame) {
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_CLICK_ADD_EXCEPTION);
}
securityInfo = getSecurityInfo(securityInfoAsString);
let sslStatus = securityInfo.QueryInterface(Ci.nsISSLStatusProvider)
.SSLStatus;
@ -2889,64 +2878,27 @@ var BrowserOnClick = {
break;
case "returnButton":
if (isTopFrame) {
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_GET_ME_OUT_OF_HERE);
}
goBackFromErrorPage();
break;
case "advancedButton":
if (isTopFrame) {
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_UNDERSTAND_RISKS);
}
break;
}
},
onAboutBlocked: function (elementId, reason, isTopFrame, location) {
// Depending on what page we are displaying here (malware/phishing/unwanted)
// use the right strings and links for each.
let bucketName = "";
let sendTelemetry = false;
if (reason === 'malware') {
sendTelemetry = true;
bucketName = "WARNING_MALWARE_PAGE_";
} else if (reason === 'phishing') {
sendTelemetry = true;
bucketName = "WARNING_PHISHING_PAGE_";
} else if (reason === 'unwanted') {
sendTelemetry = true;
bucketName = "WARNING_UNWANTED_PAGE_";
}
let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
let nsISecTel = Ci.nsISecurityUITelemetry;
bucketName += isTopFrame ? "TOP_" : "FRAME_";
switch (elementId) {
case "getMeOutButton":
if (sendTelemetry) {
secHistogram.add(nsISecTel[bucketName + "GET_ME_OUT_OF_HERE"]);
}
getMeOutOfHere();
break;
case "reportButton":
// This is the "Why is this site blocked" button. We redirect
// to the generic page describing phishing/malware protection.
// We log even if malware/phishing/unwanted info URL couldn't be found:
// the measurement is for how many users clicked the WHY BLOCKED button
if (sendTelemetry) {
secHistogram.add(nsISecTel[bucketName + "WHY_BLOCKED"]);
}
openHelpLink("phishing-malware", false, "current");
break;
case "ignoreWarningButton":
if (gPrefService.getBoolPref("browser.safebrowsing.allowOverride")) {
if (sendTelemetry) {
secHistogram.add(nsISecTel[bucketName + "IGNORE_WARNING"]);
}
this.ignoreWarningButton(reason);
}
break;

View file

@ -4190,11 +4190,7 @@
return true;
if (this._logInit)
return this._shouldLog;
let result = false;
try {
result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming");
} catch (ex) {
}
let result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming", false);
this._shouldLog = result;
this._logInit = true;
return this._shouldLog;
@ -5277,11 +5273,7 @@
window.addEventListener("resize", this, false);
window.addEventListener("load", this, false);
try {
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled");
} catch (ex) {
this._tabAnimationLoggingEnabled = false;
}
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false);
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
this.observe(null, "nsPref:changed", "privacy.userContext.enabled");
Services.prefs.addObserver("privacy.userContext.enabled", this, false);

View file

@ -158,10 +158,7 @@ var gUIStateBeforeReset = {
XPCOMUtils.defineLazyGetter(this, "log", () => {
let scope = {};
Cu.import("resource://gre/modules/Console.jsm", scope);
let debug;
try {
debug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
} catch (ex) {}
let debug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false);
let consoleOptions = {
maxLogLevel: debug ? "all" : "log",
prefix: "CustomizableUI",
@ -1924,16 +1921,10 @@ var CustomizableUIInternal = {
// state immediately when a browser window opens, which is important for
// other consumers of this API.
loadSavedState: function() {
let state = null;
try {
state = Services.prefs.getCharPref(kPrefCustomizationState);
} catch (e) {
log.debug("No saved state found");
// This will fail if nothing has been customized, so silently fall back to
// the defaults.
}
let state = Services.prefs.getCharPref(kPrefCustomizationState, "");
if (!state) {
log.debug("No saved state found");
// Nothing has been customized, so silently fall back to the defaults.
return;
}
try {
@ -2218,10 +2209,7 @@ var CustomizableUIInternal = {
this.notifyListeners("onWidgetAdded", widget.id, widget.currentArea,
widget.currentPosition);
} else if (widgetMightNeedAutoAdding) {
let autoAdd = true;
try {
autoAdd = Services.prefs.getBoolPref(kPrefCustomizationAutoAdd);
} catch (e) {}
let autoAdd = Services.prefs.getBoolPref(kPrefCustomizationAutoAdd, true);
// If the widget doesn't have an existing placement, and it hasn't been
// seen before, then add it to its default area so it can be used.

View file

@ -42,10 +42,7 @@ const kWidePanelItemClass = "panel-wide-item";
XPCOMUtils.defineLazyGetter(this, "log", () => {
let scope = {};
Cu.import("resource://gre/modules/Console.jsm", scope);
let debug;
try {
debug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
} catch (ex) {}
let debug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false);
let consoleOptions = {
maxLogLevel: debug ? "all" : "log",
prefix: "CustomizableWidgets",

View file

@ -40,9 +40,7 @@ let gDebug;
XPCOMUtils.defineLazyGetter(this, "log", () => {
let scope = {};
Cu.import("resource://gre/modules/Console.jsm", scope);
try {
gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
} catch (ex) {}
gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false);
let consoleOptions = {
maxLogLevel: gDebug ? "all" : "log",
prefix: "CustomizeMode",
@ -1503,10 +1501,7 @@ CustomizeMode.prototype = {
if (!AppConstants.CAN_DRAW_IN_TITLEBAR) {
return;
}
let drawInTitlebar = true;
try {
drawInTitlebar = Services.prefs.getBoolPref(kDrawInTitlebarPref);
} catch (ex) { }
let drawInTitlebar = Services.prefs.getBoolPref(kDrawInTitlebarPref, true);
let button = this.document.getElementById("customization-titlebar-visibility-button");
// Drawing in the titlebar means 'hiding' the titlebar:
if (drawInTitlebar) {

View file

@ -22,10 +22,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
this.DistributionCustomizer = function DistributionCustomizer() {
// For parallel xpcshell testing purposes allow loading the distribution.ini
// file from the profile folder through an hidden pref.
let loadFromProfile = false;
try {
loadFromProfile = Services.prefs.getBoolPref("distribution.testing.loadFromProfile");
} catch (ex) {}
loadFromProfile = Services.prefs.getBoolPref("distribution.testing.loadFromProfile", false);
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
try {
@ -60,13 +57,7 @@ DistributionCustomizer.prototype = {
},
get _locale() {
let locale;
try {
locale = this._prefs.getCharPref("general.useragent.locale");
}
catch (e) {
locale = "en-US";
}
let locale = this._prefs.getCharPref("general.useragent.locale", "en-US");
this.__defineGetter__("_locale", () => locale);
return this._locale;
},
@ -291,11 +282,7 @@ DistributionCustomizer.prototype = {
this._ini.getString("Global", "id") + ".bookmarksProcessed";
}
let bmProcessed = false;
try {
bmProcessed = this._prefs.getBoolPref(bmProcessedPref);
}
catch (e) {}
let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false);
if (!bmProcessed) {
if (sections["BookmarksMenu"])

View file

@ -19,12 +19,7 @@ function LOG(str) {
let prefB = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
let shouldLog = false;
try {
shouldLog = prefB.getBoolPref("feeds.log");
}
catch (ex) {
}
let shouldLog = prefB.getBoolPref("feeds.log", false);
if (shouldLog)
dump("*** Feeds: " + str + "\n");

View file

@ -187,13 +187,8 @@ const Utils = {
// check if it is in the black list
let pb = Services.prefs;
let allowed;
try {
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol);
}
catch (e) {
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default");
}
let allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol,
pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"));
if (!allowed) {
throw this.getSecurityError(
`Not allowed to register a protocol handler for ${aProtocol}`,

View file

@ -100,20 +100,14 @@ const OVERRIDE_NEW_BUILD_ID = 3;
* OVERRIDE_NONE otherwise.
*/
function needHomepageOverride(prefb) {
var savedmstone = null;
try {
savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone");
} catch (e) {}
var savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone", "");
if (savedmstone == "ignore")
return OVERRIDE_NONE;
var mstone = Services.appinfo.platformVersion;
var savedBuildID = null;
try {
savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID");
} catch (e) {}
var savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID", "");
var buildID = Services.appinfo.platformBuildID;
@ -489,10 +483,7 @@ nsBrowserContentHandler.prototype = {
// URL if we do end up showing an overridePage. This makes it possible
// to have the overridePage's content vary depending on the version we're
// upgrading from.
let old_mstone = "unknown";
try {
old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone");
} catch (ex) {}
let old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "unknown");
override = needHomepageOverride(prefb);
if (override != OVERRIDE_NONE) {
switch (override) {

View file

@ -961,10 +961,7 @@ BrowserGlue.prototype = {
// Offer to reset a user's profile if it hasn't been used for 60 days.
const OFFER_PROFILE_RESET_INTERVAL_MS = 60 * 24 * 60 * 60 * 1000;
let lastUse = Services.appinfo.replacedLockTime;
let disableResetPrompt = false;
try {
disableResetPrompt = Services.prefs.getBoolPref("browser.disableResetPrompt");
} catch (e) {}
let disableResetPrompt = Services.prefs.getBoolPref("browser.disableResetPrompt", false);
if (!disableResetPrompt && lastUse &&
Date.now() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
@ -1505,10 +1502,7 @@ BrowserGlue.prototype = {
} catch (ex) {}
// Support legacy bookmarks.html format for apps that depend on that format.
let autoExportHTML = false;
try {
autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML");
} catch (ex) {} // Do not export.
let autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false); // Do not export.
if (autoExportHTML) {
// Sqlite.jsm and Places shutdown happen at profile-before-change, thus,
// to be on the safe side, this should run earlier.
@ -1578,10 +1572,7 @@ BrowserGlue.prototype = {
// An import operation is about to run.
// Don't try to recreate smart bookmarks if autoExportHTML is true or
// smart bookmarks are disabled.
let smartBookmarksVersion = 0;
try {
smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion");
} catch (ex) {}
let smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0);
if (!autoExportHTML && smartBookmarksVersion != -1)
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
@ -1932,10 +1923,7 @@ BrowserGlue.prototype = {
// Refactor urlbar suggestion preferences to make it extendable and
// allow new suggestion types (e.g: search suggestions).
let types = ["history", "bookmark", "openpage"];
let defaultBehavior = 0;
try {
defaultBehavior = Services.prefs.getIntPref("browser.urlbar.default.behavior");
} catch (ex) {}
let defaultBehavior = Services.prefs.getIntPref("browser.urlbar.default.behavior", 0);
try {
let autocompleteEnabled = Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled");
if (!autocompleteEnabled) {
@ -1988,12 +1976,8 @@ BrowserGlue.prototype = {
if (currentUIVersion < 30) {
// Convert old devedition theme pref to lightweight theme storage
let lightweightThemeSelected = false;
let selectedThemeID = null;
try {
lightweightThemeSelected = Services.prefs.prefHasUserValue("lightweightThemes.selectedThemeID");
selectedThemeID = Services.prefs.getCharPref("lightweightThemes.selectedThemeID");
} catch (e) {}
let lightweightThemeSelected = Services.prefs.prefHasUserValue("lightweightThemes.selectedThemeID", false);
let selectedThemeID = Services.prefs.getCharPref("lightweightThemes.selectedThemeID", "");
let defaultThemeSelected = false;
try {
@ -2143,10 +2127,7 @@ BrowserGlue.prototype = {
const MAX_RESULTS = 10;
// Get current smart bookmarks version. If not set, create them.
let smartBookmarksCurrentVersion = 0;
try {
smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF);
} catch (ex) {}
let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0);
// If version is current, or smart bookmarks are disabled, bail out.
if (smartBookmarksCurrentVersion == -1 ||

View file

@ -4,4 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['service']
JAR_MANIFESTS += ['jar.mn']

View file

@ -4,28 +4,21 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIST_SUBDIR = ''
DEFINES['HAVE_SIDEBAR'] = True
EXTRA_COMPONENTS += [
'nsSearchSuggestions.js',
'nsSidebar.js',
]
EXTRA_PP_COMPONENTS += [
'nsSearchService.js',
]
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_FENNEC'] or CONFIG['MOZ_XULRUNNER']:
DEFINES['HAVE_SIDEBAR'] = True
EXTRA_COMPONENTS += [
'nsSidebar.js',
]
EXTRA_JS_MODULES += [
'SearchSuggestionController.jsm',
]
EXTRA_PP_COMPONENTS += [
'toolkitsearch.manifest',
]
EXTRA_JS_MODULES += [
'SearchStaticData.jsm',
'SearchSuggestionController.jsm',
]

View file

@ -388,413 +388,6 @@ function isPartnerBuild() {
return false;
}
// Method to determine if we should be using geo-specific defaults
function geoSpecificDefaultsEnabled() {
let geoSpecificDefaults = false;
try {
geoSpecificDefaults = Services.prefs.getBoolPref("browser.search.geoSpecificDefaults");
} catch (e) {}
return geoSpecificDefaults;
}
// Some notes on countryCode and region prefs:
// * A "countryCode" pref is set via a geoip lookup. It always reflects the
// result of that geoip request.
// * A "region" pref, once set, is the region actually used for search. In
// most cases it will be identical to the countryCode pref.
// * The value of "region" and "countryCode" will only not agree in one edge
// case - 34/35 users who have previously been configured to use US defaults
// based purely on a timezone check will have "region" forced to US,
// regardless of what countryCode geoip returns.
// * We may want to know if we are in the US before we have *either*
// countryCode or region - in which case we fallback to a timezone check,
// but we don't persist that value anywhere in the expectation we will
// eventually get a countryCode/region.
// A method that "migrates" prefs if necessary.
function migrateRegionPrefs() {
// If we already have a "region" pref there's nothing to do.
if (Services.prefs.prefHasUserValue("browser.search.region")) {
return;
}
// If we have 'isUS' but no 'countryCode' then we are almost certainly
// a profile from Fx 34/35 that set 'isUS' based purely on a timezone
// check. If this said they were US, we force region to be US.
// (But if isUS was false, we leave region alone - we will do a geoip request
// and set the region accordingly)
try {
if (Services.prefs.getBoolPref("browser.search.isUS") &&
!Services.prefs.prefHasUserValue("browser.search.countryCode")) {
Services.prefs.setCharPref("browser.search.region", "US");
}
} catch (ex) {
// no isUS pref, nothing to do.
}
// If we have a countryCode pref but no region pref, just force region
// to be the countryCode.
try {
let countryCode = Services.prefs.getCharPref("browser.search.countryCode");
if (!Services.prefs.prefHasUserValue("browser.search.region")) {
Services.prefs.setCharPref("browser.search.region", countryCode);
}
} catch (ex) {
// no countryCode pref, nothing to do.
}
}
// A method to determine if we are in the United States (US) for the search
// service.
// It uses a browser.search.region pref (which typically comes from a geoip
// request) or if that doesn't exist, falls back to a hacky timezone check.
function getIsUS() {
// Regardless of the region or countryCode, non en-US builds are not
// considered to be in the US from the POV of the search service.
if (getLocale() != "en-US") {
return false;
}
// If we've got a region pref, trust it.
try {
return Services.prefs.getCharPref("browser.search.region") == "US";
} catch (e) {}
// So we are en-US but have no region pref - fallback to hacky timezone check.
let isNA = isUSTimezone();
LOG("getIsUS() fell back to a timezone check with the result=" + isNA);
return isNA;
}
// Helper method to modify preference keys with geo-specific modifiers, if needed.
function getGeoSpecificPrefName(basepref) {
if (!geoSpecificDefaultsEnabled() || isPartnerBuild())
return basepref;
if (getIsUS())
return basepref + ".US";
return basepref;
}
// A method that tries to determine if this user is in a US geography.
function isUSTimezone() {
// Timezone assumptions! We assume that if the system clock's timezone is
// between Newfoundland and Hawaii, that the user is in North America.
// This includes all of South America as well, but we have relatively few
// en-US users there, so that's OK.
// 150 minutes = 2.5 hours (UTC-2.5), which is
// Newfoundland Daylight Time (http://www.timeanddate.com/time/zones/ndt)
// 600 minutes = 10 hours (UTC-10), which is
// Hawaii-Aleutian Standard Time (http://www.timeanddate.com/time/zones/hast)
let UTCOffset = (new Date()).getTimezoneOffset();
return UTCOffset >= 150 && UTCOffset <= 600;
}
// A less hacky method that tries to determine our country-code via an XHR
// geoip lookup.
// If this succeeds and we are using an en-US locale, we set the pref used by
// the hacky method above, so isUS() can avoid the hacky timezone method.
// If it fails we don't touch that pref so isUS() does its normal thing.
var ensureKnownCountryCode = Task.async(function* (ss) {
// If we have a country-code already stored in our prefs we trust it.
let countryCode;
try {
countryCode = Services.prefs.getCharPref("browser.search.countryCode");
} catch (e) {}
if (!countryCode) {
// We don't have it cached, so fetch it. fetchCountryCode() will call
// storeCountryCode if it gets a result (even if that happens after the
// promise resolves) and fetchRegionDefault.
yield fetchCountryCode(ss);
} else {
// if nothing to do, return early.
if (!geoSpecificDefaultsEnabled())
return;
let expir = ss.getGlobalAttr("searchDefaultExpir") || 0;
if (expir > Date.now()) {
// The territory default we have already fetched hasn't expired yet.
// If we have a default engine or a list of visible default engines
// saved, the hashes should be valid, verify them now so that we can
// refetch if they have been tampered with.
let defaultEngine = ss.getVerifiedGlobalAttr("searchDefault");
let visibleDefaultEngines = ss.getVerifiedGlobalAttr("visibleDefaultEngines");
if ((defaultEngine || defaultEngine === undefined) &&
(visibleDefaultEngines || visibleDefaultEngines === undefined)) {
// No geo defaults, or valid hashes; nothing to do.
return;
}
}
yield new Promise(resolve => {
let timeoutMS = Services.prefs.getIntPref("browser.search.geoip.timeout");
let timerId = setTimeout(() => {
timerId = null;
resolve();
}, timeoutMS);
let callback = () => {
clearTimeout(timerId);
resolve();
};
fetchRegionDefault(ss).then(callback).catch(err => {
Components.utils.reportError(err);
callback();
});
});
}
// If gInitialized is true then the search service was forced to perform
// a sync initialization during our XHRs - capture this via telemetry.
Services.telemetry.getHistogramById("SEARCH_SERVICE_COUNTRY_FETCH_CAUSED_SYNC_INIT").add(gInitialized);
});
// Store the result of the geoip request as well as any other values and
// telemetry which depend on it.
function storeCountryCode(cc) {
// Set the country-code itself.
Services.prefs.setCharPref("browser.search.countryCode", cc);
// And set the region pref if we don't already have a value.
if (!Services.prefs.prefHasUserValue("browser.search.region")) {
Services.prefs.setCharPref("browser.search.region", cc);
}
// and telemetry...
let isTimezoneUS = isUSTimezone();
if (cc == "US" && !isTimezoneUS) {
Services.telemetry.getHistogramById("SEARCH_SERVICE_US_COUNTRY_MISMATCHED_TIMEZONE").add(1);
}
if (cc != "US" && isTimezoneUS) {
Services.telemetry.getHistogramById("SEARCH_SERVICE_US_TIMEZONE_MISMATCHED_COUNTRY").add(1);
}
// telemetry to compare our geoip response with platform-specific country data.
// On Mac and Windows, we can get a country code via sysinfo
let platformCC = Services.sysinfo.get("countryCode");
if (platformCC) {
let probeUSMismatched, probeNonUSMismatched;
switch (Services.appinfo.OS) {
case "Darwin":
probeUSMismatched = "SEARCH_SERVICE_US_COUNTRY_MISMATCHED_PLATFORM_OSX";
probeNonUSMismatched = "SEARCH_SERVICE_NONUS_COUNTRY_MISMATCHED_PLATFORM_OSX";
break;
case "WINNT":
probeUSMismatched = "SEARCH_SERVICE_US_COUNTRY_MISMATCHED_PLATFORM_WIN";
probeNonUSMismatched = "SEARCH_SERVICE_NONUS_COUNTRY_MISMATCHED_PLATFORM_WIN";
break;
default:
Cu.reportError("Platform " + Services.appinfo.OS + " has system country code but no search service telemetry probes");
break;
}
if (probeUSMismatched && probeNonUSMismatched) {
if (cc == "US" || platformCC == "US") {
// one of the 2 said US, so record if they are the same.
Services.telemetry.getHistogramById(probeUSMismatched).add(cc != platformCC);
} else {
// different country - record if they are the same
Services.telemetry.getHistogramById(probeNonUSMismatched).add(cc != platformCC);
}
}
}
}
// Get the country we are in via a XHR geoip request.
function fetchCountryCode(ss) {
// values for the SEARCH_SERVICE_COUNTRY_FETCH_RESULT 'enum' telemetry probe.
const TELEMETRY_RESULT_ENUM = {
SUCCESS: 0,
SUCCESS_WITHOUT_DATA: 1,
XHRTIMEOUT: 2,
ERROR: 3,
// Note that we expect to add finer-grained error types here later (eg,
// dns error, network error, ssl error, etc) with .ERROR remaining as the
// generic catch-all that doesn't fit into other categories.
};
let endpoint = Services.urlFormatter.formatURLPref("browser.search.geoip.url");
LOG("_fetchCountryCode starting with endpoint " + endpoint);
// As an escape hatch, no endpoint means no geoip.
if (!endpoint) {
return Promise.resolve();
}
let startTime = Date.now();
return new Promise(resolve => {
// Instead of using a timeout on the xhr object itself, we simulate one
// using a timer and let the XHR request complete. This allows us to
// capture reliable telemetry on what timeout value should actually be
// used to ensure most users don't see one while not making it so large
// that many users end up doing a sync init of the search service and thus
// would see the jank that implies.
// (Note we do actually use a timeout on the XHR, but that's set to be a
// large value just incase the request never completes - we don't want the
// XHR object to live forever)
let timeoutMS = Services.prefs.getIntPref("browser.search.geoip.timeout");
let geoipTimeoutPossible = true;
let timerId = setTimeout(() => {
LOG("_fetchCountryCode: timeout fetching country information");
if (geoipTimeoutPossible)
Services.telemetry.getHistogramById("SEARCH_SERVICE_COUNTRY_TIMEOUT").add(1);
timerId = null;
resolve();
}, timeoutMS);
let resolveAndReportSuccess = (result, reason) => {
// Even if we timed out, we want to save the country code and everything
// related so next startup sees the value and doesn't retry this dance.
if (result) {
storeCountryCode(result);
}
Services.telemetry.getHistogramById("SEARCH_SERVICE_COUNTRY_FETCH_RESULT").add(reason);
// This notification is just for tests...
Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "geoip-lookup-xhr-complete");
if (timerId) {
Services.telemetry.getHistogramById("SEARCH_SERVICE_COUNTRY_TIMEOUT").add(0);
geoipTimeoutPossible = false;
}
let callback = () => {
// If we've already timed out then we've already resolved the promise,
// so there's nothing else to do.
if (timerId == null) {
return;
}
clearTimeout(timerId);
resolve();
};
if (result && geoSpecificDefaultsEnabled()) {
fetchRegionDefault(ss).then(callback).catch(err => {
Components.utils.reportError(err);
callback();
});
} else {
callback();
}
};
let request = new XMLHttpRequest();
// This notification is just for tests...
Services.obs.notifyObservers(request, SEARCH_SERVICE_TOPIC, "geoip-lookup-xhr-starting");
request.timeout = 100000; // 100 seconds as the last-chance fallback
request.onload = function(event) {
let took = Date.now() - startTime;
let cc = event.target.response && event.target.response.country_code;
LOG("_fetchCountryCode got success response in " + took + "ms: " + cc);
Services.telemetry.getHistogramById("SEARCH_SERVICE_COUNTRY_FETCH_TIME_MS").add(took);
let reason = cc ? TELEMETRY_RESULT_ENUM.SUCCESS : TELEMETRY_RESULT_ENUM.SUCCESS_WITHOUT_DATA;
resolveAndReportSuccess(cc, reason);
};
request.ontimeout = function(event) {
LOG("_fetchCountryCode: XHR finally timed-out fetching country information");
resolveAndReportSuccess(null, TELEMETRY_RESULT_ENUM.XHRTIMEOUT);
};
request.onerror = function(event) {
LOG("_fetchCountryCode: failed to retrieve country information");
resolveAndReportSuccess(null, TELEMETRY_RESULT_ENUM.ERROR);
};
request.open("POST", endpoint, true);
request.setRequestHeader("Content-Type", "application/json");
request.responseType = "json";
request.send("{}");
});
}
// This will make an HTTP request to a Mozilla server that will return
// JSON data telling us what engine should be set as the default for
// the current region, and how soon we should check again.
//
// The optional cohort value returned by the server is to be kept locally
// and sent to the server the next time we ping it. It lets the server
// identify profiles that have been part of a specific experiment.
//
// This promise may take up to 100s to resolve, it's the caller's
// responsibility to ensure with a timer that we are not going to
// block the async init for too long.
var fetchRegionDefault = (ss) => new Promise(resolve => {
let urlTemplate = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF)
.getCharPref("geoSpecificDefaults.url");
let endpoint = Services.urlFormatter.formatURL(urlTemplate);
// As an escape hatch, no endpoint means no region specific defaults.
if (!endpoint) {
resolve();
return;
}
// Append the optional cohort value.
const cohortPref = "browser.search.cohort";
let cohort;
try {
cohort = Services.prefs.getCharPref(cohortPref);
} catch (e) {}
if (cohort)
endpoint += "/" + cohort;
LOG("fetchRegionDefault starting with endpoint " + endpoint);
let startTime = Date.now();
let request = new XMLHttpRequest();
request.timeout = 100000; // 100 seconds as the last-chance fallback
request.onload = function(event) {
let took = Date.now() - startTime;
let status = event.target.status;
if (status != 200) {
LOG("fetchRegionDefault failed with HTTP code " + status);
let retryAfter = request.getResponseHeader("retry-after");
if (retryAfter) {
ss.setGlobalAttr("searchDefaultExpir", Date.now() + retryAfter * 1000);
}
resolve();
return;
}
let response = event.target.response || {};
LOG("received " + response.toSource());
if (response.cohort) {
Services.prefs.setCharPref(cohortPref, response.cohort);
} else {
Services.prefs.clearUserPref(cohortPref);
}
if (response.settings && response.settings.searchDefault) {
let defaultEngine = response.settings.searchDefault;
ss.setVerifiedGlobalAttr("searchDefault", defaultEngine);
LOG("fetchRegionDefault saved searchDefault: " + defaultEngine);
}
if (response.settings && response.settings.visibleDefaultEngines) {
let visibleDefaultEngines = response.settings.visibleDefaultEngines;
let string = visibleDefaultEngines.join(",");
ss.setVerifiedGlobalAttr("visibleDefaultEngines", string);
LOG("fetchRegionDefault saved visibleDefaultEngines: " + string);
}
let interval = response.interval || SEARCH_GEO_DEFAULT_UPDATE_INTERVAL;
let milliseconds = interval * 1000; // |interval| is in seconds.
ss.setGlobalAttr("searchDefaultExpir", Date.now() + milliseconds);
LOG("fetchRegionDefault got success response in " + took + "ms");
resolve();
};
request.ontimeout = function(event) {
LOG("fetchRegionDefault: XHR finally timed-out");
resolve();
};
request.onerror = function(event) {
LOG("fetchRegionDefault: failed to retrieve territory default information");
resolve();
};
request.open("GET", endpoint, true);
request.setRequestHeader("Content-Type", "application/json");
request.responseType = "json";
request.send();
});
function getVerificationHash(aName) {
let disclaimer = "By modifying this file, I agree that I am doing so " +
"only within $appName itself, using official, user-driven search " +
@ -993,11 +586,8 @@ function QueryParameter(aName, aValue, aPurpose) {
function ParamSubstitution(aParamValue, aSearchTerms, aEngine) {
var value = aParamValue;
var distributionID = Services.appinfo.distributionID;
try {
distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID");
}
catch (ex) { }
var distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID",
Services.appinfo.distributionID || "");
var official = MOZ_OFFICIAL;
try {
if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official"))
@ -2700,7 +2290,6 @@ SearchService.prototype = {
_syncInit: function SRCH_SVC__syncInit() {
LOG("_syncInit start");
this._initStarted = true;
migrateRegionPrefs();
let cache = this._readCacheFile();
if (cache.metaData)
@ -2735,8 +2324,6 @@ SearchService.prototype = {
_asyncInit: Task.async(function* () {
LOG("_asyncInit start");
migrateRegionPrefs();
// See if we have a cache file so we don't have to parse a bunch of XML.
let cache = {};
// Not using checkForSyncCompletion here because we want to ensure we
@ -2747,14 +2334,6 @@ SearchService.prototype = {
if (!gInitialized && cache.metaData)
this._metaData = cache.metaData;
try {
yield checkForSyncCompletion(ensureKnownCountryCode(this));
} catch (ex) {
if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) {
throw ex;
}
LOG("_asyncInit: failure determining country code: " + ex);
}
try {
yield checkForSyncCompletion(this._asyncLoadEngines(cache));
} catch (ex) {
@ -2815,9 +2394,8 @@ SearchService.prototype = {
let defaultPrefB = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF);
let nsIPLS = Ci.nsIPrefLocalizedString;
let defPref = getGeoSpecificPrefName("defaultenginename");
try {
defaultEngine = defaultPrefB.getComplexValue(defPref, nsIPLS).data;
defaultEngine = defaultPrefB.getComplexValue("defaultenginename", nsIPLS).data;
} catch (ex) {
// If the default pref is invalid (e.g. an add-on set it to a bogus value)
// getEngineByName will just return null, which is the best we can do.
@ -3132,11 +2710,7 @@ SearchService.prototype = {
if (!gInitialized && cache.metaData)
this._metaData = cache.metaData;
yield ensureKnownCountryCode(this);
// Due to the HTTP requests done by ensureKnownCountryCode, it's possible that
// at this point a synchronous init has been forced by other code.
if (!gInitialized)
yield this._asyncLoadEngines(cache);
yield this._asyncLoadEngines(cache);
// Typically we'll re-init as a result of a pref observer,
// so signal to 'callers' that we're done.
@ -3662,14 +3236,7 @@ SearchService.prototype = {
// Fallback to building a list based on the regions in the JSON
if (!engineNames || !engineNames.length) {
let region;
if (Services.prefs.prefHasUserValue("browser.search.region")) {
region = Services.prefs.getCharPref("browser.search.region");
}
if (!region || !(region in searchSettings)) {
region = "default";
}
engineNames = searchSettings[region]["visibleDefaultEngines"];
engineNames = searchSettings["default"]["visibleDefaultEngines"];
}
for (let name of engineNames) {
@ -3812,10 +3379,8 @@ SearchService.prototype = {
}
catch (e) { }
let prefNameBase = getGeoSpecificPrefName(BROWSER_SEARCH_PREF + "order");
while (true) {
prefName = prefNameBase + "." + (++i);
engineName = getLocalizedPref(prefName);
engineName = getLocalizedPref(BROWSER_SEARCH_PREF + "order." + (++i));
if (!engineName)
break;
@ -3949,10 +3514,8 @@ SearchService.prototype = {
}
// Now look through the "browser.search.order" branch.
let prefNameBase = getGeoSpecificPrefName(BROWSER_SEARCH_PREF + "order");
for (var j = 1; ; j++) {
let prefName = prefNameBase + "." + j;
engineName = getLocalizedPref(prefName);
engineName = getLocalizedPref(BROWSER_SEARCH_PREF + "order." + j);
if (!engineName)
break;
@ -4306,11 +3869,9 @@ SearchService.prototype = {
} catch (e) {}
}
let prefNameBase = getGeoSpecificPrefName(BROWSER_SEARCH_PREF + "order");
let i = 0;
while (!sendSubmissionURL) {
let prefName = prefNameBase + "." + (++i);
let engineName = getLocalizedPref(prefName);
let engineName = getLocalizedPref(BROWSER_SEARCH_PREF + "order." + (++i));
if (!engineName)
break;
if (result.name == engineName) {
@ -4658,10 +4219,6 @@ SearchService.prototype = {
Services.obs.addObserver(this, SEARCH_ENGINE_TOPIC, false);
Services.obs.addObserver(this, QUIT_APPLICATION_TOPIC, false);
#ifdef MOZ_FENNEC
Services.prefs.addObserver(LOCALE_PREF, this, false);
#endif
// The current stage of shutdown. Used to help analyze crash
// signatures in case of shutdown timeout.
let shutdownState = {
@ -4702,10 +4259,6 @@ SearchService.prototype = {
_removeObservers: function SRCH_SVC_removeObservers() {
Services.obs.removeObserver(this, SEARCH_ENGINE_TOPIC);
Services.obs.removeObserver(this, QUIT_APPLICATION_TOPIC);
#ifdef MOZ_FENNEC
Services.prefs.removeObserver(LOCALE_PREF, this);
#endif
},
QueryInterface: XPCOMUtils.generateQI([

View file

@ -254,13 +254,7 @@ var RemoteTabViewer = {
_refetchTabs: function(force) {
if (!force) {
// Don't bother refetching tabs if we already did so recently
let lastFetch = 0;
try {
lastFetch = Services.prefs.getIntPref("services.sync.lastTabFetch");
}
catch (e) {
/* Just use the default value of 0 */
}
lastFetch = Services.prefs.getIntPref("services.sync.lastTabFetch", 0);
let now = Math.floor(Date.now() / 1000);
if (now - lastFetch < 30) {

View file

@ -189,11 +189,7 @@ var DirectoryLinksProvider = {
* @return the selected locale or "en-US" if none is selected
*/
get locale() {
let matchOS;
try {
matchOS = Services.prefs.getBoolPref(PREF_MATCH_OS_LOCALE);
}
catch (e) {}
let matchOS = Services.prefs.getBoolPref(PREF_MATCH_OS_LOCALE, false);
if (matchOS) {
return Services.locale.getLocaleComponentForUserAgent();

View file

@ -437,26 +437,12 @@ GeolocationPermissionPrompt.prototype = {
},
get promptActions() {
// We collect Telemetry data on Geolocation prompts and how users
// respond to them. The probe keys are a bit verbose, so let's alias them.
const SHARE_LOCATION =
Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_SHARE_LOCATION;
const ALWAYS_SHARE =
Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_ALWAYS_SHARE;
const NEVER_SHARE =
Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_NEVER_SHARE;
let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
let actions = [{
label: gBrowserBundle.GetStringFromName("geolocation.shareLocation"),
accessKey:
gBrowserBundle.GetStringFromName("geolocation.shareLocation.accesskey"),
action: null,
expireType: null,
callback: function() {
secHistogram.add(SHARE_LOCATION);
},
}];
if (!this.principal.URI.schemeIs("file")) {
@ -467,9 +453,6 @@ GeolocationPermissionPrompt.prototype = {
gBrowserBundle.GetStringFromName("geolocation.alwaysShareLocation.accesskey"),
action: Ci.nsIPermissionManager.ALLOW_ACTION,
expireType: null,
callback: function() {
secHistogram.add(ALWAYS_SHARE);
},
});
// Never share location action.
@ -479,9 +462,6 @@ GeolocationPermissionPrompt.prototype = {
gBrowserBundle.GetStringFromName("geolocation.neverShareLocation.accesskey"),
action: Ci.nsIPermissionManager.DENY_ACTION,
expireType: null,
callback: function() {
secHistogram.add(NEVER_SHARE);
},
});
}
@ -489,9 +469,6 @@ GeolocationPermissionPrompt.prototype = {
},
onBeforeShow() {
let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
const SHOW_REQUEST = Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST;
secHistogram.add(SHOW_REQUEST);
},
};

View file

@ -83,10 +83,7 @@ var gSyncUI = {
_wasDelayed: false,
_needsSetup: function SUI__needsSetup() {
let firstSync = "";
try {
firstSync = Services.prefs.getCharPref("services.sync.firstSync");
} catch (e) { }
let firstSync = Services.prefs.getCharPref("services.sync.firstSync", "");
return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
firstSync == "notReady";
},
@ -285,11 +282,7 @@ var gSyncUI = {
if (!syncButton)
return;
let lastSync;
try {
lastSync = Services.prefs.getCharPref("services.sync.lastSync");
}
catch (e) { };
let lastSync = Services.prefs.getCharPref("services.sync.lastSync");
if (!lastSync || this._needsSetup()) {
syncButton.removeAttribute("tooltiptext");
return;

View file

@ -3637,11 +3637,7 @@
window.addEventListener("resize", this, false);
window.addEventListener("load", this, false);
try {
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled");
} catch (ex) {
this._tabAnimationLoggingEnabled = false;
}
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false);
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
]]>
</constructor>

View file

@ -28,10 +28,6 @@ pref("app.update.promptWaitTime", 172800);
// Add-on window fixes
pref("extensions.getMoreThemesURL", "https://addons.palemoon.org/themes/");
// Extensions Blocklist
pref("extensions.blocklist.url","http://blocklist.palemoon.org/%VERSION%/blocklist.xml");
pref("extensions.blocklist.itemURL", "http://blocklist.palemoon.org/info/?id=%blockID%");
pref("extensions.update.autoUpdateDefault", true); // Automatically update extensions by default
pref("extensions.getAddons.maxResults", 10);
pref("extensions.getAddons.cache.enabled", false);

View file

@ -38,13 +38,7 @@ DistributionCustomizer.prototype = {
},
get _locale() {
let locale;
try {
locale = this._prefs.getCharPref("general.useragent.locale");
}
catch (e) {
locale = "en-US";
}
let locale = this._prefs.getCharPref("general.useragent.locale", "en-US");
this.__defineGetter__("_locale", function() locale);
return this._locale;
},
@ -221,11 +215,7 @@ DistributionCustomizer.prototype = {
this._ini.getString("Global", "id") + ".bookmarksProcessed";
}
let bmProcessed = false;
try {
bmProcessed = this._prefs.getBoolPref(bmProcessedPref);
}
catch (e) {}
let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false);
if (!bmProcessed) {
if (sections["BookmarksMenu"])

View file

@ -18,12 +18,7 @@ function LOG(str) {
var prefB = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
var shouldLog = false;
try {
shouldLog = prefB.getBoolPref("feeds.log");
}
catch (ex) {
}
var shouldLog = prefB.getBoolPref("feeds.log", false);
if (shouldLog)
dump("*** Feeds: " + str + "\n");
@ -874,11 +869,7 @@ FeedWriter.prototype = {
Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
var handler = "bookmarks";
try {
handler = prefs.getCharPref(getPrefReaderForType(feedType));
}
catch (ex) { }
var handler = prefs.getCharPref(getPrefReaderForType(feedType), "bookmarks");
switch (handler) {
case "web": {
@ -1076,11 +1067,7 @@ FeedWriter.prototype = {
.addEventListener("command", this, false);
// first-run ui
var showFirstRunUI = true;
try {
showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI);
}
catch (ex) { }
var showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI, true);
if (showFirstRunUI) {
var textfeedinfo1, textfeedinfo2;
switch (feedType) {

View file

@ -436,13 +436,8 @@ WebContentConverterRegistrar.prototype = {
// check if it is in the black list
var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
var allowed;
try {
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol);
}
catch (e) {
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default");
}
var allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol,
pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"));
if (!allowed) {
// XXX this should be a "security exception" according to spec
throw("Not allowed to register a protocol handler for " + aProtocol);

View file

@ -100,20 +100,14 @@ const OVERRIDE_NEW_BUILD_ID = 3;
* OVERRIDE_NONE otherwise.
*/
function needHomepageOverride(prefb) {
var savedmstone = null;
try {
savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone");
} catch (e) {}
var savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone", "");
if (savedmstone == "ignore")
return OVERRIDE_NONE;
var mstone = Services.appinfo.platformVersion;
var savedBuildID = null;
try {
savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID");
} catch (e) {}
var savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID", "");
var buildID = Services.appinfo.platformBuildID;
@ -550,10 +544,7 @@ nsBrowserContentHandler.prototype = {
// URL if we do end up showing an overridePage. This makes it possible
// to have the overridePage's content vary depending on the version we're
// upgrading from.
let old_mstone = "unknown";
try {
old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone");
} catch (ex) {}
let old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "unknown");
let override = needHomepageOverride(prefb);
if (override != OVERRIDE_NONE) {
switch (override) {

View file

@ -990,14 +990,8 @@ BrowserGlue.prototype = {
// An import operation is about to run.
// Don't try to recreate smart bookmarks if autoExportHTML is true or
// smart bookmarks are disabled.
var autoExportHTML = false;
try {
autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML");
} catch(ex) {}
var smartBookmarksVersion = 0;
try {
smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion");
} catch(ex) {}
var autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false);
var smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0);
if (!autoExportHTML && smartBookmarksVersion != -1)
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
@ -1556,10 +1550,7 @@ BrowserGlue.prototype = {
const MAX_RESULTS = 10;
// Get current smart bookmarks version. If not set, create them.
let smartBookmarksCurrentVersion = 0;
try {
smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF);
} catch(ex) {}
let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0);
// If version is current or smart bookmarks are disabled, just bail out.
if (smartBookmarksCurrentVersion == -1 ||

View file

@ -1 +1 @@
28.5.0a1
28.5.0a2

View file

@ -127,7 +127,6 @@ MACH_MODULES = [
'tools/lint/mach_commands.py',
'tools/mach_commands.py',
'tools/power/mach_commands.py',
'mobile/android/mach_commands.py',
]
if os.path.exists('addon-sdk/mach_commands.py'):

View file

@ -195,12 +195,7 @@ DevTools.prototype = {
return tool;
}
let enabled;
try {
enabled = Services.prefs.getBoolPref(tool.visibilityswitch);
} catch (e) {
enabled = true;
}
let enabled = Services.prefs.getBoolPref(tool.visibilityswitch, true);
return enabled ? tool : null;
},

View file

@ -100,17 +100,12 @@ function openToolbox({ form, chrome, isTabActor }) {
};
TargetFactory.forRemoteTab(options).then(target => {
let frame = document.getElementById("toolbox-iframe");
let selectedTool = "jsdebugger";
try {
// Remember the last panel that was used inside of this profile.
selectedTool = Services.prefs.getCharPref("devtools.toolbox.selectedTool");
} catch(e) {}
try {
// But if we are testing, then it should always open the debugger panel.
selectedTool = Services.prefs.getCharPref("devtools.browsertoolbox.panel");
} catch(e) {}
// Remember the last panel that was used inside of this profile.
// But if we are testing, then it should always open the debugger panel.
let selectedTool =
Services.prefs.getCharPref("devtools.browsertoolbox.panel",
Services.prefs.getCharPref("devtools.toolbox.selectedTool",
"jsdebugger"));
let options = { customIframe: frame };
gDevTools.showToolbox(target,

View file

@ -1131,12 +1131,7 @@ Toolbox.prototype = {
setToolboxButtonsVisibility: function () {
this.toolboxButtons.forEach(buttonSpec => {
let { visibilityswitch, button, isTargetSupported } = buttonSpec;
let on = true;
try {
on = Services.prefs.getBoolPref(visibilityswitch);
} catch (ex) {
// Do nothing.
}
let on = Services.prefs.getBoolPref(visibilityswitch, true);
on = on && isTargetSupported(this.target);

View file

@ -73,11 +73,8 @@ function MarkupView(inspector, frame, controllerWindow) {
this._elt = this.doc.querySelector("#root");
this.htmlEditor = new HTMLEditor(this.doc);
try {
this.maxChildren = Services.prefs.getIntPref("devtools.markup.pagesize");
} catch (ex) {
this.maxChildren = DEFAULT_MAX_CHILDREN;
}
this.maxChildren = Services.prefs.getIntPref("devtools.markup.pagesize",
DEFAULT_MAX_CHILDREN);
this.collapseAttributes =
Services.prefs.getBoolPref(ATTR_COLLAPSE_ENABLED_PREF);

View file

@ -1067,6 +1067,7 @@ Scanner.prototype = {
// aToken.mIdent may be "url" at this point; clear that out
aToken.mIdent.length = 0;
let hasString = false;
let ch = this.Peek();
// Do we have a string?
if (ch == QUOTATION_MARK || ch == APOSTROPHE) {
@ -1075,6 +1076,7 @@ Scanner.prototype = {
aToken.mType = eCSSToken_Bad_URL;
return;
}
hasString = true;
} else {
// Otherwise, this is the start of a non-quoted url (which may be empty).
aToken.mSymbol = 0;
@ -1093,6 +1095,25 @@ Scanner.prototype = {
}
} else {
aToken.mType = eCSSToken_Bad_URL;
if (!hasString) {
// Consume until before the next right parenthesis, which follows
// how <bad-url-token> is consumed in CSS Syntax 3 spec.
// Note that, we only do this when "url(" is not followed by a
// string, because in the spec, "url(" followed by a string is
// handled as a url function rather than a <url-token>, so the
// rest of content before ")" should be consumed in balance,
// which will be done by the parser.
// The closing ")" is not consumed here. It is left to the parser
// so that the parser can handle both cases.
do {
if (IsVertSpace(ch)) {
this.AdvanceLine();
} else {
this.Advance();
}
ch = this.Peek();
} while (ch >= 0 && ch != RIGHT_PARENTHESIS);
}
}
},

View file

@ -5,15 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += [
'encoder'
'decoder',
'encoder',
]
# Save file size on Fennec until there are active plans to use the decoder there
if not CONFIG['MOZ_FENNEC']:
DIRS += [
'decoder'
]
DevToolsModules(
'index.js',
)

View file

@ -128,8 +128,7 @@ var LEX_TESTS = [
["url:http://example.com"]],
// In CSS Level 3, this is an ordinary URL, not a BAD_URL.
["url(http://example.com", ["url:http://example.com"]],
// See bug 1153981 to understand why this gets a SYMBOL token.
["url(http://example.com @", ["bad_url:http://example.com", "symbol:@"]],
["url(http://example.com @", ["bad_url:http://example.com"]],
["quo\\ting", ["ident:quoting"]],
["'bad string\n", ["bad_string:bad string", "whitespace"]],
["~=", ["includes"]],

View file

@ -18,19 +18,8 @@ var systemAppOrigin = (function () {
return systemOrigin;
})();
var threshold = 25;
try {
threshold = Services.prefs.getIntPref("ui.dragThresholdX");
} catch (e) {
// Fall back to default value
}
var delay = 500;
try {
delay = Services.prefs.getIntPref("ui.click_hold_context_menus.delay");
} catch (e) {
// Fall back to default value
}
var threshold = Services.prefs.getIntPref("ui.dragThresholdX", 25);
var delay = Services.prefs.getIntPref("ui.click_hold_context_menus.delay", 500);
function SimulatorCore(simulatorTarget) {
this.simulatorTarget = simulatorTarget;

View file

@ -410,17 +410,12 @@ EXTRA_COMPONENTS += [
'contentAreaDropListener.manifest',
'messageWakeupService.js',
'messageWakeupService.manifest',
'SiteSpecificUserAgent.js',
'SiteSpecificUserAgent.manifest',
'SlowScriptDebug.js',
'SlowScriptDebug.manifest',
]
# Firefox for Android provides an alternate version of this component
if not CONFIG['MOZ_FENNEC']:
EXTRA_COMPONENTS += [
'SiteSpecificUserAgent.js',
'SiteSpecificUserAgent.manifest',
]
EXTRA_JS_MODULES += [
'DOMRequestHelper.jsm',
'IndexedDBHelper.jsm',
@ -471,7 +466,7 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_FENNEC'] or CONFIG['MOZ_XULRUNNER']:
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_XULRUNNER']:
DEFINES['HAVE_SIDEBAR'] = True
if CONFIG['MOZ_X11']:

View file

@ -9335,7 +9335,7 @@ nsGlobalWindow::EnterModalState()
topWin->mSuspendedDoc = topDoc;
if (topDoc) {
topDoc->SuppressEventHandling(nsIDocument::eAnimationsOnly);
topDoc->SuppressEventHandling(nsIDocument::eEvents);
}
nsGlobalWindow* inner = topWin->GetCurrentInnerWindowInternal();
@ -9372,7 +9372,7 @@ nsGlobalWindow::LeaveModalState()
if (topWin->mSuspendedDoc) {
nsCOMPtr<nsIDocument> currentDoc = topWin->GetExtantDoc();
topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eAnimationsOnly,
topWin->mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents,
currentDoc == topWin->mSuspendedDoc);
topWin->mSuspendedDoc = nullptr;
}

View file

@ -139,7 +139,7 @@ FINAL_LIBRARY = 'xul'
SPHINX_TREES['webidl'] = 'docs'
SPHINX_PYTHON_PACKAGE_DIRS += ['mozwebidlcodegen']
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_FENNEC'] or CONFIG['MOZ_XULRUNNER']:
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_XULRUNNER']:
# This is needed for Window.webidl
DEFINES['HAVE_SIDEBAR'] = True

View file

@ -1010,11 +1010,7 @@ BrowserElementChild.prototype = {
self._takeScreenshot(maxWidth, maxHeight, mimeType, domRequestID);
};
let maxDelayMS = 2000;
try {
maxDelayMS = Services.prefs.getIntPref('dom.browserElement.maxScreenshotDelayMS');
}
catch(e) {}
let maxDelayMS = Services.prefs.getIntPref('dom.browserElement.maxScreenshotDelayMS', 2000);
// Try to wait for the event loop to go idle before we take the screenshot,
// but once we've waited maxDelayMS milliseconds, go ahead and take it
@ -1720,10 +1716,7 @@ BrowserElementChild.prototype = {
// certerror? If yes, maybe we should add a property to the
// event to to indicate whether there is a custom page. That would
// let the embedder have more control over the desired behavior.
let errorPage = null;
try {
errorPage = Services.prefs.getCharPref(CERTIFICATE_ERROR_PAGE_PREF);
} catch (e) {}
let errorPage = Services.prefs.getCharPref(CERTIFICATE_ERROR_PAGE_PREF, "");
if (errorPage == 'certerror') {
sendAsyncMsg('error', { type: 'certerror' });

View file

@ -31,14 +31,8 @@
Cu.import("resource://gre/modules/Services.jsm");
for (var stage of [ "install", "startup", "shutdown", "uninstall" ]) {
for (var symbol of [ "IDBKeyRange", "indexedDB" ]) {
let pref;
try {
pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
"." + symbol);
}
catch(ex) {
pref = false;
}
let pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
"." + symbol, false);
ok(pref, "Symbol '" + symbol + "' present during '" + stage + "'");
}
}

View file

@ -109,13 +109,7 @@ PresentationTransportBuilder.prototype = {
// TODO bug 1228235 we should have a way to let device providers customize
// the time-out duration.
let timeout;
try {
timeout = Services.prefs.getIntPref("presentation.receiver.loading.timeout");
} catch (e) {
// This happens if the pref doesn't exist, so we have a default value.
timeout = 10000;
}
let timeout = Services.prefs.getIntPref("presentation.receiver.loading.timeout", 10000);
// The timer is to check if the negotiation finishes on time.
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);

View file

@ -1,275 +0,0 @@
/* jshint moz: true, esnext: true */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
const {PushDB} = Cu.import("resource://gre/modules/PushDB.jsm");
const {PushRecord} = Cu.import("resource://gre/modules/PushRecord.jsm");
const {PushCrypto} = Cu.import("resource://gre/modules/PushCrypto.jsm");
Cu.import("resource://gre/modules/Messaging.jsm"); /*global: Messaging */
Cu.import("resource://gre/modules/Services.jsm"); /*global: Services */
Cu.import("resource://gre/modules/Preferences.jsm"); /*global: Preferences */
Cu.import("resource://gre/modules/Promise.jsm"); /*global: Promise */
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); /*global: XPCOMUtils */
const Log = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.bind("Push");
this.EXPORTED_SYMBOLS = ["PushServiceAndroidGCM"];
XPCOMUtils.defineLazyGetter(this, "console", () => {
let {ConsoleAPI} = Cu.import("resource://gre/modules/Console.jsm", {});
return new ConsoleAPI({
dump: Log.i,
maxLogLevelPref: "dom.push.loglevel",
prefix: "PushServiceAndroidGCM",
});
});
const kPUSHANDROIDGCMDB_DB_NAME = "pushAndroidGCM";
const kPUSHANDROIDGCMDB_DB_VERSION = 5; // Change this if the IndexedDB format changes
const kPUSHANDROIDGCMDB_STORE_NAME = "pushAndroidGCM";
const FXA_PUSH_SCOPE = "chrome://fxa-push";
const prefs = new Preferences("dom.push.");
/**
* The implementation of WebPush push backed by Android's GCM
* delivery.
*/
this.PushServiceAndroidGCM = {
_mainPushService: null,
_serverURI: null,
newPushDB: function() {
return new PushDB(kPUSHANDROIDGCMDB_DB_NAME,
kPUSHANDROIDGCMDB_DB_VERSION,
kPUSHANDROIDGCMDB_STORE_NAME,
"channelID",
PushRecordAndroidGCM);
},
validServerURI: function(serverURI) {
if (!serverURI) {
return false;
}
if (serverURI.scheme == "https") {
return true;
}
if (serverURI.scheme == "http") {
// Allow insecure server URLs for development and testing.
return !!prefs.get("testing.allowInsecureServerURL");
}
console.info("Unsupported Android GCM dom.push.serverURL scheme", serverURI.scheme);
return false;
},
observe: function(subject, topic, data) {
switch (topic) {
case "nsPref:changed":
if (data == "dom.push.debug") {
// Reconfigure.
let debug = !!prefs.get("debug");
console.info("Debug parameter changed; updating configuration with new debug", debug);
this._configure(this._serverURI, debug);
}
break;
case "PushServiceAndroidGCM:ReceivedPushMessage":
this._onPushMessageReceived(data);
break;
default:
break;
}
},
_onPushMessageReceived(data) {
// TODO: Use Messaging.jsm for this.
if (this._mainPushService == null) {
// Shouldn't ever happen, but let's be careful.
console.error("No main PushService! Dropping message.");
return;
}
if (!data) {
console.error("No data from Java! Dropping message.");
return;
}
data = JSON.parse(data);
console.debug("ReceivedPushMessage with data", data);
let { headers, message } = this._messageAndHeaders(data);
console.debug("Delivering message to main PushService:", message, headers);
this._mainPushService.receivedPushMessage(
data.channelID, "", headers, message, (record) => {
// Always update the stored record.
return record;
});
},
_messageAndHeaders(data) {
// Default is no data (and no encryption).
let message = null;
let headers = null;
if (data.message && data.enc && (data.enckey || data.cryptokey)) {
headers = {
encryption_key: data.enckey,
crypto_key: data.cryptokey,
encryption: data.enc,
encoding: data.con,
};
// Ciphertext is (urlsafe) Base 64 encoded.
message = ChromeUtils.base64URLDecode(data.message, {
// The Push server may append padding.
padding: "ignore",
});
}
return { headers, message };
},
_configure: function(serverURL, debug) {
return Messaging.sendRequestForResult({
type: "PushServiceAndroidGCM:Configure",
endpoint: serverURL.spec,
debug: debug,
});
},
init: function(options, mainPushService, serverURL) {
console.debug("init()");
this._mainPushService = mainPushService;
this._serverURI = serverURL;
prefs.observe("debug", this);
Services.obs.addObserver(this, "PushServiceAndroidGCM:ReceivedPushMessage", false);
return this._configure(serverURL, !!prefs.get("debug")).then(() => {
Messaging.sendRequestForResult({
type: "PushServiceAndroidGCM:Initialized"
});
});
},
uninit: function() {
console.debug("uninit()");
Messaging.sendRequestForResult({
type: "PushServiceAndroidGCM:Uninitialized"
});
this._mainPushService = null;
Services.obs.removeObserver(this, "PushServiceAndroidGCM:ReceivedPushMessage");
prefs.ignore("debug", this);
},
onAlarmFired: function() {
// No action required.
},
connect: function(records) {
console.debug("connect:", records);
// It's possible for the registration or subscriptions backing the
// PushService to not be registered with the underlying AndroidPushService.
// Expire those that are unrecognized.
return Messaging.sendRequestForResult({
type: "PushServiceAndroidGCM:DumpSubscriptions",
})
.then(subscriptions => {
console.debug("connect:", subscriptions);
// subscriptions maps chid => subscription data.
return Promise.all(records.map(record => {
if (subscriptions.hasOwnProperty(record.keyID)) {
console.debug("connect:", "hasOwnProperty", record.keyID);
return Promise.resolve();
}
console.debug("connect:", "!hasOwnProperty", record.keyID);
// Subscription is known to PushService.jsm but not to AndroidPushService. Drop it.
return this._mainPushService.dropRegistrationAndNotifyApp(record.keyID)
.catch(error => {
console.error("connect: Error dropping registration", record.keyID, error);
});
}));
});
},
isConnected: function() {
return this._mainPushService != null;
},
disconnect: function() {
console.debug("disconnect");
},
register: function(record) {
console.debug("register:", record);
let ctime = Date.now();
let appServerKey = record.appServerKey ?
ChromeUtils.base64URLEncode(record.appServerKey, {
// The Push server requires padding.
pad: true,
}) : null;
let message = {
type: "PushServiceAndroidGCM:SubscribeChannel",
appServerKey: appServerKey,
}
if (record.scope == FXA_PUSH_SCOPE) {
message.service = "fxa";
}
// Caller handles errors.
return Messaging.sendRequestForResult(message)
.then(data => {
console.debug("Got data:", data);
return PushCrypto.generateKeys()
.then(exportedKeys =>
new PushRecordAndroidGCM({
// Straight from autopush.
channelID: data.channelID,
pushEndpoint: data.endpoint,
// Common to all PushRecord implementations.
scope: record.scope,
originAttributes: record.originAttributes,
ctime: ctime,
systemRecord: record.systemRecord,
// Cryptography!
p256dhPublicKey: exportedKeys[0],
p256dhPrivateKey: exportedKeys[1],
authenticationSecret: PushCrypto.generateAuthenticationSecret(),
appServerKey: record.appServerKey,
})
);
});
},
unregister: function(record) {
console.debug("unregister: ", record);
return Messaging.sendRequestForResult({
type: "PushServiceAndroidGCM:UnsubscribeChannel",
channelID: record.keyID,
});
},
reportDeliveryError: function(messageID, reason) {
console.warn("reportDeliveryError: Ignoring message delivery error",
messageID, reason);
},
};
function PushRecordAndroidGCM(record) {
PushRecord.call(this, record);
this.channelID = record.channelID;
}
PushRecordAndroidGCM.prototype = Object.create(PushRecord.prototype, {
keyID: {
get() {
return this.channelID;
},
},
});

View file

@ -14,20 +14,10 @@ EXTRA_JS_MODULES += [
'PushDB.jsm',
'PushRecord.jsm',
'PushService.jsm',
'PushServiceHttp2.jsm',
'PushServiceWebSocket.jsm',
]
if not CONFIG['MOZ_FENNEC']:
# Everything but Fennec.
EXTRA_JS_MODULES += [
'PushServiceHttp2.jsm',
'PushServiceWebSocket.jsm',
]
else:
# Fennec only.
EXTRA_JS_MODULES += [
'PushServiceAndroidGCM.jsm',
]
MOCHITEST_MANIFESTS += [
'test/mochitest.ini',
]

View file

@ -14,13 +14,7 @@ const Ci = Components.interfaces;
const CONTENT_PAGE = "http://mochi.test:8888/chrome/dom/tests/mochitest/localstorage/page_blank.html";
const slavePath = "/chrome/dom/tests/mochitest/localstorage/";
var currentTest = 1;
var quota;
try {
quota = Services.prefs.getIntPref("dom.storage.default_quota");
} catch (ex) {
quota = 5 * 1024;
}
var quota = Services.prefs.getIntPref("dom.storage.default_quota", 5 * 1024);
Services.prefs.setIntPref("browser.startup.page", 0);
Services.prefs.setIntPref("dom.storage.default_quota", 1);

View file

@ -752,7 +752,7 @@ if CONFIG['MOZ_BUILD_APP'] in ['xulrunner'] or CONFIG['MOZ_PHOENIX'] or CONFIG['
'BrowserFeedWriter.webidl',
]
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_FENNEC'] or CONFIG['MOZ_XULRUNNER']:
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_XULRUNNER']:
WEBIDL_FILES += [
'External.webidl',
]

View file

@ -2312,7 +2312,6 @@ Parser<FullParseHandler>::standaloneFunction(HandleFunction fun,
if (!tokenStream.getToken(&tt))
return null();
if (asyncKind == AsyncFunction) {
MOZ_ASSERT(tt == TOK_ASYNC);
if (!tokenStream.getToken(&tt))
return null();
}

View file

@ -8192,6 +8192,9 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent,
}
}
}
if (aEvent->mMessage == eKeyDown) {
mIsLastKeyDownCanceled = aEvent->mFlags.mDefaultPrevented;
}
break;
}
case eMouseUp:
@ -8981,6 +8984,9 @@ PresShell::FireOrClearDelayedEvents(bool aFireEvents)
!doc->EventHandlingSuppressed()) {
nsAutoPtr<DelayedEvent> ev(mDelayedEvents[0].forget());
mDelayedEvents.RemoveElementAt(0);
if (ev->IsKeyPressEvent() && mIsLastKeyDownCanceled) {
continue;
}
ev->Dispatch();
}
if (!doc->EventHandlingSuppressed()) {
@ -9775,6 +9781,12 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) :
mEvent = keyEvent;
}
bool
PresShell::DelayedKeyEvent::IsKeyPressEvent()
{
return mEvent->mMessage == eKeyPress;
}
// Start of DEBUG only code
#ifdef DEBUG

View file

@ -617,6 +617,7 @@ protected:
public:
virtual ~DelayedEvent() { }
virtual void Dispatch() { }
virtual bool IsKeyPressEvent() { return false; }
};
class DelayedInputEvent : public DelayedEvent
@ -641,6 +642,7 @@ protected:
{
public:
explicit DelayedKeyEvent(mozilla::WidgetKeyboardEvent* aEvent);
virtual bool IsKeyPressEvent() override;
};
// Check if aEvent is a mouse event and record the mouse location for later
@ -951,6 +953,8 @@ protected:
// Whether the widget has received a paint message yet.
bool mHasReceivedPaintMessage : 1;
bool mIsLastKeyDownCanceled : 1;
static bool sDisableNonTestMouseEvents;
};

View file

@ -22,17 +22,16 @@
#two { background-color: green; }
</style>
<style type="text/css">
/* not a URI token; the unterminated string ends at end of line, so
the brace never matches */
#three { background-color: green; }
/* not a URI token; bad-url token is consumed until the first closing ) */
#foo { background: url(foo"bar) }
#three { background-color: red; }
#three { background-color: green; }
</style>
<style type="text/css">
/* not a URI token; the unterminated string ends at end of line */
/* not a URI token; bad-url token is consumed until the first closing ) */
#four { background-color: green; }
#foo { background: url(foo"bar) }
) }
#four { background-color: green; }
#four { background-color: red; }
</style>
<style type="text/css">
/* not a URI token; the unterminated string ends at end of line, so
@ -68,18 +67,19 @@
#eleven { background: url([) green; }
</style>
<style type="text/css">
/* not a URI token; brace matching should work only after invalid URI token */
#twelve { background: url(}{""{)}); background-color: green; }
/* not a URI token; bad-url token is consumed until the first closing )
so the brace immediately after it closes the declaration block */
#twelve { background-color: green; }
#twelve { background: url(}{""{)}); background-color: red; }
</style>
<style type="text/css">
/* invalid URI token absorbs the [ */
#thirteen { background: url([""); background-color: green; }
</style>
<style type="text/css">
/* not a URI token; the opening ( is never matched */
#fourteen { background-color: green; }
/* not a URI token; bad-url token is consumed until the first closing ) */
#foo { background: url(() }
#fourteen { background-color: red; }
#fourteen { background-color: green; }
</style>
<!-- The next three tests test that invalid URI tokens absorb [ and { -->
<style type="text/css">

View file

@ -1164,6 +1164,7 @@ nsCSSScanner::NextURL(nsCSSToken& aToken)
// aToken.mIdent may be "url" at this point; clear that out
aToken.mIdent.Truncate();
bool hasString = false;
int32_t ch = Peek();
// Do we have a string?
if (ch == '"' || ch == '\'') {
@ -1173,7 +1174,7 @@ nsCSSScanner::NextURL(nsCSSToken& aToken)
return;
}
MOZ_ASSERT(aToken.mType == eCSSToken_String, "unexpected token type");
hasString = true;
} else {
// Otherwise, this is the start of a non-quoted url (which may be empty).
aToken.mSymbol = char16_t(0);
@ -1193,6 +1194,25 @@ nsCSSScanner::NextURL(nsCSSToken& aToken)
} else {
mSeenBadToken = true;
aToken.mType = eCSSToken_Bad_URL;
if (!hasString) {
// Consume until before the next right parenthesis, which follows
// how <bad-url-token> is consumed in CSS Syntax 3 spec.
// Note that, we only do this when "url(" is not followed by a
// string, because in the spec, "url(" followed by a string is
// handled as a url function rather than a <url-token>, so the
// rest of content before ")" should be consumed in balance,
// which will be done by the parser.
// The closing ")" is not consumed here. It is left to the parser
// so that the parser can handle both cases.
do {
if (IsVertSpace(ch)) {
AdvanceLine();
} else {
Advance();
}
ch = Peek();
} while (ch >= 0 && ch != ')');
}
}
}

View file

@ -55,8 +55,7 @@ var LEX_TESTS = [
["url:http://example.com"]],
// In CSS Level 3, this is an ordinary URL, not a BAD_URL.
["url(http://example.com", ["url:http://example.com"]],
// See bug 1153981 to understand why this gets a SYMBOL token.
["url(http://example.com @", ["bad_url:http://example.com", "symbol:@"]],
["url(http://example.com @", ["bad_url:http://example.com"]],
["quo\\ting", ["ident:quoting"]],
["'bad string\n", ["bad_string:bad string", "whitespace"]],
["~=", ["includes"]],

View file

@ -277,29 +277,10 @@ this.OnRefTestLoad = function OnRefTestLoad(win)
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch);
try {
gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart");
} catch (e) {
gBrowserIsRemote = false;
}
try {
gB2GisMulet = prefs.getBoolPref("b2g.is_mulet");
} catch (e) {
gB2GisMulet = false;
}
try {
gBrowserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled");
} catch (e) {
gBrowserIsIframe = false;
}
try {
gLogLevel = prefs.getCharPref("reftest.logLevel");
} catch (e) {
gLogLevel ='info';
}
gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart", false);
gB2GisMulet = prefs.getBoolPref("b2g.is_mulet", false);
gBrowserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled", false);
gLogLevel = prefs.getCharPref("reftest.logLevel", "info");
if (win === undefined || win == null) {
win = window;
@ -366,11 +347,7 @@ function InitAndStartRefTests()
} catch (e) {}
/* set the gLoadTimeout */
try {
gLoadTimeout = prefs.getIntPref("reftest.timeout");
} catch(e) {
gLoadTimeout = 5 * 60 * 1000; //5 minutes as per bug 479518
}
gLoadTimeout = prefs.getIntPref("reftest.timeout", 5 * 60 * 1000); //5 minutes as per bug 479518
/* Get the logfile for android tests */
try {
@ -381,27 +358,12 @@ function InitAndStartRefTests()
}
} catch(e) {}
try {
gRemote = prefs.getBoolPref("reftest.remote");
} catch(e) {
gRemote = false;
}
try {
gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize");
} catch(e) {
gIgnoreWindowSize = false;
}
gRemote = prefs.getBoolPref("reftest.remote", false);
gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize", false);
/* Support for running a chunk (subset) of tests. In separate try as this is optional */
try {
gTotalChunks = prefs.getIntPref("reftest.totalChunks");
gThisChunk = prefs.getIntPref("reftest.thisChunk");
}
catch(e) {
gTotalChunks = 0;
gThisChunk = 0;
}
gTotalChunks = prefs.getIntPref("reftest.totalChunks", 0);
gThisChunk = prefs.getIntPref("reftest.thisChunk", 0);
try {
gFocusFilterMode = prefs.getCharPref("reftest.focusFilterMode");
@ -468,39 +430,17 @@ function StartTests()
logger.error("EXCEPTION: " + e);
}
try {
gNoCanvasCache = prefs.getIntPref("reftest.nocache");
} catch(e) {
gNoCanvasCache = false;
}
try {
gShuffle = prefs.getBoolPref("reftest.shuffle");
} catch (e) {
gShuffle = false;
}
try {
gRunUntilFailure = prefs.getBoolPref("reftest.runUntilFailure");
} catch (e) {
gRunUntilFailure = false;
}
gNoCanvasCache = prefs.getIntPref("reftest.nocache", false);
gShuffle = prefs.getBoolPref("reftest.shuffle", false);
gRunUntilFailure = prefs.getBoolPref("reftest.runUntilFailure", false);
// When we repeat this function is called again, so really only want to set
// gRepeat once.
if (gRepeat == null) {
try {
gRepeat = prefs.getIntPref("reftest.repeat");
} catch (e) {
gRepeat = 0;
}
gRepeat = prefs.getIntPref("reftest.repeat", 0);
}
try {
gRunSlowTests = prefs.getIntPref("reftest.skipslowtests");
} catch(e) {
gRunSlowTests = false;
}
gRunSlowTests = prefs.getIntPref("reftest.skipslowtests", false);
if (gShuffle) {
gNoCanvasCache = true;
@ -737,11 +677,7 @@ function BuildConditionSandbox(aURL) {
var prefs = CC["@mozilla.org/preferences-service;1"].
getService(CI.nsIPrefBranch);
try {
sandbox.nativeThemePref = !prefs.getBoolPref("mozilla.widget.disable-native-theme");
} catch (e) {
sandbox.nativeThemePref = true;
}
sandbox.nativeThemePref = !prefs.getBoolPref("mozilla.widget.disable-native-theme", false);
sandbox.prefs = CU.cloneInto({
getBoolPref: function(p) { return prefs.getBoolPref(p); },

View file

@ -1,109 +0,0 @@
env:
browser: true
globals:
Components: false
# TODO: Create custom rule for `Cu.import`
AddonManager: false
AppConstants: false
Downloads: false
File: false
FileUtils: false
HelperApps: true # TODO: Can be more specific here.
JNI: true # TODO: Can be more specific here.
LightweightThemeManager: false
Messaging: false
Notifications: false
OS: false
ParentalControls: false
PrivateBrowsingUtils: false
Prompt: false
Services: false
SharedPreferences: false
strings: false
Strings: false
Task: false
UITelemetry: false
UserAgentOverrides: 0
XPCOMUtils: false
ctypes: false
dump: false
exports: false
importScripts: false
module: false
require: false
uuidgen: false
Iterator: false # TODO: Remove - deprecated!
rules:
global-strict: 0 # Overridden by "strict"
no-underscore-dangle: 0 # We allow trailing underscores in names.
# We disable everything to get all files to pass w/o updating them.
# We'll re-enable one by one.
camelcase: 0
comma-dangle: 0
comma-spacing: 0
consistent-return: 0
curly: 0
dot-notation: 0
eqeqeq: 0
key-spacing: 0
new-cap: 0
no-caller: 0
no-constant-condition: 0
no-empty: 0
no-extra-bind: 0
no-extra-semi: 0
no-loop-func: 0
no-multi-spaces: 0
no-new-object: 0
no-octal: 0
no-return-assign: 0
no-shadow: 0
no-trailing-spaces: 0
no-unused-vars: 0
no-use-before-define: 0
quotes: 0 # [2, "double"]
semi: 0
space-infix-ops: 0
space-unary-ops: 0 # 2: https://github.com/eslint/eslint/issues/2764
strict: 0
#"ecmaFeatures": {
# "forOf": true,
# "jsx": true,
#},
#"rules": {
# // turn off all kinds of stuff that we actually do want, because
# // right now, we're bootstrapping the linting infrastructure. We'll
# // want to audit these rules, and start turning them on and fixing the
# // problems they find, one at a time.
# // Eslint built-in rules are documented at <http://eslint.org/docs/rules/>
# "camelcase": 0, // TODO: Remove (use default)
# "consistent-return": 0, // TODO: Remove (use default)
# dot-location: 0, // [2, property],
# "eqeqeq": 0, // TBD. Might need to be separate for content & chrome
# "global-strict": 0, // Leave as zero (this will be unsupported in eslint 1.0.0)
# "linebreak-style": [2, "unix"],
# "new-cap": 0, // TODO: Remove (use default)
# "no-catch-shadow": 0, // TODO: Remove (use default)
# "no-console": 0, // Leave as 0. We use console logging in content code.
# "no-empty": 0, // TODO: Remove (use default)
# "no-extra-bind": 0, // Leave as 0
# "no-extra-boolean-cast": 0, // TODO: Remove (use default)
# "no-multi-spaces": 0, // TBD.
# "no-new": 0, // TODO: Remove (use default)
# "no-redeclare": 0, // TODO: Remove (use default)
# "no-return-assign": 0, // TODO: Remove (use default)
# "no-underscore-dangle": 0, // Leave as 0. Commonly used for private variables.
# "no-unneeded-ternary": 2,
# "no-unused-expressions": 0, // TODO: Remove (use default)
# "no-unused-vars": 0, // TODO: Remove (use default)
# "no-use-before-define": 0, // TODO: Remove (use default)
# "quotes": [2, "double", "avoid-escape"],
# "strict": 0, // [2, "function"],
#}

View file

@ -1,373 +0,0 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View file

@ -1,11 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/testing/testsuite-targets.mk
package-mobile-tests:
$(MAKE) stage-mochitest DIST_BIN=$(DEPTH)/$(DIST)/bin/xulrunner
$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
@(cd $(PKG_STAGE) && tar $(TAR_CREATE_FLAGS) - *) | bzip2 -f > $(DIST)/$(PKG_PATH)$(TEST_PACKAGE)

View file

@ -1,17 +0,0 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include('/toolkit/toolkit.mozbuild')
if CONFIG['ENABLE_TESTS']:
DIRS += ['/testing/instrumentation']
if CONFIG['MOZ_EXTENSIONS']:
DIRS += ['/extensions']
DIRS += [
'/%s' % CONFIG['MOZ_BRANDING_DIRECTORY'],
'/mobile/android',
]

View file

@ -1 +0,0 @@
This is an example asset.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

File diff suppressed because it is too large Load diff

View file

@ -1,404 +0,0 @@
buildDir "${topobjdir}/gradle/build/mobile/android/app"
apply plugin: 'android-sdk-manager' // Must come before 'com.android.*'.
apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
android {
compileSdkVersion 23
buildToolsVersion mozconfig.substs.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
targetSdkVersion 23
minSdkVersion 15
applicationId mozconfig.substs.ANDROID_PACKAGE_NAME
testApplicationId 'org.mozilla.roboexample.test'
testInstrumentationRunner 'org.mozilla.gecko.FennecInstrumentationTestRunner'
manifestPlaceholders = [
ANDROID_PACKAGE_NAME: mozconfig.substs.ANDROID_PACKAGE_NAME,
MOZ_ANDROID_MIN_SDK_VERSION: mozconfig.substs.MOZ_ANDROID_MIN_SDK_VERSION,
MOZ_ANDROID_SHARED_ID: "${mozconfig.substs.ANDROID_PACKAGE_NAME}.sharedID",
]
// Used by Robolectric based tests; see TestRunner.
buildConfigField 'String', 'BUILD_DIR', "\"${project.buildDir}\""
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
dexOptions {
javaMaxHeapSize "2g"
}
lintOptions {
abortOnError true
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFile "${topsrcdir}/mobile/android/config/proguard/proguard.cfg"
}
}
productFlavors {
// For API 21+ - with multi dex, this will be faster for local development.
local {
// For multi dex, setting `minSdkVersion 21` allows the Android gradle plugin to
// pre-DEX each module and produce an APK that can be tested on
// Android Lollipop without time consuming DEX merging processes.
minSdkVersion 21
dexOptions {
preDexLibraries true
// We only call `MultiDex.install()` for the automation build flavor
// so this may not work. However, I don't think the multidex support
// library is necessary for 21+, so I expect that it will work.
multiDexEnabled true
}
}
// For API < 21 - does not support multi dex because local development
// is slow in that case. Most builds will not require multi dex so this
// should not be an issue.
localOld {
}
// Automation builds.
automation {
dexOptions {
// As of FF48 on beta, the "test", "lint", etc. treeherder jobs fail because they
// exceed the method limit. Beta includes Adjust and its GPS dependencies, which
// increase the method count & explain the failures. Furthermore, this error only
// occurs on debug builds because we don't proguard.
//
// We enable multidex as an easy, quick-fix with minimal side effects but before we
// move to gradle for our production builds, we should re-evaluate this decision
// (bug 1286677).
multiDexEnabled true
}
}
}
sourceSets {
main {
manifest.srcFile "${project.buildDir}/generated/source/preprocessed_manifest/AndroidManifest.xml"
aidl {
srcDir "${topsrcdir}/mobile/android/base/aidl"
}
java {
srcDir "${topsrcdir}/mobile/android/base/java"
srcDir "${topsrcdir}/mobile/android/search/java"
srcDir "${topsrcdir}/mobile/android/javaaddons/java"
srcDir "${topsrcdir}/mobile/android/services/src/main/java"
if (mozconfig.substs.MOZ_ANDROID_MLS_STUMBLER) {
srcDir "${topsrcdir}/mobile/android/stumbler/java"
}
exclude 'org/mozilla/gecko/CrashReporter.java'
if (!mozconfig.substs.MOZ_NATIVE_DEVICES) {
exclude 'org/mozilla/gecko/ChromeCastDisplay.java'
exclude 'org/mozilla/gecko/ChromeCastPlayer.java'
exclude 'org/mozilla/gecko/GeckoMediaPlayer.java'
exclude 'org/mozilla/gecko/GeckoPresentationDisplay.java'
exclude 'org/mozilla/gecko/MediaPlayerManager.java'
}
if (mozconfig.substs.MOZ_WEBRTC) {
srcDir "${topsrcdir}/media/webrtc/trunk/webrtc/modules/audio_device/android/java/src"
srcDir "${topsrcdir}/media/webrtc/trunk/webrtc/modules/video_capture/android/java/src"
srcDir "${topsrcdir}/media/webrtc/trunk/webrtc/modules/video_render/android/java/src"
}
if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
exclude 'org/mozilla/gecko/adjust/StubAdjustHelper.java'
} else {
exclude 'org/mozilla/gecko/adjust/AdjustHelper.java'
}
if (!mozconfig.substs.MOZ_ANDROID_GCM) {
exclude 'org/mozilla/gecko/gcm/**/*.java'
exclude 'org/mozilla/gecko/push/**/*.java'
}
srcDir "${project.buildDir}/generated/source/preprocessed_code" // See syncPreprocessedCode.
}
res {
srcDir "${topsrcdir}/${mozconfig.substs.MOZ_BRANDING_DIRECTORY}/res"
srcDir "${project.buildDir}/generated/source/preprocessed_resources" // See syncPreprocessedResources.
srcDir "${topsrcdir}/mobile/android/base/resources"
srcDir "${topsrcdir}/mobile/android/services/src/main/res"
if (mozconfig.substs.MOZ_CRASHREPORTER) {
srcDir "${topsrcdir}/mobile/android/base/crashreporter/res"
}
}
assets {
if (mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY && !mozconfig.substs.MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER) {
// If we are packaging the bouncer, it will have the distribution, so don't put
// it in the main APK as well.
srcDir "${mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets"
}
srcDir "${topsrcdir}/mobile/android/app/assets"
}
}
test {
java {
srcDir "${topsrcdir}/mobile/android/tests/background/junit4/src"
if (!mozconfig.substs.MOZ_ANDROID_GCM) {
exclude 'org/mozilla/gecko/gcm/**/*.java'
exclude 'org/mozilla/gecko/push/**/*.java'
}
}
resources {
srcDir "${topsrcdir}/mobile/android/tests/background/junit4/resources"
}
}
androidTest {
java {
srcDir "${topsrcdir}/mobile/android/tests/browser/robocop/src"
srcDir "${topsrcdir}/mobile/android/tests/background/junit3/src"
srcDir "${topsrcdir}/mobile/android/tests/browser/junit3/src"
srcDir "${topsrcdir}/mobile/android/tests/javaddons/src"
}
res {
srcDir "${topsrcdir}/mobile/android/tests/browser/robocop/res"
}
assets {
srcDir "${topsrcdir}/mobile/android/tests/browser/robocop/assets"
}
}
}
testOptions {
unitTests.all {
// We'd like to use (Runtime.runtime.availableProcessors()/2), but
// we have tests that start test servers and the bound ports
// collide. We'll fix this soon to have much faster test cycles.
maxParallelForks 1
}
}
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
compile "com.android.support:support-v4:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:appcompat-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:cardview-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:recyclerview-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:design:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:customtabs:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.android.support:palette-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
compile "com.android.support:mediarouter-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-cast:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
}
if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
compile "com.google.android.gms:play-services-ads:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
}
if (mozconfig.substs.MOZ_ANDROID_GCM) {
compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
compile "com.google.android.gms:play-services-measurement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
}
// Include LeakCanary in most gradle based builds. LeakCanary adds about 5k methods, so we disable
// it for the (non-proguarded, non-multidex) localOld builds to allow space for other libraries.
// Gradle based tests include the no-op version. Mach based builds only include the no-op version
// of this library.
// It doesn't seem like there is a non-trivial way to be conditional on 'localOld', so instead we explicitly
// define a version of leakcanary for every flavor:
localCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
localOldCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
automationCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
compile project(':geckoview')
compile project(':thirdparty')
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.1.2'
testCompile 'org.simpleframework:simple-http:6.0.1'
testCompile 'org.mockito:mockito-core:1.10.19'
// Including the Robotium JAR directly can cause issues with dexing.
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.4'
}
// TODO: (bug 1261486): This impl is not robust -
// we just wanted to land something.
task checkstyle(type: Checkstyle) {
configFile file("checkstyle.xml")
// TODO: should use sourceSets from project instead of hard-coded str.
source '../base/java/'
// TODO: This ignores our pre-processed resources.
include '**/*.java'
// TODO: classpath should probably be something.
classpath = files()
}
task syncPreprocessedCode(type: Sync, dependsOn: rootProject.generateCodeAndResources) {
into("${project.buildDir}/generated/source/preprocessed_code")
from("${topobjdir}/mobile/android/base/generated/preprocessed") {
// All other preprocessed code is included in the geckoview project.
include '**/AdjustConstants.java'
}
}
// The localization system uses the moz.build preprocessor to interpolate a .dtd
// file of XML entity definitions into an XML file of elements referencing those
// entities. (Each locale produces its own .dtd file, backstopped by the en-US
// .dtd file in tree.) Android Studio (and IntelliJ) don't handle these inline
// entities smoothly. This filter merely expands the entities in place, making
// them appear properly throughout the IDE. Be aware that this assumes that the
// JVM's file.encoding is utf-8. See comments in
// mobile/android/mach_commands.py.
class ExpandXMLEntitiesFilter extends FilterReader {
ExpandXMLEntitiesFilter(Reader input) {
// Extremely inefficient, but whatever.
super(new StringReader(groovy.xml.XmlUtil.serialize(new XmlParser(false, false, true).parse(input))))
}
}
task syncPreprocessedResources(type: Sync, dependsOn: rootProject.generateCodeAndResources) {
into("${project.buildDir}/generated/source/preprocessed_resources")
from("${topobjdir}/mobile/android/base/res")
filesMatching('**/strings.xml') {
filter(ExpandXMLEntitiesFilter)
}
}
// It's not easy -- see the backout in Bug 1242213 -- to change the <manifest>
// package for Fennec. Gradle has grown a mechanism to achieve what we want for
// Fennec, however, with applicationId. To use the same manifest as moz.build,
// we replace the package with org.mozilla.gecko (the eventual package) here.
task rewriteManifestPackage(type: Copy, dependsOn: rootProject.generateCodeAndResources) {
into("${project.buildDir}/generated/source/preprocessed_manifest")
from("${topobjdir}/mobile/android/base/AndroidManifest.xml")
filter { it.replaceFirst(/package=".*?"/, 'package="org.mozilla.gecko"') }
}
apply from: "${topsrcdir}/mobile/android/gradle/with_gecko_binaries.gradle"
android.applicationVariants.all { variant ->
variant.preBuild.dependsOn rewriteManifestPackage
variant.preBuild.dependsOn syncPreprocessedCode
variant.preBuild.dependsOn syncPreprocessedResources
// Automation builds don't include Gecko binaries, since those binaries are
// not produced until after build time (at package time). Therefore,
// automation builds include the Gecko binaries into the APK at package
// time. The "withGeckoBinaries" variant of the :geckoview project also
// does this. (It does what it says on the tin!) For notes on this
// approach, see mobile/android/gradle/with_gecko_binaries.gradle.
// Like 'local' or 'localOld'.
def productFlavor = variant.productFlavors[0].name
// :app uses :geckoview:release and handles it's own Gecko binary inclusion,
// even though this would be most naturally done in the :geckoview project.
if (!productFlavor.equals('automation')) {
configureVariantWithGeckoBinaries(variant)
}
}
apply plugin: 'spoon'
spoon {
// For now, let's be verbose.
debug = true
// It's not helpful to pass when we don't have a device connected.
failIfNoDeviceConnected = true
def spoonPackageName
if (gradle.startParameter.taskNames.contains('runBrowserTests')) {
spoonPackageName = 'org.mozilla.tests.browser.junit3'
}
if (gradle.startParameter.taskNames.contains('runBackgroundTests')) {
spoonPackageName = 'org.mozilla.gecko.background'
}
if (project.hasProperty('spoonPackageName')) {
// Command line overrides everything.
spoonPackageName = project.spoonPackageName
}
if (spoonPackageName) {
instrumentationArgs = ['-e', "package=${spoonPackageName}".toString()]
}
}
// See discussion at https://github.com/stanfy/spoon-gradle-plugin/issues/9.
afterEvaluate {
tasks["spoonLocal${android.testBuildType.capitalize()}AndroidTest"].outputs.upToDateWhen { false }
// This is an awkward way to define different sets of instrumentation tests.
// The task name itself is fished at runtime and the package name configured
// in the spoon configuration.
task runBrowserTests {
dependsOn tasks["spoonLocalOldDebugAndroidTest"]
}
task runBackgroundTests {
dependsOn tasks["spoonLocalOldDebugAndroidTest"]
}
}
// Bug 1299015: Complain to treeherder if checkstyle, lint, or unittest fails. It's not obvious
// how to listen to individual errors in most cases, so we just link to the reports for now.
def makeTaskExecutionListener(artifactRootUrl) {
return new TaskExecutionListener() {
void beforeExecute(Task task) {
// Do nothing.
}
void afterExecute(Task task, TaskState state) {
if (!state.failure) {
return
}
// Link to the failing report. The task path and the report path
// depend on the android-lint task in
// taskcluster/ci/android-stuff/kind.yml. It's not possible to link
// directly, so for now consumers will need to copy-paste the URL.
switch (task.path) {
case ':app:checkstyle':
def url = "${artifactRootUrl}/public/android/checkstyle/checkstyle.xml"
println "TEST-UNEXPECTED-FAIL | android-checkstyle | Checkstyle rule violations were found. See the report at: $url"
break
case ':app:lintAutomationDebug':
def url = "${artifactRootUrl}/public/android/lint/lint-results-automationDebug.html"
println "TEST-UNEXPECTED-FAIL | android-lint | Lint found errors in the project; aborting build. See the report at: $url"
break
case ':app:testAutomationDebugUnitTest':
def url = "${artifactRootUrl}/public/android/unittest/automationDebug/index.html"
println "TEST-UNEXPECTED-FAIL | android-test | There were failing tests. See the report at: $url"
break
}
}
}
}
// TASK_ID and RUN_ID are provided by docker-worker; see
// https://docs.taskcluster.net/manual/execution/workers/docker-worker.
if (System.env.TASK_ID && System.env.RUN_ID) {
def artifactRootUrl = "https://queue.taskcluster.net/v1/task/${System.env.TASK_ID}/runs/${System.env.RUN_ID}/artifacts"
gradle.addListener(makeTaskExecutionListener(artifactRootUrl))
}

View file

@ -1,63 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!-- TODO: Clean up code & add checks:
- WhitespaceAround
- EmptyLineSeparator
- NeedBraces
- LeftCurly // placement of "{" in new scope or literal
- RightCurly // placement of "}" in close scope or literal
- Indentation
- OneStatementPerLine
- OperatorWrap
- SeparatorWrap
- MultipleVariableDeclarations
- FallThrough
(I spent too much time already)
Maybe add:
- OneTopLevelClass
- OverloadMethodsDeclarationOrder
- Empty*Block // better to catch errors!
(I spent too much time already)
See http://checkstyle.sourceforge.net/google_style.html
for a good set of defaults.
-->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<!-- TODO: <property name="fileExtensions" value="java, properties, xml"/> -->
<module name="FileTabCharacter"> <!-- No tabs! -->
<property name="eachLine" value="true"/>
</module>
<module name="RegexpSingleline"> <!-- excess whitespace -->
<property name="format" value="\s+$"/>
<property name="message" value="Trailing whitespace"/>
</module>
<module name="TreeWalker">
<module name="GenericWhitespace"/> <!-- whitespace for generics -->
<module name="NoLineWrap">
<property name="tokens" value="IMPORT,PACKAGE_DEF"/>
</module>
<module name="OuterTypeFilename"/> <!-- `class Lol` only in Lol.java -->
<module name="WhitespaceAfter">
<!-- TODO: (bug 1263059) Remove specific tokens to enable CAST check. -->
<property name="tokens" value="COMMA, SEMI"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
</module>
</module>
</module>

View file

@ -1,223 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Enable relevant checks disabled by default -->
<issue id="NegativeMargin" severity="warning" />
<!-- We have a custom menu and don't conform to the recommended styles. -->
<issue id="IconColors" severity="ignore" />
<!-- We use our own preprocessing to either add or remove
`android:debuggable` when building with mach so it's
not actually hard-coded. We can probably remove this
warning when we switch to gradle. -->
<issue id="HardcodedDebugMode" severity="ignore" />
<!-- We have our own l10n system & don't use the platform's plurals. -->
<issue id="PluralsCandidate" severity="ignore" />
<!-- We don't want to have to follow the SDK release schedule: we can keep
the warning in order to not forget that there's a new SDK, but there's
no need to break on update. -->
<issue id="OldTargetApi" severity="warning" />
<!-- We want all lint warnings to be fatal errors.
Right now, we set these to lint warnings so:
DO NOT ADD TO THIS LIST.
We did this so we can land lint in automation
and not fail everything. -->
<issue id="AppCompatResource" severity="warning" />
<issue id="GoogleAppIndexingDeepLinkError" severity="warning" />
<issue id="GoogleAppIndexingUrlError" severity="warning" />
<issue id="Instantiatable" severity="warning" />
<issue id="LongLogTag" severity="warning" />
<issue id="MissingPermission" severity="warning" />
<issue id="NewApi" severity="warning" />
<issue id="OnClick" severity="warning" />
<issue id="ReferenceType" severity="warning" />
<issue id="ResourceAsColor" severity="warning" />
<issue id="ResourceType" severity="warning" />
<issue id="ValidFragment" severity="warning" />
<issue id="WrongConstant" severity="warning" />
<!-- We fixed all "Registered" lint errors. However the current gradle plugin has a bug where
it ignores @SuppressLint annotations for this check. See CrashReporter class and
https://code.google.com/p/android/issues/detail?id=204846 -->
<issue id="Registered" severity="warning" />
<!-- WHEN YOU FIX A LINT WARNING, ADD IT TO THIS LIST.
We want all lint warnings to be fatal errors.
This is the list of checks that we've explicitly
set as errors. Ideally, once we have no more warnings,
we switch to the `warningsAsErrors` lint option
(bug 1253737) rather than listing everything explicitly. -->
<issue id="AaptCrash" severity="error" />
<issue id="Accessibility" severity="error" />
<issue id="AccidentalOctal" severity="error" />
<issue id="AdapterViewChildren" severity="error" />
<issue id="AddJavascriptInterface" severity="error" />
<issue id="AllowBackup" severity="error" />
<issue id="AlwaysShowAction" severity="error" />
<issue id="AndroidGradlePluginVersion" severity="error" />
<issue id="AppCompatMethod" severity="error" />
<issue id="AppIndexingError" severity="error" />
<issue id="AppIndexingWarning" severity="error" />
<issue id="Assert" severity="error" />
<issue id="ButtonCase" severity="error" />
<issue id="ButtonOrder" severity="error" />
<issue id="ByteOrderMark" severity="error" />
<issue id="CheckResult" severity="error" />
<issue id="Correctness" severity="error" />
<issue id="CutPasteId" severity="error" />
<issue id="DalvikOverride" severity="error" />
<issue id="DeviceAdmin" severity="error" />
<issue id="DisableBaselineAlignment" severity="error" />
<issue id="DrawAllocation" severity="error" />
<issue id="DuplicateActivity" severity="error" />
<issue id="DuplicateDefinition" severity="error" />
<issue id="DuplicateIds" severity="error" />
<issue id="DuplicateIncludedIds" severity="error" />
<issue id="DuplicateUsesFeature" severity="error" />
<issue id="ExportedContentProvider" severity="error" />
<issue id="ExportedPreferenceActivity" severity="error" />
<issue id="ExtraText" severity="error" />
<issue id="ExtraTranslation" severity="error" />
<issue id="FloatMath" severity="error" />
<issue id="FullBackupContent" severity="error" />
<issue id="GetInstance" severity="error" />
<issue id="GifUsage" severity="error" />
<issue id="GradleCompatible" severity="error" />
<issue id="GradleDependency" severity="error" />
<issue id="GradleDeprecated" severity="error" />
<issue id="GradleDynamicVersion" severity="error" />
<issue id="GradleGetter" severity="error" />
<issue id="GradleIdeError" severity="error" />
<issue id="GradlePath" severity="error" />
<issue id="GrantAllUris" severity="error" />
<issue id="GridLayout" severity="error" />
<issue id="HandlerLeak" severity="error" />
<issue id="HardcodedText" severity="error" />
<issue id="IconExtension" severity="error" />
<issue id="IconLauncherShape" severity="error" />
<issue id="IconMixedNinePatch" severity="error" />
<issue id="IconNoDpi" severity="error" />
<issue id="IllegalResourceRef" severity="error" />
<issue id="ImpliedQuantity" severity="error" />
<issue id="InOrMmUsage" severity="error" />
<issue id="IncludeLayoutParam" severity="error" />
<issue id="InconsistentArrays" severity="error" />
<issue id="InefficientWeight" severity="error" />
<issue id="InnerclassSeparator" severity="error" />
<issue id="Internationalization" severity="error" />
<issue id="InvalidId" severity="error" />
<issue id="InvalidPackage" severity="error" />
<issue id="InvalidResourceFolder" severity="error" />
<issue id="JavascriptInterface" severity="error" />
<issue id="LabelFor" severity="error" />
<issue id="LibraryCustomView" severity="error" />
<issue id="LocalSuppress" severity="error" />
<issue id="LocaleFolder" severity="error" />
<issue id="LogTagMismatch" severity="error" />
<issue id="MangledCRLF" severity="error" />
<issue id="ManifestOrder" severity="error" />
<issue id="ManifestTypo" severity="error" />
<issue id="MenuTitle" severity="error" />
<issue id="MergeRootFrame" severity="error" />
<issue id="MipmapIcons" severity="error" />
<issue id="MissingApplicationIcon" severity="error" />
<issue id="MissingId" severity="error" />
<issue id="MissingPrefix" severity="error" />
<issue id="MissingQuantity" severity="error" />
<issue id="MissingRegistered" severity="error" />
<issue id="MissingSuperCall" severity="error" />
<issue id="MissingTranslation" severity="error" />
<issue id="MissingVersion" severity="error" />
<issue id="MockLocation" severity="error" />
<issue id="MultipleUsesSdk" severity="error" />
<issue id="NamespaceTypo" severity="error" />
<issue id="NestedScrolling" severity="error" />
<issue id="NfcTechWhitespace" severity="error" />
<issue id="NotSibling" severity="error" />
<issue id="ObsoleteLayoutParam" severity="error" />
<issue id="OnClick" severity="error" />
<issue id="Orientation" severity="error" />
<issue id="Override" severity="error" />
<issue id="OverrideAbstract" severity="error" />
<issue id="PackagedPrivateKey" severity="error" />
<issue id="ParcelCreator" severity="error" />
<issue id="Performance" severity="error" />
<issue id="Proguard" severity="error" />
<issue id="ProguardSplit" severity="error" />
<issue id="PropertyEscape" severity="error" />
<issue id="ProtectedPermissions" severity="error" />
<issue id="PxUsage" severity="error" />
<issue id="Range" severity="error" />
<issue id="RelativeOverlap" severity="error" />
<issue id="RequiredSize" severity="error" />
<issue id="ResAuto" severity="error" />
<issue id="ResourceCycle" severity="error" />
<issue id="ResourceName" severity="error" />
<issue id="ResourceType" severity="error" />
<issue id="RtlCompat" severity="error" />
<issue id="RtlEnabled" severity="error" />
<issue id="ScrollViewCount" severity="error" />
<issue id="ScrollViewSize" severity="error" />
<issue id="SecureRandom" severity="error" />
<issue id="Security" severity="error" />
<issue id="ServiceCast" severity="error" />
<issue id="SetJavaScriptEnabled" severity="error" />
<issue id="ShiftFlags" severity="error" />
<issue id="ShortAlarm" severity="error" />
<issue id="ShowToast" severity="error" />
<issue id="SignatureOrSystemPermissions" severity="error" />
<issue id="StringFormatCount" severity="error" />
<issue id="StringFormatInvalid" severity="error" />
<issue id="StringFormatMatches" severity="error" />
<issue id="StringShouldBeInt" severity="error" />
<issue id="SuspiciousImport" severity="error" />
<issue id="TextFields" severity="error" />
<issue id="TextViewEdits" severity="error" />
<issue id="TooDeepLayout" severity="error" />
<issue id="TooManyViews" severity="error" />
<issue id="TrulyRandom" severity="error" />
<issue id="TypographyDashes" severity="error" />
<issue id="TypographyFractions" severity="error" />
<issue id="TypographyOther" severity="error" />
<issue id="Typos" severity="error" />
<issue id="UniqueConstants" severity="error" />
<issue id="UniquePermission" severity="error" />
<issue id="UnknownId" severity="error" />
<issue id="UnknownIdInLayout" severity="error" />
<issue id="UnlocalizedSms" severity="error" />
<issue id="UnusedNamespace" severity="error" />
<issue id="UnusedQuantity" severity="error" />
<issue id="UnusedResources" severity="error">
<!-- The moz.build based build system leaves a .mkdir.done file lying around in the
preprocessed_resources res/raw folder. Lint reports it as unused. We should get
rid of the file eventually. See bug 1268948. -->
<ignore path="**/raw/.mkdir.done" />
</issue>
<issue id="Usability" severity="error" />
<issue id="UseCheckPermission" severity="error" />
<issue id="UseCompoundDrawables" severity="error" />
<issue id="UselessLeaf" severity="error" />
<issue id="UsesMinSdkAttributes" severity="error" />
<issue id="UsingHttp" severity="error" />
<issue id="ViewHolder" severity="error" />
<issue id="ViewTag" severity="error" />
<issue id="Wakelock" severity="error" />
<issue id="WebViewLayout" severity="error" />
<issue id="WorldReadableFiles" severity="error" />
<issue id="WorldWriteableFiles" severity="error" />
<issue id="WrongCall" severity="error" />
<issue id="WrongCase" severity="error" />
<issue id="WrongConstant" severity="error" />
<issue id="WrongFolder" severity="error" />
<issue id="WrongManifestParent" severity="error" />
<issue id="WrongRegion" severity="error" />
<issue id="WrongThread" severity="error" />
<issue id="WrongViewCast" severity="error" />
</lint>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -1,916 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#filter substitution
// For browser.xml binding
//
// cacheRatio* is a ratio that determines the amount of pixels to cache. The
// ratio is multiplied by the viewport width or height to get the displayport's
// width or height, respectively.
//
// (divide integer value by 1000 to get the ratio)
//
// For instance: cachePercentageWidth is 1500
// viewport height is 500
// => display port height will be 500 * 1.5 = 750
//
pref("toolkit.browser.cacheRatioWidth", 2000);
pref("toolkit.browser.cacheRatioHeight", 3000);
// How long before a content view (a handle to a remote scrollable object)
// expires.
pref("toolkit.browser.contentViewExpire", 3000);
pref("toolkit.defaultChromeURI", "chrome://browser/content/browser.xul");
pref("browser.chromeURL", "chrome://browser/content/");
// If a tab has not been active for this long (seconds), then it may be
// turned into a zombie tab to preemptively free up memory. -1 disables time-based
// expiration (but low-memory conditions may still require the tab to be zombified).
pref("browser.tabs.expireTime", 900);
// Disables zombification of background tabs under memory pressure.
// Intended for use in testing, where we don't want the tab running the
// test harness code to be zombified.
pref("browser.tabs.disableBackgroundZombification", false);
// Control whether tab content should try to load from disk cache when network
// is offline.
// Controlled by Switchboard experiment "offline-cache".
pref("browser.tabs.useCache", false);
// From libpref/src/init/all.js, extended to allow a slightly wider zoom range.
pref("zoom.minPercent", 20);
pref("zoom.maxPercent", 400);
pref("toolkit.zoomManager.zoomValues", ".2,.3,.5,.67,.8,.9,1,1.1,1.2,1.33,1.5,1.7,2,2.4,3,4");
// Mobile will use faster, less durable mode.
pref("toolkit.storage.synchronous", 0);
pref("browser.viewport.desktopWidth", 980);
// The default fallback zoom level to render pages at. Set to -1 to fit page; otherwise
// the value is divided by 1000 and clamped to hard-coded min/max scale values.
pref("browser.viewport.defaultZoom", -1);
// Show/Hide scrollbars when active/inactive
pref("ui.showHideScrollbars", 1);
pref("ui.useOverlayScrollbars", 1);
pref("ui.scrollbarFadeBeginDelay", 450);
pref("ui.scrollbarFadeDuration", 0);
/* turn off the caret blink after 10 cycles */
pref("ui.caretBlinkCount", 10);
/* cache prefs */
pref("browser.cache.disk.enable", true);
pref("browser.cache.disk.capacity", 20480); // kilobytes
pref("browser.cache.disk.max_entry_size", 4096); // kilobytes
pref("browser.cache.disk.smart_size.enabled", true);
pref("browser.cache.disk.smart_size.first_run", true);
#ifdef MOZ_PKG_SPECIAL
// low memory devices
pref("browser.cache.memory.enable", false);
#else
pref("browser.cache.memory.enable", true);
#endif
pref("browser.cache.memory.capacity", 1024); // kilobytes
pref("browser.cache.memory_limit", 5120); // 5 MB
/* image cache prefs */
pref("image.cache.size", 1048576); // bytes
/* offline cache prefs */
pref("browser.offline-apps.notify", true);
pref("browser.cache.offline.enable", true);
pref("browser.cache.offline.capacity", 5120); // kilobytes
pref("offline-apps.quota.warn", 1024); // kilobytes
// cache compression turned off for now - see bug #715198
pref("browser.cache.compression_level", 0);
/* disable some protocol warnings */
pref("network.protocol-handler.warn-external.tel", false);
pref("network.protocol-handler.warn-external.sms", false);
pref("network.protocol-handler.warn-external.mailto", false);
pref("network.protocol-handler.warn-external.vnd.youtube", false);
/* http prefs */
pref("network.http.pipelining", true);
pref("network.http.pipelining.ssl", true);
pref("network.http.proxy.pipelining", true);
pref("network.http.pipelining.maxrequests" , 6);
pref("network.http.keep-alive.timeout", 109);
pref("network.http.max-connections", 20);
pref("network.http.max-persistent-connections-per-server", 6);
pref("network.http.max-persistent-connections-per-proxy", 20);
// spdy
pref("network.http.spdy.push-allowance", 32768);
pref("network.http.spdy.default-hpack-buffer", 4096); // 4k
// See bug 545869 for details on why these are set the way they are
pref("network.buffer.cache.count", 24);
pref("network.buffer.cache.size", 16384);
// predictive actions
pref("network.predictor.enabled", true);
pref("network.predictor.max-db-size", 2097152); // bytes
pref("network.predictor.preserve", 50); // percentage of predictor data to keep when cleaning up
// Use JS mDNS as a fallback
pref("network.mdns.use_js_fallback", true);
/* history max results display */
pref("browser.display.history.maxresults", 100);
/* How many times should have passed before the remote tabs list is refreshed */
pref("browser.display.remotetabs.timeout", 10);
/* session history */
pref("browser.sessionhistory.max_total_viewers", 1);
pref("browser.sessionhistory.max_entries", 50);
pref("browser.sessionhistory.contentViewerTimeout", 360);
pref("browser.sessionhistory.bfcacheIgnoreMemoryPressure", false);
/* session store */
pref("browser.sessionstore.resume_session_once", false);
pref("browser.sessionstore.resume_from_crash", true);
pref("browser.sessionstore.interval", 10000); // milliseconds
pref("browser.sessionstore.backupInterval", 120000); // milliseconds -> 2 minutes
pref("browser.sessionstore.max_tabs_undo", 10);
pref("browser.sessionstore.max_resumed_crashes", 1);
pref("browser.sessionstore.privacy_level", 0); // saving data: 0 = all, 1 = unencrypted sites, 2 = never
pref("browser.sessionstore.debug_logging", false);
/* these should help performance */
pref("mozilla.widget.force-24bpp", true);
pref("mozilla.widget.use-buffer-pixmap", true);
pref("mozilla.widget.disable-native-theme", true);
pref("layout.reflow.synthMouseMove", false);
pref("layout.css.report_errors", false);
/* download manager (don't show the window or alert) */
pref("browser.download.useDownloadDir", true);
pref("browser.download.folderList", 1); // Default to ~/Downloads
pref("browser.download.manager.showAlertOnComplete", false);
pref("browser.download.manager.showAlertInterval", 2000);
pref("browser.download.manager.retention", 2);
pref("browser.download.manager.showWhenStarting", false);
pref("browser.download.manager.closeWhenDone", true);
pref("browser.download.manager.openDelay", 0);
pref("browser.download.manager.focusWhenStarting", false);
pref("browser.download.manager.flashCount", 2);
pref("browser.download.manager.displayedHistoryDays", 7);
pref("browser.download.manager.addToRecentDocs", true);
/* download helper */
pref("browser.helperApps.deleteTempFileOnExit", false);
/* password manager */
pref("signon.rememberSignons", true);
pref("signon.autofillForms.http", true);
pref("signon.expireMasterPassword", false);
pref("signon.debug", false);
/* form helper (scroll to and optionally zoom into editable fields) */
pref("formhelper.mode", 2); // 0 = disabled, 1 = enabled, 2 = dynamic depending on screen size
pref("formhelper.autozoom", true);
/* find helper */
pref("findhelper.autozoom", true);
/* autocomplete */
pref("browser.formfill.enable", true);
/* spellcheck */
pref("layout.spellcheckDefault", 0);
/* new html5 forms */
pref("dom.experimental_forms", true);
pref("dom.forms.number", true);
/* extension manager and xpinstall */
pref("xpinstall.whitelist.directRequest", false);
pref("xpinstall.whitelist.fileRequest", false);
pref("xpinstall.whitelist.add", "https://addons.mozilla.org,https://testpilot.firefox.com");
pref("xpinstall.signatures.required", true);
pref("extensions.enabledScopes", 1);
pref("extensions.autoupdate.enabled", true);
pref("extensions.autoupdate.interval", 86400);
pref("extensions.update.enabled", true);
pref("extensions.update.interval", 86400);
pref("extensions.dss.enabled", false);
pref("extensions.dss.switchPending", false);
pref("extensions.ignoreMTimeChanges", false);
pref("extensions.logging.enabled", false);
pref("extensions.hideInstallButton", true);
pref("extensions.showMismatchUI", false);
pref("extensions.hideUpdateButton", false);
pref("extensions.strictCompatibility", false);
pref("extensions.minCompatibleAppVersion", "11.0");
pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=52.9&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=52.9&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
pref("extensions.hotfix.id", "firefox-android-hotfix@mozilla.org");
pref("extensions.hotfix.cert.checkAttributes", true);
pref("extensions.hotfix.certs.1.sha1Fingerprint", "91:53:98:0C:C1:86:DF:47:8F:35:22:9E:11:C9:A7:31:04:49:A1:AA");
/* preferences for the Get Add-ons pane */
pref("extensions.getAddons.cache.enabled", true);
pref("extensions.getAddons.maxResults", 15);
pref("extensions.getAddons.recommended.browseURL", "https://addons.mozilla.org/%LOCALE%/android/recommended/");
pref("extensions.getAddons.recommended.url", "https://services.addons.mozilla.org/%LOCALE%/android/api/%API_VERSION%/list/featured/all/%MAX_RESULTS%/%OS%/%VERSION%");
pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/android/search?q=%TERMS%&platform=%OS%&appver=%VERSION%");
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/android/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%");
pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/android/");
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/android/api/%API_VERSION%/search/guid:%IDS%?src=mobile&appOS=%OS%&appVersion=%VERSION%");
pref("extensions.getAddons.getWithPerformance.url", "https://services.addons.mozilla.org/%LOCALE%/android/api/%API_VERSION%/search/guid:%IDS%?src=mobile&appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%");
/* preference for the locale picker */
pref("extensions.getLocales.get.url", "");
pref("extensions.compatability.locales.buildid", "0");
/* Don't let XPIProvider install distribution add-ons; we do our own thing on mobile. */
pref("extensions.installDistroAddons", false);
// Add-on content security policies.
pref("extensions.webextensions.base-content-security-policy", "script-src 'self' https://* moz-extension: blob: filesystem: 'unsafe-eval' 'unsafe-inline'; object-src 'self' https://* moz-extension: blob: filesystem:;");
pref("extensions.webextensions.default-content-security-policy", "script-src 'self'; object-src 'self';");
/* block popups by default, and notify the user about blocked popups */
pref("dom.disable_open_during_load", true);
pref("privacy.popups.showBrowserMessage", true);
/* disable opening windows with the dialog feature */
pref("dom.disable_window_open_dialog_feature", true);
pref("dom.disable_window_showModalDialog", true);
pref("dom.disable_window_print", true);
pref("dom.disable_window_find", true);
pref("keyword.enabled", true);
pref("browser.fixup.domainwhitelist.localhost", true);
pref("accessibility.typeaheadfind", false);
pref("accessibility.typeaheadfind.timeout", 5000);
pref("accessibility.typeaheadfind.flashBar", 1);
pref("accessibility.typeaheadfind.linksonly", false);
pref("accessibility.typeaheadfind.casesensitive", 0);
pref("accessibility.browsewithcaret_shortcut.enabled", false);
// Whether the character encoding menu is under the main Firefox button. This
// preference is a string so that localizers can alter it.
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
// pointer to the default engine name
pref("browser.search.defaultenginename", "chrome://browser/locale/region.properties");
// SSL error page behaviour
pref("browser.ssl_override_behavior", 2);
pref("browser.xul.error_pages.expert_bad_cert", false);
// ordering of search engines in the engine list.
pref("browser.search.order.1", "chrome://browser/locale/region.properties");
pref("browser.search.order.2", "chrome://browser/locale/region.properties");
pref("browser.search.order.3", "chrome://browser/locale/region.properties");
// Market-specific search defaults
pref("browser.search.geoSpecificDefaults", true);
pref("browser.search.geoSpecificDefaults.url", "https://search.services.mozilla.com/1/%APP%/%VERSION%/%CHANNEL%/%LOCALE%/%REGION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%");
// US specific default (used as a fallback if the geoSpecificDefaults request fails).
pref("browser.search.defaultenginename.US", "chrome://browser/locale/region.properties");
pref("browser.search.order.US.1", "chrome://browser/locale/region.properties");
pref("browser.search.order.US.2", "chrome://browser/locale/region.properties");
pref("browser.search.order.US.3", "chrome://browser/locale/region.properties");
// disable updating
pref("browser.search.update", false);
// disable search suggestions by default
pref("browser.search.suggest.enabled", false);
pref("browser.search.suggest.prompted", false);
// tell the search service that we don't really expose the "current engine"
pref("browser.search.noCurrentEngine", true);
// Control media casting & mirroring features
pref("browser.casting.enabled", true);
#ifdef RELEASE_OR_BETA
// Chromecast mirroring is broken (bug 1131084)
pref("browser.mirroring.enabled", false);
#else
pref("browser.mirroring.enabled", true);
#endif
// Enable sparse localization by setting a few package locale overrides
pref("chrome.override_package.global", "browser");
pref("chrome.override_package.mozapps", "browser");
pref("chrome.override_package.passwordmgr", "browser");
// enable xul error pages
pref("browser.xul.error_pages.enabled", true);
// disable color management
pref("gfx.color_management.mode", 0);
// 0=fixed margin, 1=velocity bias, 2=dynamic resolution, 3=no margins, 4=prediction bias
pref("gfx.displayport.strategy", 1);
// all of the following displayport strategy prefs will be divided by 1000
// to obtain some multiplier which is then used in the strategy.
// fixed margin strategy options
pref("gfx.displayport.strategy_fm.multiplier", -1); // displayport dimension multiplier
pref("gfx.displayport.strategy_fm.danger_x", -1); // danger zone on x-axis when multiplied by viewport width
pref("gfx.displayport.strategy_fm.danger_y", -1); // danger zone on y-axis when multiplied by viewport height
// velocity bias strategy options
pref("gfx.displayport.strategy_vb.multiplier", -1); // displayport dimension multiplier
pref("gfx.displayport.strategy_vb.threshold", -1); // velocity threshold in inches/frame
pref("gfx.displayport.strategy_vb.reverse_buffer", -1); // fraction of buffer to keep in reverse direction from scroll
pref("gfx.displayport.strategy_vb.danger_x_base", -1); // danger zone on x-axis when multiplied by viewport width
pref("gfx.displayport.strategy_vb.danger_y_base", -1); // danger zone on y-axis when multiplied by viewport height
pref("gfx.displayport.strategy_vb.danger_x_incr", -1); // additional danger zone on x-axis when multiplied by viewport width and velocity
pref("gfx.displayport.strategy_vb.danger_y_incr", -1); // additional danger zone on y-axis when multiplied by viewport height and velocity
// prediction bias strategy options
pref("gfx.displayport.strategy_pb.threshold", -1); // velocity threshold in inches/frame
// Allow 24-bit colour when the hardware supports it
pref("gfx.android.rgb16.force", false);
// Allow GLContexts to be attached/detached from SurfaceTextures
pref("gfx.SurfaceTexture.detach.enabled", true);
// don't allow JS to move and resize existing windows
pref("dom.disable_window_move_resize", true);
// prevent click image resizing for nsImageDocument
pref("browser.enable_click_image_resizing", false);
// open in tab preferences
// 0=default window, 1=current window/tab, 2=new window, 3=new tab in most window
pref("browser.link.open_external", 3);
pref("browser.link.open_newwindow", 3);
// 0=force all new windows to tabs, 1=don't force, 2=only force those with no features set
pref("browser.link.open_newwindow.restriction", 0);
// show images option
// 0=never, 1=always, 2=cellular-only
pref("browser.image_blocking", 1);
// controls which bits of private data to clear. by default we clear them all.
pref("privacy.item.cache", true);
pref("privacy.item.cookies", true);
pref("privacy.item.offlineApps", true);
pref("privacy.item.history", true);
pref("privacy.item.searchHistory", true);
pref("privacy.item.formdata", true);
pref("privacy.item.downloads", true);
pref("privacy.item.passwords", true);
pref("privacy.item.sessions", true);
pref("privacy.item.geolocation", true);
pref("privacy.item.siteSettings", true);
pref("privacy.item.syncAccount", true);
// enable geo
pref("geo.enabled", true);
// content sink control -- controls responsiveness during page load
// see https://bugzilla.mozilla.org/show_bug.cgi?id=481566#c9
//pref("content.sink.enable_perf_mode", 2); // 0 - switch, 1 - interactive, 2 - perf
//pref("content.sink.pending_event_mode", 0);
//pref("content.sink.perf_deflect_count", 1000000);
//pref("content.sink.perf_parse_time", 50000000);
// Disable the JS engine's gc on memory pressure, since we do one in the mobile
// browser (bug 669346).
pref("javascript.options.gc_on_memory_pressure", false);
#ifdef MOZ_PKG_SPECIAL
// low memory devices
pref("javascript.options.mem.gc_high_frequency_heap_growth_max", 120);
pref("javascript.options.mem.gc_high_frequency_heap_growth_min", 120);
pref("javascript.options.mem.gc_high_frequency_high_limit_mb", 40);
pref("javascript.options.mem.gc_high_frequency_low_limit_mb", 10);
pref("javascript.options.mem.gc_low_frequency_heap_growth", 120);
pref("javascript.options.mem.high_water_mark", 16);
pref("javascript.options.mem.gc_allocation_threshold_mb", 3);
pref("javascript.options.mem.gc_min_empty_chunk_count", 1);
pref("javascript.options.mem.gc_max_empty_chunk_count", 2);
#else
pref("javascript.options.mem.high_water_mark", 32);
#endif
pref("dom.max_chrome_script_run_time", 0); // disable slow script dialog for chrome
pref("dom.max_script_run_time", 20);
// Absolute path to the devtools unix domain socket file used
// to communicate with a usb cable via adb forward.
pref("devtools.debugger.unix-domain-socket", "/data/data/@ANDROID_PACKAGE_NAME@/firefox-debugger-socket");
pref("devtools.remote.usb.enabled", false);
pref("devtools.remote.wifi.enabled", false);
pref("font.size.inflation.minTwips", 0);
// When true, zooming will be enabled on all sites, even ones that declare user-scalable=no.
pref("browser.ui.zoom.force-user-scalable", false);
// When removing this Nightly flag, also remember to remove the flags surrounding this feature
// in GeckoPreferences and BrowserApp (see bug 1245930).
#ifdef NIGHTLY_BUILD
pref("ui.zoomedview.enabled", true);
#else
pref("ui.zoomedview.enabled", false);
#endif
pref("ui.zoomedview.keepLimitSize", 16); // value in layer pixels, used to not keep the large elements in the cluster list (Bug 1191041)
pref("ui.zoomedview.limitReadableSize", 8); // value in layer pixels
pref("ui.zoomedview.defaultZoomFactor", 2);
pref("ui.zoomedview.simplified", true); // Do not display all the zoomed view controls, do not use size heurisistic
pref("ui.touch.radius.enabled", false);
pref("ui.touch.radius.leftmm", 3);
pref("ui.touch.radius.topmm", 5);
pref("ui.touch.radius.rightmm", 3);
pref("ui.touch.radius.bottommm", 2);
pref("ui.touch.radius.visitedWeight", 120);
pref("ui.mouse.radius.enabled", false);
pref("ui.mouse.radius.leftmm", 3);
pref("ui.mouse.radius.topmm", 5);
pref("ui.mouse.radius.rightmm", 3);
pref("ui.mouse.radius.bottommm", 2);
pref("ui.mouse.radius.visitedWeight", 120);
pref("ui.mouse.radius.reposition", true);
// The percentage of the screen that needs to be scrolled before toolbar
// manipulation is allowed.
pref("browser.ui.scroll-toolbar-threshold", 10);
// Maximum distance from the point where the user pressed where we still
// look for text to select
pref("browser.ui.selection.distance", 250);
// plugins
pref("plugin.disable", false);
pref("dom.ipc.plugins.enabled", false);
// This pref isn't actually used anymore, but we're leaving this here to avoid changing
// the default so that we can migrate a user-set pref. See bug 885357.
pref("plugins.click_to_play", true);
// The default value for nsIPluginTag.enabledState (STATE_CLICKTOPLAY = 1)
pref("plugin.default.state", 1);
// product URLs
// The breakpad report server to link to in about:crashes
pref("breakpad.reportURL", "https://crash-stats.mozilla.com/report/index/");
pref("app.support.baseURL", "https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/");
pref("app.supportURL", "https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/mobile-help");
pref("app.faqURL", "https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/faq");
// URL for feedback page
// This should be kept in sync with the "feedback_link" string defined in strings.xml.in
pref("app.feedbackURL", "https://input.mozilla.org/feedback/android/%VERSION%/%CHANNEL%/?utm_source=feedback-prompt");
pref("app.privacyURL", "https://www.mozilla.org/privacy/firefox/");
pref("app.creditsURL", "https://www.mozilla.org/credits/");
pref("app.channelURL", "https://www.mozilla.org/%LOCALE%/firefox/channel/");
#if MOZ_UPDATE_CHANNEL == aurora
pref("app.releaseNotesURL", "https://www.mozilla.com/%LOCALE%/mobile/%VERSION%/auroranotes/");
#elif MOZ_UPDATE_CHANNEL == beta
pref("app.releaseNotesURL", "https://www.mozilla.com/%LOCALE%/mobile/%VERSION%beta/releasenotes/");
#else
pref("app.releaseNotesURL", "https://www.mozilla.com/%LOCALE%/mobile/%VERSION%/releasenotes/");
#endif
// Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror)
pref("security.alternate_certificate_error_page", "certerror");
pref("security.warn_viewing_mixed", false); // Warning is disabled. See Bug 616712.
// Block insecure active content on https pages
pref("security.mixed_content.block_active_content", true);
// Enable pinning
pref("security.cert_pinning.enforcement_level", 1);
// Only fetch OCSP for EV certificates
pref("security.OCSP.enabled", 2);
// Override some named colors to avoid inverse OS themes
pref("ui.-moz-dialog", "#efebe7");
pref("ui.-moz-dialogtext", "#101010");
pref("ui.-moz-field", "#fff");
pref("ui.-moz-fieldtext", "#1a1a1a");
pref("ui.-moz-buttonhoverface", "#f3f0ed");
pref("ui.-moz-buttonhovertext", "#101010");
pref("ui.-moz-combobox", "#fff");
pref("ui.-moz-comboboxtext", "#101010");
pref("ui.buttonface", "#ece7e2");
pref("ui.buttonhighlight", "#fff");
pref("ui.buttonshadow", "#aea194");
pref("ui.buttontext", "#101010");
pref("ui.captiontext", "#101010");
pref("ui.graytext", "#b1a598");
pref("ui.highlight", "#fad184");
pref("ui.highlighttext", "#1a1a1a");
pref("ui.infobackground", "#f5f5b5");
pref("ui.infotext", "#000");
pref("ui.menu", "#f7f5f3");
pref("ui.menutext", "#101010");
pref("ui.threeddarkshadow", "#000");
pref("ui.threedface", "#ece7e2");
pref("ui.threedhighlight", "#fff");
pref("ui.threedlightshadow", "#ece7e2");
pref("ui.threedshadow", "#aea194");
pref("ui.window", "#efebe7");
pref("ui.windowtext", "#101010");
pref("ui.windowframe", "#efebe7");
/* prefs used by the update timer system (including blocklist pings) */
pref("app.update.timerFirstInterval", 30000); // milliseconds
pref("app.update.timerMinimumDelay", 30); // seconds
// used by update service to decide whether or not to
// automatically download an update
pref("app.update.autodownload", "wifi");
pref("app.update.url.android", "https://aus5.mozilla.org/update/4/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%MOZ_VERSION%/update.xml");
#ifdef MOZ_UPDATER
/* prefs used specifically for updating the app */
pref("app.update.enabled", false);
pref("app.update.channel", "@MOZ_UPDATE_CHANNEL@");
#endif
// replace newlines with spaces on paste into single-line text boxes
pref("editor.singleLine.pasteNewlines", 2);
// threshold where a tap becomes a drag, in 1/240" reference pixels
// The names of the preferences are to be in sync with EventStateManager.cpp
pref("ui.dragThresholdX", 25);
pref("ui.dragThresholdY", 25);
pref("layers.acceleration.disabled", false);
pref("layers.async-video.enabled", true);
pref("apz.content_response_timeout", 600);
pref("apz.allow_immediate_handoff", false);
pref("apz.touch_start_tolerance", "0.06");
pref("apz.axis_lock.breakout_angle", "0.7853982"); // PI / 4 (45 degrees)
// APZ physics settings reviewed by UX
pref("apz.axis_lock.mode", 1); // Use "strict" axis locking
pref("apz.fling_curve_function_x1", "0.59");
pref("apz.fling_curve_function_y1", "0.46");
pref("apz.fling_curve_function_x2", "0.05");
pref("apz.fling_curve_function_y2", "1.00");
pref("apz.fling_curve_threshold_inches_per_ms", "0.01");
// apz.fling_friction and apz.fling_stopped_threshold are currently ignored by Fennec.
pref("apz.fling_friction", "0.004");
pref("apz.fling_stopped_threshold", "0.0");
pref("apz.max_velocity_inches_per_ms", "0.07");
pref("apz.fling_accel_interval_ms", 750);
pref("apz.overscroll.enabled", true);
pref("layers.progressive-paint", true);
pref("layers.low-precision-buffer", true);
pref("layers.low-precision-resolution", "0.25");
pref("layers.low-precision-opacity", "1.0");
// We want to limit layers for two reasons:
// 1) We can't scroll smoothly if we have to many draw calls
// 2) Pages that have too many layers consume too much memory and crash.
// By limiting the number of layers on mobile we're making the main thread
// work harder keep scrolling smooth and memory low.
pref("layers.max-active", 20);
pref("notification.feature.enabled", true);
pref("dom.webnotifications.enabled", true);
// prevent tooltips from showing up
pref("browser.chrome.toolbar_tips", false);
// don't allow meta-refresh when backgrounded
pref("browser.meta_refresh_when_inactive.disabled", true);
// prevent video elements from preloading too much data
pref("media.preload.default", 1); // default to preload none
pref("media.preload.auto", 2); // preload metadata if preload=auto
pref("media.cache_size", 32768); // 32MB media cache
// Try to save battery by not resuming reading from a connection until we fall
// below 10s of buffered data.
pref("media.cache_resume_threshold", 10);
pref("media.cache_readahead_limit", 30);
// Number of video frames we buffer while decoding video.
// On Android this is decided by a similar value which varies for
// each OMX decoder |OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountMin|. This
// number must be less than the OMX equivalent or gecko will think it is
// chronically starved of video frames. All decoders seen so far have a value
// of at least 4.
pref("media.video-queue.default-size", 3);
// Enable the MediaCodec PlatformDecoderModule by default.
pref("media.android-media-codec.enabled", true);
pref("media.android-media-codec.preferred", true);
// Run decoder in seperate process.
pref("media.android-remote-codec.enabled", false);
// Enable MSE
pref("media.mediasource.enabled", true);
pref("media.mediadrm-widevinecdm.visible", true);
#ifdef MOZ_EME
// Enable EME(Encrypted media extensions?)
pref("media.eme.enabled", false);
pref("media.eme.apiVisible", false);
#endif
// optimize images memory usage
pref("image.downscale-during-decode.enabled", true);
#ifdef MOZ_SAFE_BROWSING
pref("browser.safebrowsing.downloads.enabled", false);
pref("browser.safebrowsing.id", @MOZ_APP_UA_NAME@);
#endif
// True if this is the first time we are showing about:firstrun
pref("browser.firstrun.show.uidiscovery", true);
pref("browser.firstrun.show.localepicker", false);
// True if you always want dump() to work
//
// On Android, you also need to do the following for the output
// to show up in logcat:
//
// $ adb shell stop
// $ adb shell setprop log.redirect-stdio true
// $ adb shell start
pref("browser.dom.window.dump.enabled", true);
// controls if we want camera support
pref("device.camera.enabled", true);
pref("media.realtime_decoder.enabled", true);
pref("javascript.options.showInConsole", true);
pref("full-screen-api.enabled", true);
pref("direct-texture.force.enabled", false);
pref("direct-texture.force.disabled", false);
// This fraction in 1000ths of velocity remains after every animation frame when the velocity is low.
pref("ui.scrolling.friction_slow", -1);
// This fraction in 1000ths of velocity remains after every animation frame when the velocity is high.
pref("ui.scrolling.friction_fast", -1);
// The maximum velocity change factor between events, per ms, in 1000ths.
// Direction changes are excluded.
pref("ui.scrolling.max_event_acceleration", -1);
// The rate of deceleration when the surface has overscrolled, in 1000ths.
pref("ui.scrolling.overscroll_decel_rate", -1);
// The fraction of the surface which can be overscrolled before it must snap back, in 1000ths.
pref("ui.scrolling.overscroll_snap_limit", -1);
// The minimum amount of space that must be present for an axis to be considered scrollable,
// in 1/1000ths of pixels.
pref("ui.scrolling.min_scrollable_distance", -1);
// The axis lock mode for panning behaviour - set between standard, free and sticky
pref("ui.scrolling.axis_lock_mode", "standard");
// Negate scroll, true will make the mouse scroll wheel move the screen the same direction as with most desktops or laptops.
pref("ui.scrolling.negate_wheel_scroll", true);
// Determine the dead zone for gamepad joysticks. Higher values result in larger dead zones; use a negative value to
// auto-detect based on reported hardware values
pref("ui.scrolling.gamepad_dead_zone", 115);
// Prefs for fling acceleration
pref("ui.scrolling.fling_accel_interval", -1);
pref("ui.scrolling.fling_accel_base_multiplier", -1);
pref("ui.scrolling.fling_accel_supplemental_multiplier", -1);
// Prefs for fling curving
pref("ui.scrolling.fling_curve_function_x1", -1);
pref("ui.scrolling.fling_curve_function_y1", -1);
pref("ui.scrolling.fling_curve_function_x2", -1);
pref("ui.scrolling.fling_curve_function_y2", -1);
pref("ui.scrolling.fling_curve_threshold_velocity", -1);
pref("ui.scrolling.fling_curve_max_velocity", -1);
pref("ui.scrolling.fling_curve_newton_iterations", -1);
// Enable accessibility mode if platform accessibility is enabled.
pref("accessibility.accessfu.activate", 2);
pref("accessibility.accessfu.quicknav_modes", "Link,Heading,FormElement,Landmark,ListItem");
// Active quicknav mode, index value of list from quicknav_modes
pref("accessibility.accessfu.quicknav_index", 0);
// Setting for an utterance order (0 - description first, 1 - description last).
pref("accessibility.accessfu.utterance", 1);
// Whether to skip images with empty alt text
pref("accessibility.accessfu.skip_empty_images", true);
// Transmit UDP busy-work to the LAN when anticipating low latency
// network reads and on wifi to mitigate 802.11 Power Save Polling delays
pref("network.tickle-wifi.enabled", true);
// Mobile manages state by autodetection
pref("network.manage-offline-status", true);
// increase the timeout clamp for background tabs to 15 minutes
pref("dom.min_background_timeout_value", 900000);
// Media plugins for libstagefright playback on android
pref("media.plugins.enabled", true);
// Stagefright's OMXCodec::CreationFlags. The interesting flag values are:
// 0 = Let Stagefright choose hardware or software decoding (default)
// 8 = Force software decoding
// 16 = Force hardware decoding
pref("media.stagefright.omxcodec.flags", 0);
// Coalesce touch events to prevent them from flooding the event queue
pref("dom.event.touch.coalescing.enabled", false);
// default orientation for the app, default to undefined
// the java GeckoScreenOrientationListener needs this to be defined
pref("app.orientation.default", "");
// On memory pressure, release dirty but unused pages held by jemalloc
// back to the system.
pref("memory.free_dirty_pages", true);
pref("layout.framevisibility.numscrollportwidths", 1);
pref("layout.framevisibility.numscrollportheights", 1);
pref("layers.enable-tiles", true);
// Enable the dynamic toolbar
pref("browser.chrome.dynamictoolbar", true);
// Hide common parts of URLs like "www." or "http://"
pref("browser.urlbar.trimURLs", true);
#ifdef MOZ_PKG_SPECIAL
// Disable webgl on ARMv6 because running the reftests takes
// too long for some reason (bug 843738)
pref("webgl.disabled", true);
#endif
// initial web feed readers list
pref("browser.contentHandlers.types.0.title", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.0.uri", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.0.type", "application/vnd.mozilla.maybe.feed");
pref("browser.contentHandlers.types.1.title", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.1.uri", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.1.type", "application/vnd.mozilla.maybe.feed");
pref("browser.contentHandlers.types.2.title", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.2.uri", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.2.type", "application/vnd.mozilla.maybe.feed");
pref("browser.contentHandlers.types.3.title", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.3.uri", "chrome://browser/locale/region.properties");
pref("browser.contentHandlers.types.3.type", "application/vnd.mozilla.maybe.feed");
// Shortnumber matching needed for e.g. Brazil:
// 01187654321 can be found with 87654321
pref("dom.phonenumber.substringmatching.BR", 8);
pref("dom.phonenumber.substringmatching.CO", 10);
pref("dom.phonenumber.substringmatching.VE", 7);
// Enable hardware-accelerated Skia canvas
pref("gfx.canvas.azure.backends", "skia");
pref("gfx.canvas.azure.accelerated", true);
// See ua-update.json.in for the packaged UA override list
pref("general.useragent.updates.enabled", true);
pref("general.useragent.updates.url", "https://dynamicua.cdn.mozilla.net/0/%APP_ID%");
pref("general.useragent.updates.interval", 604800); // 1 week
pref("general.useragent.updates.retry", 86400); // 1 day
// When true, phone number linkification is enabled.
pref("browser.ui.linkify.phone", false);
// Enables/disables Spatial Navigation
pref("snav.enabled", true);
// This url, if changed, MUST continue to point to an https url. Pulling arbitrary content to inject into
// this page over http opens us up to a man-in-the-middle attack that we'd rather not face. If you are a downstream
// repackager of this code using an alternate snippet url, please keep your users safe
pref("browser.snippets.updateUrl", "https://snippets.cdn.mozilla.net/json/%SNIPPETS_VERSION%/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/");
// How frequently we check for new snippets, in seconds (1 day)
pref("browser.snippets.updateInterval", 86400);
// URL used to check for user's country code. Please do not directly use this code or Snippets key.
// Contact MLS team for your own credentials. https://location.services.mozilla.com/contact
pref("browser.snippets.geoUrl", "https://location.services.mozilla.com/v1/country?key=fff72d56-b040-4205-9a11-82feda9d83a3");
// URL used to ping metrics with stats about which snippets have been shown
pref("browser.snippets.statsUrl", "https://snippets-stats.mozilla.org/mobile");
// These prefs require a restart to take effect.
pref("browser.snippets.enabled", true);
pref("browser.snippets.syncPromo.enabled", true);
pref("browser.snippets.firstrunHomepage.enabled", true);
// The mode of home provider syncing.
// 0: Sync always
// 1: Sync only when on wifi
pref("home.sync.updateMode", 0);
// How frequently to check if we should sync home provider data.
pref("home.sync.checkIntervalSecs", 3600);
// Enable device storage API
pref("device.storage.enabled", true);
// Enable meta-viewport support for font inflation code
pref("dom.meta-viewport.enabled", true);
// Enable GMP support in the addon manager.
pref("media.gmp-provider.enabled", true);
// The default color scheme in reader mode (light, dark, auto)
// auto = color automatically adjusts according to ambient light level
// (auto only works on platforms where the 'devicelight' event is enabled)
pref("reader.color_scheme", "auto");
// Color scheme values available in reader mode UI.
pref("reader.color_scheme.values", "[\"dark\",\"auto\",\"light\"]");
// Whether to use a vertical or horizontal toolbar.
pref("reader.toolbar.vertical", false);
// Telemetry settings.
// Whether to use the unified telemetry behavior, requires a restart.
pref("toolkit.telemetry.unified", false);
// Unified AccessibleCarets (touch-caret and selection-carets).
pref("layout.accessiblecaret.enabled", true);
// AccessibleCaret CSS for the Android L style assets.
pref("layout.accessiblecaret.width", "22.0");
pref("layout.accessiblecaret.height", "22.0");
pref("layout.accessiblecaret.margin-left", "-11.5");
// Android needs to show the caret when long tapping on an empty content.
pref("layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content", true);
// Androids carets are always tilt to match the text selection guideline.
pref("layout.accessiblecaret.always_tilt", true);
// Selection change notifications generated by Javascript changes
// update active AccessibleCarets / UI interactions.
pref("layout.accessiblecaret.allow_script_change_updates", true);
// Optionally provide haptic feedback on longPress selection events.
pref("layout.accessiblecaret.hapticfeedback", true);
// Initial text selection on long-press is enhanced to provide
// a smarter phone-number selection for direct-dial ActionBar action.
pref("layout.accessiblecaret.extend_selection_for_phone_number", true);
// Disable sending console to logcat on release builds.
#ifdef RELEASE_OR_BETA
pref("consoleservice.logcat", false);
#else
pref("consoleservice.logcat", true);
#endif
#ifndef RELEASE_OR_BETA
// Enable VR on mobile, making it enable by default.
pref("dom.vr.enabled", true);
#endif
pref("browser.tabs.showAudioPlayingIcon", true);
pref("dom.serviceWorkers.enabled", false);
pref("dom.serviceWorkers.interception.enabled", false);
pref("dom.serviceWorkers.openWindow.enabled", false);
pref("dom.push.debug", false);
// The upstream autopush endpoint must have the Google API key corresponding to
// the App's sender ID; we bake this assumption directly into the URL.
pref("dom.push.serverURL", "https://updates.push.services.mozilla.com/v1/gcm/@MOZ_ANDROID_GCM_SENDERID@");
pref("dom.push.maxRecentMessageIDsPerSubscription", 0);
#ifdef MOZ_ANDROID_GCM
pref("dom.push.enabled", false);
#endif
// Enable Presentation API
pref("dom.presentation.enabled", false);
pref("dom.presentation.discovery.enabled", true);
pref("dom.presentation.discovery.legacy.enabled", true); // for TV 2.5 backward capability
pref("dom.audiochannel.audioCompeting", true);
pref("dom.audiochannel.mediaControl", true);
// Space separated list of URLS that are allowed to send objects (instead of
// only strings) through webchannels. This list is duplicated in browser/app/profile/firefox.js
pref("webchannel.allowObject.urlWhitelist", "https://accounts.firefox.com https://content.cdn.mozilla.net https://input.mozilla.org https://support.mozilla.org https://install.mozilla.org");
pref("media.openUnsupportedTypeWithExternalApp", true);

View file

@ -1,30 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
for var in ('APP_NAME', 'APP_VERSION'):
DEFINES[var] = CONFIG['MOZ_%s' % var]
for var in ('MOZ_UPDATER', 'MOZ_APP_UA_NAME', 'ANDROID_PACKAGE_NAME'):
DEFINES[var] = CONFIG[var]
for var in ('MOZ_ANDROID_GCM', ):
if CONFIG[var]:
DEFINES[var] = 1
for var in ('MOZ_ANDROID_GCM_SENDERID', ):
if CONFIG[var]:
DEFINES[var] = CONFIG[var]
if CONFIG['MOZ_PKG_SPECIAL']:
DEFINES['MOZ_PKG_SPECIAL'] = CONFIG['MOZ_PKG_SPECIAL']
JS_PREFERENCE_PP_FILES += [
'mobile.js',
]
FINAL_TARGET_PP_FILES += [
'ua-update.json.in',
]

View file

@ -1,33 +0,0 @@
buildDir "${topobjdir}/gradle/build/mobile/android/omnijar"
apply plugin: 'java'
// This project is a dummy project; the JAR produced is not used. The :app
// project uses the set of inputs here to check if the omnijar needs to be
// rebuilt. By listing them here as resource directories, IntelliJ labels each
// checked directly nicely. Why list the directories here? There's a mismatch
// between SourceDirectorySet and TaskInputs: the former is directory oriented,
// while the latter is more general. That means its easy to convert this list
// into inputs for :app, but not vice-versa. Sadly this implies that :app
// evaluation depends on :omnijar, but the evaluation overhead is low enough
// that we accept it.
sourceSets {
main {
// Depend on the Gecko resources in mobile/android.
resources {
srcDir "${topsrcdir}/mobile/android/chrome"
srcDir "${topsrcdir}/mobile/android/components"
srcDir "${topsrcdir}/mobile/android/locales"
srcDir "${topsrcdir}/mobile/android/modules"
srcDir "${topsrcdir}/mobile/android/themes"
srcDir "${topsrcdir}/toolkit"
}
}
}
apply plugin: 'idea'
idea {
module {
}
}

View file

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mozilla.roboexample.test"
android:sharedUserId="${MOZ_ANDROID_SHARED_ID}"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="${MOZ_ANDROID_MIN_SDK_VERSION}"
android:targetSdkVersion="23"/>
<!-- TODO: re-instate maxSdkVersion. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<instrumentation
android:name="org.mozilla.gecko.FennecInstrumentationTestRunner"
android:targetPackage="${ANDROID_PACKAGE_NAME}" />
<application
android:label="@string/app_name">
<uses-library android:name="android.test.runner" />
<!-- Fake handlers to ensure that we have some share intents to show in our share handler list -->
<activity android:name="org.mozilla.gecko.RobocopShare1"
android:label="Robocop fake activity">
<intent-filter android:label="Fake robocop share handler 1">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
<activity android:name="org.mozilla.gecko.RobocopShare2"
android:label="Robocop fake activity 2">
<intent-filter android:label="Fake robocop share handler 2">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
<activity android:name="org.mozilla.gecko.LaunchFennecWithConfigurationActivity"
android:label="Robocop Fennec">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -1,27 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
package org.mozilla.gecko;
import android.app.Application;
import org.robolectric.TestLifecycleApplication;
import java.lang.reflect.Method;
/**
* GeckoApplication isn't test-lifecycle friendly: onCreate is called multiple times, which
* re-registers Gecko event listeners, which fails. This class is magically named so that
* Robolectric uses it instead of the application defined in the Android manifest. See
* http://robolectric.blogspot.ca/2013/04/the-test-lifecycle-in-20.html.
*/
public class TestGeckoApplication extends Application implements TestLifecycleApplication {
@Override public void beforeTest(Method method) {
}
@Override public void prepareTest(Object test) {
}
@Override public void afterTest(Method method) {
}
}

View file

@ -1,15 +0,0 @@
#filter slashslash
// Everything after the first // on a line will be removed by the preproccesor.
// Send these sites a custom user-agent. Bugs should be included with an entry.
// NOTE: trailing commas are not valid JSON and will prevent the CDN from syncing.
{
"weather.yahoo.co.jp": "Mozilla/5.0 (Linux; Android 5.0.2; Galaxy Nexus Build/IMM76B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.93 Mobile Safari/537.36",
// bug 1177298, lohaco.jp
"lohaco.jp": "Mozilla/5.0 (Linux; Android 5.0.2; Galaxy Nexus Build/IMM76B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.93 Mobile Safari/537.36",
// bug 1177298, www.nhk.or.jp
"nhk.or.jp": "\\)\\s# AppleWebKit ",
// bug 1177298, uniqlo.com
"uniqlo.com": "\\)\\s#) Mobile Safari ",
// bug 1338260, directv.com
"directv.com": "Mozilla/5.0 (Linux; Android 6.0.1; SM-G920F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Mobile Safari/537.36"
}

View file

@ -1,32 +0,0 @@
//#filter substitution
//#include @OBJDIR@/adjust_sdk_app_token
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
import org.mozilla.gecko.adjust.AdjustHelperInterface;
//#ifdef MOZ_INSTALL_TRACKING
import org.mozilla.gecko.adjust.AdjustHelper;
//#else
import org.mozilla.gecko.adjust.StubAdjustHelper;
//#endif
public class AdjustConstants {
public static final String MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN =
//#ifdef MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN
"@MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN@";
//#else
null;
//#endif
public static AdjustHelperInterface getAdjustHelper() {
//#ifdef MOZ_INSTALL_TRACKING
return new AdjustHelper();
//#else
return new StubAdjustHelper();
//#endif
}
}

View file

@ -1,433 +0,0 @@
#filter substitution
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="@ANDROID_PACKAGE_NAME@"
android:installLocation="auto"
android:versionCode="@ANDROID_VERSION_CODE@"
android:versionName="@MOZ_APP_VERSION@"
#ifdef MOZ_ANDROID_SHARED_ID
android:sharedUserId="@MOZ_ANDROID_SHARED_ID@"
#endif
>
<uses-sdk android:minSdkVersion="@MOZ_ANDROID_MIN_SDK_VERSION@"
#ifdef MOZ_ANDROID_MAX_SDK_VERSION
android:maxSdkVersion="@MOZ_ANDROID_MAX_SDK_VERSION@"
#endif
android:targetSdkVersion="23"/>
<!-- The bouncer APK and the main APK should define the same set of
<permission>, <uses-permission>, and <uses-feature> elements. This reduces
the likelihood of permission-related surprises when installing the main APK
on top of a pre-installed bouncer APK. Add such shared elements in the
fileincluded here, so that they can be referenced by both APKs. -->
#include FennecManifest_permissions.xml.in
<application android:label="@string/moz_app_displayname"
android:icon="@drawable/icon"
android:logo="@drawable/logo"
android:name="@MOZ_ANDROID_APPLICATION_CLASS@"
android:hardwareAccelerated="true"
android:allowBackup="false"
# The preprocessor does not yet support arbitrary parentheses, so this cannot
# be parenthesized thus to clarify that the logical AND operator has precedence:
# !defined(MOZILLA_OFFICIAL) || (defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG))
#if !defined(MOZILLA_OFFICIAL) || defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG)
android:debuggable="true">
#else
android:debuggable="false">
#endif
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
#ifdef MOZ_NATIVE_DEVICES
<!-- This resources comes from Google Play Services. Required for casting support. -->
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<service android:name="org.mozilla.gecko.RemotePresentationService" android:exported="false"/>
#endif
<!-- This activity handles all incoming Intents and dispatches them to other activities. -->
<activity android:name="org.mozilla.gecko.LauncherActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:relinquishTaskIdentity="true"
android:taskAffinity=""
android:excludeFromRecents="true" />
<!-- Fennec is shipped as the Android package named
org.mozilla.{fennec,firefox,firefox_beta}. The internal Java
package hierarchy inside the Android package used to have an
org.mozilla.{fennec,firefox,firefox_beta} subtree *and* an
org.mozilla.gecko subtree; it now only has org.mozilla.gecko. -->
<activity android:name="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
android:label="@string/moz_app_displayname"
android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
android:alwaysRetainTaskState="true"
android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
android:windowSoftInputMode="stateUnspecified|adjustResize"
android:launchMode="singleTask"
android:exported="true"
android:theme="@style/Gecko.App" />
<!-- Bug 1256615 / Bug 1268455: We published an .App alias and we need to maintain it
forever. If we don't, home screen shortcuts will disappear because the intent
filter details change. -->
<activity-alias android:name=".App"
android:label="@MOZ_APP_DISPLAYNAME@"
android:targetActivity="org.mozilla.gecko.LauncherActivity">
<!-- android:priority ranges between -1000 and 1000. We never want
another activity to usurp the MAIN action, so we ratchet our
priority up. -->
<intent-filter android:priority="999">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
<category android:name="android.intent.category.APP_BROWSER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="about" />
<data android:scheme="javascript" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:mimeType="text/html"/>
<data android:mimeType="text/plain"/>
<data android:mimeType="application/xhtml+xml"/>
</intent-filter>
<meta-data android:name="com.sec.minimode.icon.portrait.normal"
android:resource="@drawable/icon"/>
<meta-data android:name="com.sec.minimode.icon.landscape.normal"
android:resource="@drawable/icon" />
<intent-filter>
<action android:name="org.mozilla.gecko.ACTION_ALERT_CALLBACK" />
</intent-filter>
<intent-filter>
<action android:name="org.mozilla.gecko.GUEST_SESSION_INPROGRESS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="org.mozilla.gecko.UPDATE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
<!-- For XPI installs from websites and the download manager. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:mimeType="application/x-xpinstall" />
</intent-filter>
<!-- For XPI installs from file: URLs. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="" />
<data android:scheme="file" />
<data android:pathPattern=".*\\.xpi" />
</intent-filter>
#ifdef MOZ_ANDROID_BEAM
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
#endif
<!-- For debugging -->
<intent-filter>
<action android:name="org.mozilla.gecko.DEBUG" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity-alias>
<service android:name="org.mozilla.gecko.GeckoService" />
<activity android:name="org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt"
android:launchMode="singleTop"
android:theme="@style/OverlayActivity" />
<activity android:name="org.mozilla.gecko.promotion.SimpleHelperUI"
android:launchMode="singleTop"
android:theme="@style/OverlayActivity" />
<activity android:name="org.mozilla.gecko.promotion.HomeScreenPrompt"
android:launchMode="singleTop"
android:theme="@style/OverlayActivity" />
<!-- The main reason for the Tab Queue build flag is to not mess with the VIEW intent filter
before the rest of the plumbing is in place -->
<service android:name="org.mozilla.gecko.tabqueue.TabQueueService" />
<activity android:name="org.mozilla.gecko.tabqueue.TabQueuePrompt"
android:launchMode="singleTop"
android:theme="@style/OverlayActivity" />
<receiver android:name="org.mozilla.gecko.restrictions.RestrictionProvider">
<intent-filter>
<action android:name="android.intent.action.GET_RESTRICTION_ENTRIES" />
</intent-filter>
</receiver>
<!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
<activity-alias
android:name="com.android.internal.app.ResolverActivity"
android:targetActivity="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
android:exported="true" />
<receiver android:name="org.mozilla.gecko.GeckoUpdateReceiver">
<intent-filter>
<action android:name="@ANDROID_PACKAGE_NAME@.CHECK_UPDATE_RESULT" />
</intent-filter>
</receiver>
<receiver android:name="org.mozilla.gecko.GeckoMessageReceiver"
android:exported="false">
</receiver>
<!-- Catch install referrer so we can do post-install work. -->
<receiver android:name="org.mozilla.gecko.distribution.ReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service android:name="org.mozilla.gecko.Restarter"
android:exported="false"
android:process="@MANGLED_ANDROID_PACKAGE_NAME@.Restarter">
</service>
<service android:name="org.mozilla.gecko.media.MediaControlService"
android:exported="false">
</service>
<receiver android:name="org.mozilla.gecko.AlarmReceiver" >
</receiver>
<receiver
android:name="org.mozilla.gecko.notifications.WhatsNewReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data android:scheme="package" android:path="org.mozilla.gecko" />
</intent-filter>
</receiver>
<receiver
android:name="org.mozilla.gecko.notifications.NotificationReceiver"
android:exported="false">
<!-- Notification API V2 -->
<intent-filter>
<action android:name="@ANDROID_PACKAGE_NAME@.helperBroadcastAction" />
<action android:name="@ANDROID_PACKAGE_NAME@.NOTIFICATION_CLICK" />
<action android:name="@ANDROID_PACKAGE_NAME@.NOTIFICATION_CLOSE" />
<data android:scheme="moz-notification" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
#include ../services/manifests/FxAccountAndroidManifest_activities.xml.in
#ifdef MOZ_ANDROID_SEARCH_ACTIVITY
#include ../search/manifests/SearchAndroidManifest_activities.xml.in
#endif
<activity android:name="org.mozilla.gecko.preferences.GeckoPreferences"
android:theme="@style/Gecko.Preferences"
android:configChanges="orientation|screenSize|locale|layoutDirection"
android:excludeFromRecents="true"/>
<provider android:name="org.mozilla.gecko.db.BrowserProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.db.browser"
android:exported="false"/>
<provider android:name="org.mozilla.gecko.distribution.PartnerBookmarksProviderProxy"
android:authorities="@ANDROID_PACKAGE_NAME@.partnerbookmarks"
android:exported="false"/>
<!-- Share overlay activity
Setting launchMode="singleTop" ensures onNewIntent is called when the Activity is
reused. Ideally we create a new instance but Android L breaks this (bug 1137928). -->
<activity android:name="org.mozilla.gecko.overlays.ui.ShareDialog"
android:label="@string/overlay_share_label"
android:theme="@style/OverlayActivity"
android:configChanges="keyboard|keyboardHidden|mcc|mnc|locale|layoutDirection"
android:launchMode="singleTop"
android:windowSoftInputMode="stateAlwaysHidden|adjustResize">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
#ifdef MOZ_ANDROID_CUSTOM_TABS
<activity android:name="org.mozilla.gecko.customtabs.CustomTabsActivity"
android:theme="@style/Theme.AppCompat.NoActionBar" />
#endif
<!-- Service to handle requests from overlays. -->
<service android:name="org.mozilla.gecko.overlays.service.OverlayActionService" />
<!--
Ensure that passwords provider runs in its own process. (Bug 718760.)
Process name is per-application to avoid loading CPs from multiple
Fennec versions into the same process. (Bug 749727.)
Process name is a mangled version to avoid a Talos bug. (Bug 750548.)
-->
<provider android:name="org.mozilla.gecko.db.PasswordsProvider"
android:label="@string/sync_configure_engines_title_passwords"
android:authorities="@ANDROID_PACKAGE_NAME@.db.passwords"
android:exported="false"
android:process="@MANGLED_ANDROID_PACKAGE_NAME@.PasswordsProvider"/>
<provider android:name="org.mozilla.gecko.db.LoginsProvider"
android:label="@string/sync_configure_engines_title_passwords"
android:authorities="@ANDROID_PACKAGE_NAME@.db.logins"
android:exported="false"/>
<provider android:name="org.mozilla.gecko.db.FormHistoryProvider"
android:label="@string/sync_configure_engines_title_history"
android:authorities="@ANDROID_PACKAGE_NAME@.db.formhistory"
android:exported="false"/>
<provider android:name="org.mozilla.gecko.GeckoProfilesProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.profiles"
android:exported="false"/>
<provider android:name="org.mozilla.gecko.db.TabsProvider"
android:label="@string/sync_configure_engines_title_tabs"
android:authorities="@ANDROID_PACKAGE_NAME@.db.tabs"
android:exported="false"/>
<provider android:name="org.mozilla.gecko.db.HomeProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.db.home"
android:exported="false"/>
<provider android:name="org.mozilla.gecko.db.SearchHistoryProvider"
android:authorities="@ANDROID_PACKAGE_NAME@.db.searchhistory"
android:exported="false"/>
<service
android:exported="false"
android:name="org.mozilla.gecko.updater.UpdateService"
android:process="@MANGLED_ANDROID_PACKAGE_NAME@.UpdateService">
</service>
<service
android:exported="false"
android:name="org.mozilla.gecko.notifications.NotificationService">
</service>
<service
android:exported="false"
android:name="org.mozilla.gecko.dlc.DownloadContentService">
</service>
<service
android:exported="false"
android:name="org.mozilla.gecko.feeds.FeedService">
</service>
<!-- DON'T EXPORT THIS, please! An attacker could delete arbitrary files. -->
<service
android:exported="false"
android:name="org.mozilla.gecko.cleanup.FileCleanupService">
</service>
<receiver
android:name="org.mozilla.gecko.feeds.FeedAlarmReceiver"
android:exported="false" />
<receiver
android:name="org.mozilla.gecko.BootReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<receiver
android:name="org.mozilla.gecko.PackageReplacedReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"></action>
</intent-filter>
</receiver>
<service
android:name="org.mozilla.gecko.telemetry.TelemetryUploadService"
android:exported="false"/>
#ifdef MOZ_ANDROID_CUSTOM_TABS
<service
android:name="org.mozilla.gecko.customtabs.GeckoCustomTabsService"
android:exported="true">
<intent-filter>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent-filter>
</service>
#endif
#include ../services/manifests/FxAccountAndroidManifest_services.xml.in
<service
android:name="org.mozilla.gecko.tabqueue.TabReceivedService"
android:exported="false" />
#ifdef MOZ_ANDROID_SEARCH_ACTIVITY
#include ../search/manifests/SearchAndroidManifest_services.xml.in
#endif
#ifdef MOZ_ANDROID_MLS_STUMBLER
#include ../stumbler/manifests/StumblerManifest_services.xml.in
#endif
#ifdef MOZ_ANDROID_GCM
#include GcmAndroidManifest_services.xml.in
#endif
<service
android:name="org.mozilla.gecko.media.MediaManager"
android:enabled="true"
android:exported="false"
android:process=":media"
android:isolatedProcess="false">
</service>
</application>
</manifest>

View file

@ -1,342 +0,0 @@
//#filter substitution
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
import android.content.Context;
import android.os.Build;
//#ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
import android.support.multidex.MultiDex;
//#endif
/**
* A collection of constants that pertain to the build and runtime state of the
* application. Typically these are sourced from build-time definitions (see
* Makefile.in). This is a Java-side substitute for nsIXULAppInfo, amongst
* other things.
*
* See also SysInfo.java, which includes some of the values available from
* nsSystemInfo inside Gecko.
*/
// Normally, we'd annotate with @RobocopTarget. Since AppConstants is compiled
// before RobocopTarget, we instead add o.m.g.AppConstants directly to the
// Proguard configuration.
public class AppConstants {
public static final String ANDROID_PACKAGE_NAME = "@ANDROID_PACKAGE_NAME@";
public static final String MANGLED_ANDROID_PACKAGE_NAME = "@MANGLED_ANDROID_PACKAGE_NAME@";
public static final String MOZ_ANDROID_SHARED_FXACCOUNT_TYPE = "@ANDROID_PACKAGE_NAME@_fxaccount";
/**
* Encapsulates access to compile-time version definitions, allowing
* for dead code removal for particular APKs.
*/
public static final class Versions {
public static final int MIN_SDK_VERSION = @MOZ_ANDROID_MIN_SDK_VERSION@;
public static final int MAX_SDK_VERSION =
//#ifdef MOZ_ANDROID_MAX_SDK_VERSION
@MOZ_ANDROID_MAX_SDK_VERSION@;
//#else
999;
//#endif
/*
* The SDK_INT >= N check can only pass if our MAX_SDK_VERSION is
* _greater than or equal_ to that number, because otherwise we
* won't be installed on the device.
*
* If MIN_SDK_VERSION is greater than or equal to the number, there
* is no need to do the runtime check.
*/
public static final boolean feature16Plus = MIN_SDK_VERSION >= 16 || (MAX_SDK_VERSION >= 16 && Build.VERSION.SDK_INT >= 16);
public static final boolean feature17Plus = MIN_SDK_VERSION >= 17 || (MAX_SDK_VERSION >= 17 && Build.VERSION.SDK_INT >= 17);
public static final boolean feature19Plus = MIN_SDK_VERSION >= 19 || (MAX_SDK_VERSION >= 19 && Build.VERSION.SDK_INT >= 19);
public static final boolean feature20Plus = MIN_SDK_VERSION >= 20 || (MAX_SDK_VERSION >= 20 && Build.VERSION.SDK_INT >= 20);
public static final boolean feature21Plus = MIN_SDK_VERSION >= 21 || (MAX_SDK_VERSION >= 21 && Build.VERSION.SDK_INT >= 21);
/*
* If our MIN_SDK_VERSION is 14 or higher, we must be an ICS device.
* If our MAX_SDK_VERSION is lower than ICS, we must not be an ICS device.
* Otherwise, we need a range check.
*/
public static final boolean preMarshmallow = MAX_SDK_VERSION < 23 || (MIN_SDK_VERSION < 23 && Build.VERSION.SDK_INT < 23);
public static final boolean preLollipop = MAX_SDK_VERSION < 21 || (MIN_SDK_VERSION < 21 && Build.VERSION.SDK_INT < 21);
public static final boolean preJBMR2 = MAX_SDK_VERSION < 18 || (MIN_SDK_VERSION < 18 && Build.VERSION.SDK_INT < 18);
public static final boolean preJBMR1 = MAX_SDK_VERSION < 17 || (MIN_SDK_VERSION < 17 && Build.VERSION.SDK_INT < 17);
public static final boolean preJB = MAX_SDK_VERSION < 16 || (MIN_SDK_VERSION < 16 && Build.VERSION.SDK_INT < 16);
public static final boolean preN = MAX_SDK_VERSION < 24 || (MIN_SDK_VERSION < 24 && Build.VERSION.SDK_INT < 24);
}
/**
* The name of the Java class that represents the android application.
*/
public static final String MOZ_ANDROID_APPLICATION_CLASS = "@MOZ_ANDROID_APPLICATION_CLASS@";
/**
* The name of the Java class that launches the browser activity.
*/
public static final String MOZ_ANDROID_BROWSER_INTENT_CLASS = "@MOZ_ANDROID_BROWSER_INTENT_CLASS@";
/**
* The name of the Java class that launches the search activity.
*/
public static final String MOZ_ANDROID_SEARCH_INTENT_CLASS = "@MOZ_ANDROID_SEARCH_INTENT_CLASS@";
public static final String GRE_MILESTONE = "@GRE_MILESTONE@";
public static final String MOZ_APP_ABI = "@MOZ_APP_ABI@";
public static final String MOZ_APP_BASENAME = "@MOZ_APP_BASENAME@";
// For the benefit of future archaeologists:
// GRE_BUILDID is exactly the same as MOZ_APP_BUILDID unless you're running
// on XULRunner, which is never the case on Android.
public static final String MOZ_APP_BUILDID = "@MOZ_BUILDID@";
public static final String MOZ_APP_ID = "@MOZ_APP_ID@";
public static final String MOZ_APP_NAME = "@MOZ_APP_NAME@";
public static final String MOZ_APP_VENDOR = "@MOZ_APP_VENDOR@";
public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@";
public static final String MOZ_APP_DISPLAYNAME = "@MOZ_APP_DISPLAYNAME@";
// MOZ_APP_UA_NAME is already quoted when it gets substituted, like MOZILLA_VERSION.
public static final String MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@;
// MOZILLA_VERSION is already quoted when it gets substituted in. If we
// add additional quotes we end up with ""x.y"", which is a syntax error.
public static final String MOZILLA_VERSION = @MOZILLA_VERSION@;
public static final String MOZ_MOZILLA_API_KEY = "@MOZ_MOZILLA_API_KEY@";
public static final boolean MOZ_STUMBLER_BUILD_TIME_ENABLED =
//#ifdef MOZ_ANDROID_MLS_STUMBLER
true;
//#else
false;
//#endif
public static final boolean MOZ_ANDROID_GCM =
//#ifdef MOZ_ANDROID_GCM
true;
//#else
false;
//#endif
public static final String MOZ_ANDROID_GCM_SENDERID =
//#ifdef MOZ_ANDROID_GCM_SENDERID
"@MOZ_ANDROID_GCM_SENDERID@";
//#else
null;
//#endif
public static final String MOZ_CHILD_PROCESS_NAME = "@MOZ_CHILD_PROCESS_NAME@";
public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@";
public static final String OMNIJAR_NAME = "@OMNIJAR_NAME@";
public static final String OS_TARGET = "@OS_TARGET@";
public static final String TARGET_XPCOM_ABI = @TARGET_XPCOM_ABI@;
public static final String USER_AGENT_BOT_LIKE = "Redirector/" + AppConstants.MOZ_APP_VERSION +
" (Android; rv:" + AppConstants.MOZ_APP_VERSION + ")";
public static final String USER_AGENT_FENNEC_MOBILE = "Mozilla/5.0 (Android " +
Build.VERSION.RELEASE + "; Mobile; rv:" +
AppConstants.MOZ_APP_VERSION + ") Gecko/" +
AppConstants.MOZ_APP_VERSION + " Firefox/" +
AppConstants.MOZ_APP_VERSION;
public static final String USER_AGENT_FENNEC_TABLET = "Mozilla/5.0 (Android " +
Build.VERSION.RELEASE + "; Tablet; rv:" +
AppConstants.MOZ_APP_VERSION + ") Gecko/" +
AppConstants.MOZ_APP_VERSION + " Firefox/" +
AppConstants.MOZ_APP_VERSION;
public static final int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@;
public static final boolean MOZ_ANDROID_ANR_REPORTER =
//#ifdef MOZ_ANDROID_ANR_REPORTER
true;
//#else
false;
//#endif
public static final String MOZ_PKG_SPECIAL =
//#ifdef MOZ_PKG_SPECIAL
"@MOZ_PKG_SPECIAL@";
//#else
null;
//#endif
public static final boolean MOZ_EXCLUDE_HYPHENATION_DICTIONARIES =
//#ifdef MOZ_EXCLUDE_HYPHENATION_DICTIONARIES
true;
//#else
false;
//#endif
public static final boolean MOZ_SERVICES_HEALTHREPORT =
//#ifdef MOZ_SERVICES_HEALTHREPORT
true;
//#else
false;
//#endif
public static final boolean MOZ_TELEMETRY_ON_BY_DEFAULT =
//#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
true;
//#else
false;
//#endif
public static final String TELEMETRY_PREF_NAME =
"toolkit.telemetry.enabled";
public static final boolean MOZ_TELEMETRY_REPORTING =
//#ifdef MOZ_TELEMETRY_REPORTING
true;
//#else
false;
//#endif
public static final boolean MOZ_DATA_REPORTING =
//#ifdef MOZ_DATA_REPORTING
true;
//#else
false;
//#endif
public static final boolean MOZ_LOCALE_SWITCHER =
//#ifdef MOZ_LOCALE_SWITCHER
true;
//#else
false;
//#endif
public static final boolean MOZ_UPDATER =
//#ifdef MOZ_UPDATER
true;
//#else
false;
//#endif
// Android Beam is only supported on API14+, so we don't even bother building
// it if this APK doesn't include API14 support.
public static final boolean MOZ_ANDROID_BEAM =
//#ifdef MOZ_ANDROID_BEAM
true;
//#else
false;
//#endif
// See this wiki page for more details about channel specific build defines:
// https://wiki.mozilla.org/Platform/Channel-specific_build_defines
public static final boolean RELEASE_OR_BETA =
//#ifdef RELEASE_OR_BETA
true;
//#else
false;
//#endif
public static final boolean NIGHTLY_BUILD =
//#ifdef NIGHTLY_BUILD
true;
//#else
false;
//#endif
public static final boolean DEBUG_BUILD =
//#ifdef MOZ_DEBUG
true;
//#else
false;
//#endif
public static final boolean MOZ_MEDIA_PLAYER =
//#ifdef MOZ_NATIVE_DEVICES
true;
//#else
false;
//#endif
// Official corresponds, roughly, to whether this build is performed on
// Mozilla's continuous integration infrastructure. You should disable
// developer-only functionality when this flag is set.
public static final boolean MOZILLA_OFFICIAL =
//#ifdef MOZILLA_OFFICIAL
true;
//#else
false;
//#endif
public static final boolean ANDROID_DOWNLOADS_INTEGRATION =
//#ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
true;
//#else
false;
//#endif
public static final boolean MOZ_DRAGGABLE_URLBAR = false;
public static final boolean MOZ_INSTALL_TRACKING =
//#ifdef MOZ_INSTALL_TRACKING
true;
//#else
false;
//#endif
public static final boolean MOZ_SWITCHBOARD =
//#ifdef MOZ_SWITCHBOARD
true;
//#else
false;
//#endif
/**
* Target CPU architecture: "armeabi-v7a", "x86, "mips", ..
*/
public static final String ANDROID_CPU_ARCH = "@ANDROID_CPU_ARCH@";
public static final boolean MOZ_ANDROID_EXCLUDE_FONTS =
//#ifdef MOZ_ANDROID_EXCLUDE_FONTS
true;
//#else
false;
//#endif
public static final boolean MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE =
//#ifdef MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE
true;
//#else
false;
//#endif
public static final boolean MOZ_ANDROID_CUSTOM_TABS =
//#ifdef MOZ_ANDROID_CUSTOM_TABS
true;
//#else
false;
//#endif
// (bug 1266820) Temporarily disabled since no one is working on it.
public static final boolean SCREENSHOTS_IN_BOOKMARKS_ENABLED = false;
/**
* Enables multidex depending on build flags. For more information,
* see `multiDexEnabled true` in mobile/android/app/build.gradle.
*
* As a method, this shouldn't be in AppConstants, but it's
* the only semi-relevant Java file that we pre-process.
*/
public static void maybeInstallMultiDex(final Context context) {
//#ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
if (BuildConfig.FLAVOR.equals("automation")) {
MultiDex.install(context);
}
//#else
// Do nothing.
//#endif
}
public static final boolean MOZ_ANDROID_ACTIVITY_STREAM =
//#ifdef MOZ_ANDROID_ACTIVITY_STREAM
true;
//#else
false;
//#endif
}

View file

@ -1,65 +0,0 @@
<!-- The bouncer APK and the Fennec APK should define the same set of
<permission>, <uses-permission>, and <uses-feature> elements. This reduces
the likelihood of permission-related surprises when installing the main APK
on top of a pre-installed bouncer APK. Add such elements here, so that
they can be easily shared between the two APKs. -->
#include ../services/manifests/FxAccountAndroidManifest_permissions.xml.in
#ifdef MOZ_ANDROID_SEARCH_ACTIVITY
#include ../search/manifests/SearchAndroidManifest_permissions.xml.in
#endif
<!-- Bug 1261302: we have two new permissions to request,
RECEIVE_BOOT_COMPLETED and the permission for push. We want to ask for
them during the same release, which should be Fennec 48. Therefore we
decouple the push permission from MOZ_ANDROID_GCM to let it ride ahead
(potentially) of the push feature. -->
#include GcmAndroidManifest_permissions.xml.in
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- READ_EXTERNAL_STORAGE was added in API 16, and is only enforced in API
19+. We declare it so that the bouncer APK and the main APK have the
same set of permissions. -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
#ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
#endif
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen"/>
<!-- Tab Queue -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
#ifdef MOZ_ANDROID_BEAM
<!-- Android Beam support -->
<uses-permission android:name="android.permission.NFC"/>
<uses-feature android:name="android.hardware.nfc" android:required="false"/>
#endif
#ifdef MOZ_WEBRTC
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-feature android:name="android.hardware.audio.low_latency" android:required="false"/>
<uses-feature android:name="android.hardware.camera.any" android:required="false"/>
<uses-feature android:name="android.hardware.microphone" android:required="false"/>
#endif
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<!-- App requires OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

View file

@ -1,4 +0,0 @@
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Avoid a linter warning by not double-including WAKE_LOCK.
<uses-permission android:name="android.permission.WAKE_LOCK" />
-->

View file

@ -1,29 +0,0 @@
<!-- Handle GCM registration updates from on-device Google Play Services. -->
<service
android:name="org.mozilla.gecko.gcm.GcmInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<!-- Provided by on-device Google Play Services. Directs inbound messages to internal listener service. -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="@ANDROID_PACKAGE_NAME@" />
</intent-filter>
</receiver>
<!-- Handle messages directed by the GCM receiver. -->
<service
android:name="org.mozilla.gecko.gcm.GcmMessageListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>

View file

@ -1,594 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# We call mach -> Make -> gradle -> mach, which races to find and
# create .mozconfig files and to generate targets.
ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
.NOTPARALLEL:
endif
MOZ_BUILDID := $(shell awk '{print $$3}' $(DEPTH)/buildid.h)
# Set the appropriate version code, based on the existance of the
# MOZ_APP_ANDROID_VERSION_CODE variable.
ifdef MOZ_APP_ANDROID_VERSION_CODE
ANDROID_VERSION_CODE:=$(MOZ_APP_ANDROID_VERSION_CODE)
else
ANDROID_VERSION_CODE:=$(shell $(PYTHON) \
$(topsrcdir)/python/mozbuild/mozbuild/android_version_code.py \
--verbose \
--with-android-cpu-arch=$(ANDROID_CPU_ARCH) \
$(if $(MOZ_ANDROID_MIN_SDK_VERSION),--with-android-min-sdk=$(MOZ_ANDROID_MIN_SDK_VERSION)) \
$(if $(MOZ_ANDROID_MAX_SDK_VERSION),--with-android-max-sdk=$(MOZ_ANDROID_MAX_SDK_VERSION)) \
$(MOZ_BUILDID))
endif
DEFINES += \
-DANDROID_VERSION_CODE=$(ANDROID_VERSION_CODE) \
-DMOZ_ANDROID_SHARED_ID="$(MOZ_ANDROID_SHARED_ID)" \
-DMOZ_BUILDID=$(MOZ_BUILDID) \
$(NULL)
GARBAGE += \
classes.dex \
gecko.ap_ \
res/values/strings.xml \
res/raw/browsersearch.json \
res/raw/suggestedsites.json \
.aapt.deps \
GeneratedJNINatives.h \
GeneratedJNIWrappers.cpp \
GeneratedJNIWrappers.h \
FennecJNINatives.h \
FennecJNIWrappers.cpp \
FennecJNIWrappers.h \
$(NULL)
GARBAGE_DIRS += classes db jars res sync services generated
# The bootclasspath is functionally identical to the classpath, but allows the
# classes given to redefine classes in core packages, such as java.lang.
# android.jar is here as it provides Android's definition of the Java Standard
# Library. The compatability lib here tweaks a few of the core classes to paint
# over changes in behaviour between versions.
JAVA_BOOTCLASSPATH := \
$(ANDROID_SDK)/android.jar \
$(NULL)
JAVA_BOOTCLASSPATH := $(subst $(NULL) ,:,$(strip $(JAVA_BOOTCLASSPATH)))
JAVA_CLASSPATH += \
$(ANDROID_SUPPORT_ANNOTATIONS_JAR_LIB) \
$(ANDROID_SUPPORT_V4_AAR_LIB) \
$(ANDROID_SUPPORT_V4_AAR_INTERNAL_LIB) \
$(ANDROID_APPCOMPAT_V7_AAR_LIB) \
$(ANDROID_SUPPORT_VECTOR_DRAWABLE_AAR_LIB) \
$(ANDROID_ANIMATED_VECTOR_DRAWABLE_AAR_LIB) \
$(ANDROID_CARDVIEW_V7_AAR_LIB) \
$(ANDROID_DESIGN_AAR_LIB) \
$(ANDROID_RECYCLERVIEW_V7_AAR_LIB) \
$(ANDROID_CUSTOMTABS_AAR_LIB) \
$(ANDROID_PALETTE_V7_AAR_LIB) \
$(NULL)
# If native devices are enabled, add Google Play Services and some of the v7
# compat libraries.
ifdef MOZ_NATIVE_DEVICES
JAVA_CLASSPATH += \
$(ANDROID_PLAY_SERVICES_BASE_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_CAST_AAR_LIB) \
$(ANDROID_MEDIAROUTER_V7_AAR_LIB) \
$(ANDROID_MEDIAROUTER_V7_AAR_INTERNAL_LIB) \
$(NULL)
endif
ifdef MOZ_ANDROID_GCM
JAVA_CLASSPATH += \
$(ANDROID_PLAY_SERVICES_BASE_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_GCM_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_MEASUREMENT_AAR_LIB) \
$(NULL)
endif
ifdef MOZ_INSTALL_TRACKING
JAVA_CLASSPATH += \
$(ANDROID_PLAY_SERVICES_ADS_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
$(NULL)
endif
JAVA_CLASSPATH := $(subst $(NULL) ,:,$(strip $(JAVA_CLASSPATH)))
# Library jars that we're bundling: these are subject to Proguard before inclusion
# into classes.dex.
java_bundled_libs := \
$(ANDROID_SUPPORT_V4_AAR_LIB) \
$(ANDROID_SUPPORT_V4_AAR_INTERNAL_LIB) \
$(ANDROID_APPCOMPAT_V7_AAR_LIB) \
$(ANDROID_SUPPORT_VECTOR_DRAWABLE_AAR_LIB) \
$(ANDROID_ANIMATED_VECTOR_DRAWABLE_AAR_LIB) \
$(ANDROID_CARDVIEW_V7_AAR_LIB) \
$(ANDROID_DESIGN_AAR_LIB) \
$(ANDROID_RECYCLERVIEW_V7_AAR_LIB) \
$(ANDROID_CUSTOMTABS_AAR_LIB) \
$(ANDROID_PALETTE_V7_AAR_LIB) \
$(NULL)
ifdef MOZ_NATIVE_DEVICES
java_bundled_libs += \
$(ANDROID_PLAY_SERVICES_BASE_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_CAST_AAR_LIB) \
$(ANDROID_MEDIAROUTER_V7_AAR_LIB) \
$(ANDROID_MEDIAROUTER_V7_AAR_INTERNAL_LIB) \
$(NULL)
endif
ifdef MOZ_ANDROID_GCM
java_bundled_libs += \
$(ANDROID_PLAY_SERVICES_BASE_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_GCM_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_MEASUREMENT_AAR_LIB) \
$(NULL)
endif
ifdef MOZ_INSTALL_TRACKING
java_bundled_libs += \
$(ANDROID_PLAY_SERVICES_ADS_AAR_LIB) \
$(ANDROID_PLAY_SERVICES_BASEMENT_AAR_LIB) \
$(NULL)
endif
# uniq purloined from http://stackoverflow.com/a/16151140.
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
java_bundled_libs := $(call uniq,$(java_bundled_libs))
java_bundled_libs := $(subst $(NULL) ,:,$(strip $(java_bundled_libs)))
GECKOVIEW_JARS = \
constants.jar \
gecko-R.jar \
gecko-mozglue.jar \
gecko-util.jar \
gecko-view.jar \
sync-thirdparty.jar \
$(NULL)
ifdef MOZ_INSTALL_TRACKING
GECKOVIEW_JARS += gecko-thirdparty-adjust_sdk.jar
endif
geckoview_jars_classpath := $(subst $(NULL) ,:,$(strip $(GECKOVIEW_JARS)))
FENNEC_JARS = \
gecko-browser.jar \
gecko-thirdparty.jar \
services.jar \
../javaaddons/javaaddons-1.0.jar \
$(NULL)
ifdef MOZ_WEBRTC
FENNEC_JARS += webrtc.jar
endif
ifdef MOZ_ANDROID_SEARCH_ACTIVITY
FENNEC_JARS += search-activity.jar
endif
ifdef MOZ_ANDROID_MLS_STUMBLER
FENNEC_JARS += ../stumbler/stumbler.jar
endif
# All the jars we're compiling from source. (not to be confused with
# java_bundled_libs, which holds the jars which we're including as binaries).
ALL_JARS = \
$(GECKOVIEW_JARS) \
$(FENNEC_JARS) \
$(NULL)
# The list of jars in Java classpath notation (colon-separated).
all_jars_classpath := $(subst $(NULL) ,:,$(strip $(ALL_JARS)))
include $(topsrcdir)/config/config.mk
library_jars := \
$(ANDROID_SDK)/android.jar \
$(NULL)
# Android 23 (Marshmallow) deprecated a part of the Android platform, namely the
# org.apache.http package. Fennec removed all code that referenced said package
# in order to easily ship to Android 23 devices (and, by extension, all devices
# before Android 23).
#
# Google did not remove all code that referenced said package in their own
# com.google.android.gms namespace! It turns out that the org.apache.http
# package is not removed, only deprecated and hidden by default. Google added a
# a `useLibrary` Gradle directive that allows legacy code to reference the
# package, which is still (hidden) in the Android 23 platform.
#
# Fennec code doesn't need to compile against the deprecated package, since our
# code doesn't reference the package anymore. However, we do need to Proguard
# against the deprecated package. If we don't, Proguard -- which is a global
# optimization -- sees Google libraries referencing "non-existent" libraries and
# complains. The solution is to mimic the `useLibraries` directive by declaring
# the legacy package as a provided library jar.
#
# See https://bugzilla.mozilla.org/show_bug.cgi?id=1233238#c19 for symptoms and
# more discussion.
ifdef MOZ_INSTALL_TRACKING
library_jars += $(ANDROID_SDK)/optional/org.apache.http.legacy.jar
endif # MOZ_INSTALL_TRACKING
library_jars := $(subst $(NULL) ,:,$(strip $(library_jars)))
gradle_dir := $(topobjdir)/gradle/build/mobile/android
ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
.gradle.deps: .aapt.deps FORCE
@$(TOUCH) $@
$(topsrcdir)/mach gradle \
app:assembleAutomationDebug app:assembleAutomationDebugAndroidTest -x lint
classes.dex: .gradle.deps
$(REPORT_BUILD)
cp $(gradle_dir)/app/intermediates/transforms/dex/automation/debug/folders/1000/1f/main/classes.dex $@
else
classes.dex: .proguard.deps
$(REPORT_BUILD)
$(DX) --dex --output=classes.dex jars-proguarded
endif
ifdef MOZ_DISABLE_PROGUARD
PROGUARD_PASSES=0
else
ifdef MOZ_DEBUG
PROGUARD_PASSES=1
else
ifndef MOZILLA_OFFICIAL
PROGUARD_PASSES=1
else
PROGUARD_PASSES=6
endif
endif
endif
proguard_config_dir=$(topsrcdir)/mobile/android/config/proguard
# This stanza ensures that the set of GeckoView classes does not depend on too
# much of Fennec, where "too much" is defined as the set of potentially
# non-GeckoView classes that GeckoView already depended on at a certain point in
# time. The idea is to set a high-water mark that is not to be crossed.
classycle_jar := $(topsrcdir)/mobile/android/build/classycle/classycle-1.4.1.jar
.geckoview.deps: geckoview.ddf $(classycle_jar) $(ALL_JARS)
$(JAVA) -cp $(classycle_jar) \
classycle.dependency.DependencyChecker \
-mergeInnerClasses \
-dependencies=@$< \
$(ALL_JARS)
@$(TOUCH) $@
# First, we delete debugging information from libraries. Having line-number
# information for libraries for which we lack the source isn't useful, so this
# saves us a bit of space. Importantly, Proguard has a bug causing it to
# sometimes corrupt this information if present (which it does for some of the
# included libraries). This corruption prevents dex from completing, so we need
# to get rid of it. This prevents us from seeing line numbers in stack traces
# for stack frames inside libraries.
#
# This step can occur much earlier than the main Proguard pass: it needs only
# gecko-R.jar to have been compiled (as that's where the library R.java files
# end up), but it does block the main Proguard pass.
.bundled.proguard.deps: gecko-R.jar $(proguard_config_dir)/strip-libs.cfg
$(REPORT_BUILD)
@$(TOUCH) $@
$(JAVA) \
-Xmx512m -Xms128m \
-jar $(ANDROID_SDK_ROOT)/tools/proguard/lib/proguard.jar \
@$(proguard_config_dir)/strip-libs.cfg \
-injars $(subst ::,:,$(java_bundled_libs))\
-outjars bundled-jars-nodebug \
-libraryjars $(library_jars):gecko-R.jar
# We touch the target file before invoking Proguard so that Proguard's
# outputs are fresher than the target, preventing a subsequent
# invocation from thinking Proguard's outputs are stale. This is safe
# because Make removes the target file if any recipe command fails.
.proguard.deps: .geckoview.deps .bundled.proguard.deps $(ALL_JARS) $(proguard_config_dir)/proguard.cfg
$(REPORT_BUILD)
@$(TOUCH) $@
$(JAVA) \
-Xmx512m -Xms128m \
-jar $(ANDROID_SDK_ROOT)/tools/proguard/lib/proguard.jar \
@$(proguard_config_dir)/proguard.cfg \
-optimizationpasses $(PROGUARD_PASSES) \
-injars $(subst ::,:,$(all_jars_classpath)):bundled-jars-nodebug \
-outjars jars-proguarded \
-libraryjars $(library_jars)
ANNOTATION_PROCESSOR_JAR_FILES := $(DEPTH)/build/annotationProcessors/annotationProcessors.jar
# This annotation processing step also generates
# GeneratedJNIWrappers.h and GeneratedJNINatives.h
GeneratedJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES) $(GECKOVIEW_JARS)
$(JAVA) -classpath $(geckoview_jars_classpath):$(JAVA_BOOTCLASSPATH):$(JAVA_CLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) \
org.mozilla.gecko.annotationProcessors.AnnotationProcessor \
Generated $(GECKOVIEW_JARS)
# This annotation processing step also generates
# FennecJNIWrappers.h and FennecJNINatives.h
FennecJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES) $(FENNEC_JARS)
$(JAVA) -classpath $(all_jars_classpath):$(JAVA_BOOTCLASSPATH):$(JAVA_CLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) \
org.mozilla.gecko.annotationProcessors.AnnotationProcessor \
Fennec $(FENNEC_JARS)
# Certain source files need to be preprocessed. This special rule
# generates these files into generated/org/mozilla/gecko for
# consumption by the build system and IDEs.
# The list in moz.build looks like
# 'preprocessed/org/mozilla/gecko/AppConstants.java'. The list in
# constants_PP_JAVAFILES looks like
# 'generated/preprocessed/org/mozilla/gecko/AppConstants.java'. We
# need to write AppConstants.java.in to
# generated/preprocessed/org/mozilla/gecko.
preprocessed := $(addsuffix .in,$(subst generated/preprocessed/org/mozilla/gecko/,,$(filter generated/preprocessed/org/mozilla/gecko/%,$(constants_PP_JAVAFILES))))
preprocessed_PATH := generated/preprocessed/org/mozilla/gecko
preprocessed_KEEP_PATH := 1
preprocessed_FLAGS := --marker='//\\\#'
PP_TARGETS += preprocessed
include $(topsrcdir)/config/rules.mk
not_android_res_files := \
*.mkdir.done* \
*.DS_Store* \
*\#* \
*.rej \
*.orig \
$(NULL)
# This uses the fact that Android resource directories list all
# resource files one subdirectory below the parent resource directory.
android_res_files := $(filter-out $(not_android_res_files),$(wildcard $(addsuffix /*,$(wildcard $(addsuffix /*,$(ANDROID_RES_DIRS))))))
$(ANDROID_GENERATED_RESFILES): $(call mkdir_deps,$(sort $(dir $(ANDROID_GENERATED_RESFILES))))
# [Comment 1/3] We don't have correct dependencies for strings.xml at
# this point, so we always recursively invoke the submake to check the
# dependencies. Sigh. And, with multilocale builds, there will be
# multiple strings.xml files, and we need to rebuild gecko.ap_ if any
# of them change. But! mobile/android/base/locales does not have
# enough information to actually build res/values/strings.xml during a
# language repack. So rather than adding rules into the main
# makefile, and trying to work around the lack of information, we
# force a rebuild of gecko.ap_ during packaging. See below.
# Since the sub-Make is forced, it doesn't matter that we touch the
# target file before the command. If in the future we stop forcing
# the sub-Make, touching the target file first is better, because the
# sub-Make outputs will be fresher than the target, and not require
# rebuilding. This is all safe because Make removes the target file
# if any recipe command fails. It is crucial that the sub-Make touch
# the target files (those depending on .locales.deps) only when there
# contents have changed; otherwise, this will force rebuild them as
# part of every build.
.locales.deps: FORCE
$(TOUCH) $@
$(MAKE) -C locales
# This .deps pattern saves an invocation of the sub-Make: the single
# invocation generates strings.xml, browsersearch.json, and
# suggestedsites.json. The trailing semi-colon defines an empty
# recipe: defining no recipe at all causes Make to treat the target
# differently, in a way that defeats our dependencies.
res/values/strings.xml: .locales.deps ;
res/raw/browsersearch.json: .locales.deps ;
res/raw/suggestedsites.json: .locales.deps ;
all_resources = \
$(DEPTH)/mobile/android/base/AndroidManifest.xml \
$(android_res_files) \
$(ANDROID_GENERATED_RESFILES) \
$(NULL)
# All of generated/org/mozilla/gecko/R.java, gecko.ap_, and R.txt are
# produced by aapt; this saves aapt invocations. The trailing
# semi-colon defines an empty recipe; defining no recipe at all causes
# Make to treat the target differently, in a way that defeats our
# dependencies.
generated/org/mozilla/gecko/R.java: .aapt.deps ;
# Only add libraries that contain resources here. We (unecessarily) generate an identical R.java which
# is copied into each of these locations, and each of these files contains thousands of fields.
# Each unnecessary copy therefore wastes unnecessary fields in the output dex file.
# Note: usually proguard will help clean this up after the fact, but having too many fields will cause
# dexing to fail, regardless of any later optimisations proguard could later make to bring us back
# under the limit.
# Ideally we would fix our aapt invocations to correctly generate minimal copies of R.java for each
# package, but that seems redundant since gradle builds are able to correctly generate these files.
# If native devices are enabled, add Google Play Services, build their resources
# (no resources) generated/android/support/v4/R.java: .aapt.deps ;
generated/android/support/v7/appcompat/R.java: .aapt.deps ;
# (no resources) generated/android/support/graphics/drawable/animated/R.java: .aapt.deps ;
# (no resources) generated/android/support/graphics/drawable/R.java: .aapt.deps ;
generated/android/support/v7/cardview/R.java: .aapt.deps ;
generated/android/support/design/R.java: .aapt.deps ;
generated/android/support/v7/mediarouter/R.java: .aapt.deps ;
generated/android/support/v7/recyclerview/R.java: .aapt.deps ;
# (no resources) generated/android/support/customtabs/R.java: .aapt.deps ;
# (no resources) generated/android/support/v7/palette/R.java: .aapt.deps ;
generated/com/google/android/gms/R.java: .aapt.deps ;
generated/com/google/android/gms/ads/R.java: .aapt.deps ;
generated/com/google/android/gms/base/R.java: .aapt.deps ;
generated/com/google/android/gms/cast/R.java: .aapt.deps ;
# (no resources) generated/com/google/android/gms/gcm/R.java: .aapt.deps ;
# (no resources) generated/com/google/android/gms/measurement/R.java: .aapt.deps ;
gecko.ap_: .aapt.deps ;
R.txt: .aapt.deps ;
# [Comment 2/3] This tom-foolery provides a target that forces a
# rebuild of gecko.ap_. This is used during packaging to ensure that
# resources are fresh. The alternative would be complicated; see
# [Comment 1/3].
gecko-nodeps/R.java: .aapt.nodeps ;
gecko-nodeps.ap_: .aapt.nodeps ;
gecko-nodeps/R.txt: .aapt.nodeps ;
# This ignores the default set of resources ignored by aapt, plus
# files starting with '#'. (Emacs produces temp files named #temp#.)
# This doesn't actually set the environment variable; it's used as a
# parameter in the aapt invocation below. Consider updating
# not_android_res_files as well.
ANDROID_AAPT_IGNORE := !.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~:\#*:*.rej:*.orig
# 1: target file.
# 2: dependencies.
# 3: name of ap_ file to write.
# 4: directory to write R.java into.
# 5: directory to write R.txt into.
# We touch the target file before invoking aapt so that aapt's outputs
# are fresher than the target, preventing a subsequent invocation from
# thinking aapt's outputs are stale. This is safe because Make
# removes the target file if any recipe command fails.
define aapt_command
$(1): $$(call mkdir_deps,$(filter-out ./,$(dir $(3) $(4) $(5)))) $(2)
@$$(TOUCH) $$@
$$(AAPT) package -f -m \
-M AndroidManifest.xml \
-I $(ANDROID_SDK)/android.jar \
$(if $(MOZ_ANDROID_MAX_SDK_VERSION),--max-res-version $(MOZ_ANDROID_MAX_SDK_VERSION),) \
--auto-add-overlay \
$$(addprefix -S ,$$(ANDROID_RES_DIRS)) \
$$(addprefix -A ,$$(ANDROID_ASSETS_DIRS)) \
$(if $(ANDROID_EXTRA_PACKAGES),--extra-packages $$(subst $$(NULL) ,:,$$(strip $$(ANDROID_EXTRA_PACKAGES)))) \
$(if $(ANDROID_EXTRA_RES_DIRS),$$(addprefix -S ,$$(ANDROID_EXTRA_RES_DIRS))) \
--custom-package org.mozilla.gecko \
--no-version-vectors \
-F $(3) \
-J $(4) \
--output-text-symbols $(5) \
--ignore-assets "$$(ANDROID_AAPT_IGNORE)"
endef
# [Comment 3/3] The first of these rules is used during regular
# builds. The second writes an ap_ file that is only used during
# packaging. It doesn't write the normal ap_, or R.java, since we
# don't want the packaging step to write anything that would make a
# further no-op build do work. See also
# toolkit/mozapps/installer/packager.mk.
# .aapt.deps: $(all_resources)
$(eval $(call aapt_command,.aapt.deps,$(all_resources),gecko.ap_,generated/,./))
ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
.aapt.nodeps: FORCE
cp $(gradle_dir)/app/intermediates/res/resources-automation-debug.ap_ gecko-nodeps.ap_
else
# .aapt.nodeps: $(DEPTH)/mobile/android/base/AndroidManifest.xml FORCE
$(eval $(call aapt_command,.aapt.nodeps,$(DEPTH)/mobile/android/base/AndroidManifest.xml FORCE,gecko-nodeps.ap_,gecko-nodeps/,gecko-nodeps/))
endif
# Override the Java settings with some specific android settings
include $(topsrcdir)/config/android-common.mk
update-generated-wrappers:
@cp $(CURDIR)/GeneratedJNIWrappers.cpp \
$(CURDIR)/GeneratedJNIWrappers.h \
$(CURDIR)/GeneratedJNINatives.h $(topsrcdir)/widget/android
@echo Updated generated JNI code
update-fennec-wrappers:
@cp $(CURDIR)/FennecJNIWrappers.cpp \
$(CURDIR)/FennecJNIWrappers.h \
$(CURDIR)/FennecJNINatives.h $(topsrcdir)/widget/android/fennec
@echo Updated Fennec JNI code
.PHONY: update-generated-wrappers
# This target is only used by IDE integrations. It rebuilds resources
# that end up in omni.ja using the equivalent of |mach build faster|,
# does most of the packaging step, and then updates omni.ja in
# place. If you're not using an IDE, you should be using |mach build
# mobile/android && mach package|.
$(ABS_DIST)/fennec/$(OMNIJAR_NAME): FORCE
$(REPORT_BUILD)
$(MAKE) -C ../../../faster
$(MAKE) -C ../installer stage-package
$(MKDIR) -p $(@D)
rsync --update $(DIST)/fennec/$(notdir $(OMNIJAR_NAME)) $@
$(RM) $(DIST)/fennec/$(notdir $(OMNIJAR_NAME))
# Targets built very early during a Gradle build.
gradle-targets: $(foreach f,$(constants_PP_JAVAFILES),$(f))
gradle-targets: $(DEPTH)/mobile/android/base/AndroidManifest.xml
gradle-targets: $(ANDROID_GENERATED_RESFILES)
ifndef MOZILLA_OFFICIAL
# Local developers update omni.ja during their builds. There's a
# chicken-and-egg problem here.
gradle-omnijar: $(abspath $(DIST)/fennec/$(OMNIJAR_NAME))
else
# In automation, omni.ja is built only during packaging.
gradle-omnijar:
endif
.PHONY: gradle-targets gradle-omnijar
# GeneratedJNIWrappers.cpp target also generates
# GeneratedJNIWrappers.h and GeneratedJNINatives.h
# FennecJNIWrappers.cpp target also generates
# FennecJNIWrappers.h and FennecJNINatives.h
ifndef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
libs:: GeneratedJNIWrappers.cpp
@(diff GeneratedJNIWrappers.cpp $(topsrcdir)/widget/android/GeneratedJNIWrappers.cpp >/dev/null && \
diff GeneratedJNIWrappers.h $(topsrcdir)/widget/android/GeneratedJNIWrappers.h >/dev/null && \
diff GeneratedJNINatives.h $(topsrcdir)/widget/android/GeneratedJNINatives.h >/dev/null) || \
(echo '*****************************************************' && \
echo '*** Error: The generated JNI code has changed ***' && \
echo '* To update generated code in the tree, please run *' && \
echo && \
echo ' make -C $(CURDIR) update-generated-wrappers' && \
echo && \
echo '* Repeat the build, and check in any changes. *' && \
echo '*****************************************************' && \
exit 1)
libs:: FennecJNIWrappers.cpp
@(diff FennecJNIWrappers.cpp $(topsrcdir)/widget/android/fennec/FennecJNIWrappers.cpp >/dev/null && \
diff FennecJNIWrappers.h $(topsrcdir)/widget/android/fennec/FennecJNIWrappers.h >/dev/null && \
diff FennecJNINatives.h $(topsrcdir)/widget/android/fennec/FennecJNINatives.h >/dev/null) || \
(echo '*****************************************************' && \
echo '*** Error: The Fennec JNI code has changed ***' && \
echo '* To update generated code in the tree, please run *' && \
echo && \
echo ' make -C $(CURDIR) update-fennec-wrappers' && \
echo && \
echo '* Repeat the build, and check in any changes. *' && \
echo '*****************************************************' && \
exit 1)
endif
libs:: classes.dex
$(INSTALL) classes.dex $(FINAL_TARGET)
# Generate Java binder interfaces from AIDL files.
aidl_src_path := $(srcdir)/aidl
aidl_target_path := generated
media_pkg := org/mozilla/gecko/media
$(aidl_target_path)/$(media_pkg)/%.java:$(aidl_src_path)/$(media_pkg)/%.aidl
@echo "Processing AIDL: $< => $@"
$(AIDL) -p$(ANDROID_SDK)/framework.aidl -I$(aidl_src_path) -o$(aidl_target_path) $<

View file

@ -1 +0,0 @@
ABCDEFGHIJKL

View file

@ -1,3 +0,0 @@
//#ifdef MOZ_INSTALL_TRACKING
//#define MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN @MOZ_ADJUST_SDK_KEY@
//#endif

View file

@ -1,7 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
parcelable FormatParam;

View file

@ -1,26 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
// Non-default types used in interface.
import android.os.Bundle;
import android.view.Surface;
import org.mozilla.gecko.media.FormatParam;
import org.mozilla.gecko.media.ICodecCallbacks;
import org.mozilla.gecko.media.Sample;
interface ICodec {
void setCallbacks(in ICodecCallbacks callbacks);
boolean configure(in FormatParam format, inout Surface surface, int flags);
oneway void start();
oneway void stop();
oneway void flush();
oneway void release();
Sample dequeueInput(int size);
oneway void queueInput(in Sample sample);
oneway void releaseOutput(in Sample sample);
}

View file

@ -1,16 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
// Non-default types used in interface.
import org.mozilla.gecko.media.FormatParam;
import org.mozilla.gecko.media.Sample;
interface ICodecCallbacks {
oneway void onInputExhausted();
oneway void onOutputFormatChanged(in FormatParam format);
oneway void onOutput(in Sample sample);
oneway void onError(boolean fatal);
}

View file

@ -1,25 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
// Non-default types used in interface.
import org.mozilla.gecko.media.IMediaDrmBridgeCallbacks;
interface IMediaDrmBridge {
void setCallbacks(in IMediaDrmBridgeCallbacks callbacks);
oneway void createSession(int createSessionToken,
int promiseId,
String initDataType,
in byte[] initData);
oneway void updateSession(int promiseId,
String sessionId,
in byte[] response);
oneway void closeSession(int promiseId, String sessionId);
oneway void release();
}

View file

@ -1,31 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
// Non-default types used in interface.
import org.mozilla.gecko.media.SessionKeyInfo;
interface IMediaDrmBridgeCallbacks {
oneway void onSessionCreated(int createSessionToken,
int promiseId,
in byte[] sessionId,
in byte[] request);
oneway void onSessionUpdated(int promiseId, in byte[] sessionId);
oneway void onSessionClosed(int promiseId, in byte[] sessionId);
oneway void onSessionMessage(in byte[] sessionId,
int sessionMessageType,
in byte[] request);
oneway void onSessionError(in byte[] sessionId, String message);
oneway void onSessionBatchedKeyChanged(in byte[] sessionId,
in SessionKeyInfo[] keyInfos);
oneway void onRejectPromise(int promiseId, String message);
}

View file

@ -1,18 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
// Non-default types used in interface.
import org.mozilla.gecko.media.ICodec;
import org.mozilla.gecko.media.IMediaDrmBridge;
interface IMediaManager {
/** Creates a remote ICodec object. */
ICodec createCodec();
/** Creates a remote IMediaDrmBridge object. */
IMediaDrmBridge createRemoteMediaDrmBridge(in String keySystem,
in String stubId);
}

View file

@ -1,7 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
parcelable Sample;

View file

@ -1,7 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.media;
parcelable SessionKeyInfo;

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape>
<solid android:color="@color/textbox_background" />
<stroke android:width="1dp" android:color="@color/textbox_stroke" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<solid android:color="@color/textbox_background_disabled" />
<stroke android:width="1dp" android:color="@color/textbox_stroke_disabled" />
</shape>
</item>
</selector>

View file

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/toolbar_grey">
<LinearLayout android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:padding="10dp"
android:layout_weight="1">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
android:textSize="30sp"
android:textColor="#000"
android:layout_gravity="center_horizontal"
android:fontFamily="sans-serif-light"
android:text="@string/crash_sorry"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
android:textAppearance="@style/TextAppearance"
android:text="@string/crash_message2"/>
<CheckBox android:id="@+id/send_report"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:textColor="@color/primary_text"
android:layout_marginBottom="10dp"
android:text="@string/crash_send_report_message3"/>
<EditText android:id="@+id/comment"
style="@style/CrashReporter.EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:lines="5"
android:gravity="top"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="10dp"
android:hint="@string/crash_comment" />
<CheckBox android:id="@+id/include_url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/primary_text"
android:textAppearance="@style/TextAppearance"
android:layout_marginBottom="10dp"
android:text="@string/crash_include_url2"/>
<CheckBox android:id="@+id/allow_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/primary_text"
android:textAppearance="@style/TextAppearance"
android:layout_marginBottom="10dp"
android:text="@string/crash_allow_contact2"/>
<org.mozilla.gecko.widget.ClickableWhenDisabledEditText
android:id="@+id/email"
style="@style/CrashReporter.EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textEmailAddress"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:enabled="false"
android:clickable="true"
android:hint="@string/crash_email" />
</LinearLayout>
<View android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#999" />
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom">
<Button android:id="@+id/close"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:padding="15dp"
android:onClick="onCloseClick"
android:text="@string/crash_close_label"
android:textAppearance="?android:attr/textAppearance"
android:background="@drawable/action_bar_button"/>
<View android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#999" />
<Button android:id="@+id/restart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:padding="15dp"
android:onClick="onRestartClick"
android:text="@string/crash_restart_label"
android:textAppearance="?android:attr/textAppearance"
android:background="@drawable/action_bar_button"/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<!-- Crash Reporter Colors -->
<color name="textbox_background">#FFF</color>
<color name="textbox_background_disabled">#DDD</color>
<color name="textbox_stroke">#000</color>
<color name="textbox_stroke_disabled">#666</color>
</resources>

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<!-- Crash Reporter Styles -->
<style name="CrashReporter" />
<style name="CrashReporter.EditText">
<item name="android:background">@drawable/textbox_bg</item>
<item name="android:padding">10dp</item>
<item name="android:textAppearance">@style/TextAppearance</item>
</style>
</resources>

Some files were not shown because too many files have changed in this diff Show more