mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge fx-team to m-c. a=merge
This commit is contained in:
commit
358e12f3dd
@ -72,7 +72,6 @@ function onLoad() {
|
|||||||
document.getElementById("autoSafeMode").hidden = false;
|
document.getElementById("autoSafeMode").hidden = false;
|
||||||
document.getElementById("safeMode").hidden = true;
|
document.getElementById("safeMode").hidden = true;
|
||||||
if (ResetProfile.resetSupported()) {
|
if (ResetProfile.resetSupported()) {
|
||||||
populateResetPane("resetProfileItems");
|
|
||||||
document.getElementById("resetProfile").hidden = false;
|
document.getElementById("resetProfile").hidden = false;
|
||||||
} else {
|
} else {
|
||||||
// Hide the reset button is it's not supported.
|
// Hide the reset button is it's not supported.
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
title="&safeModeDialog.title;"
|
title="&safeModeDialog.title;"
|
||||||
buttons="accept,extra1"
|
buttons="accept,extra1"
|
||||||
buttonlabelaccept="&startSafeMode.label;"
|
buttonlabelaccept="&startSafeMode.label;"
|
||||||
buttonlabelextra1="&resetProfile.label;"
|
buttonlabelextra1="&refreshProfile.label;"
|
||||||
maxwidth="&window.maxWidth;"
|
maxwidth="&window.maxWidth;"
|
||||||
ondialogaccept="return onDefaultButton()"
|
ondialogaccept="return onDefaultButton()"
|
||||||
ondialogcancel="onCancel();"
|
ondialogcancel="onCancel();"
|
||||||
@ -32,30 +32,19 @@
|
|||||||
<script type="application/javascript" src="chrome://browser/content/safeMode.js"/>
|
<script type="application/javascript" src="chrome://browser/content/safeMode.js"/>
|
||||||
|
|
||||||
<vbox id="autoSafeMode" hidden="true">
|
<vbox id="autoSafeMode" hidden="true">
|
||||||
<description>&autoSafeModeDescription2.label;</description>
|
<description>&autoSafeModeDescription3.label;</description>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
<vbox id ="safeMode">
|
<vbox id="safeMode">
|
||||||
<label>&safeModeDescription3.label;</label>
|
<label>&safeModeDescription3.label;</label>
|
||||||
<separator class="thin"/>
|
<separator class="thin"/>
|
||||||
<label>&safeModeDescription4.label;</label>
|
<label>&safeModeDescription4.label;</label>
|
||||||
<separator class="thin"/>
|
<separator class="thin"/>
|
||||||
<label id="resetProfileInstead">&resetProfileInstead.label;</label>
|
<label id="resetProfileInstead">&refreshProfileInstead.label;</label>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
<vbox id="resetProfile" hidden="true">
|
<vbox id="resetProfile" hidden="true">
|
||||||
<label>&resetProfile.dialog.items2.label;</label>
|
<label id="resetProfileInstead">&refreshProfileInstead.label;</label>
|
||||||
|
|
||||||
<vbox id="resetProfileItems" class="indent">
|
|
||||||
</vbox>
|
|
||||||
|
|
||||||
<separator class="thin"/>
|
|
||||||
|
|
||||||
<label id="resetProfileFooter">&resetProfileFooter.label;</label>
|
|
||||||
|
|
||||||
<label>&safeModeInstead.label;</label>
|
|
||||||
|
|
||||||
<separator/>
|
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
<separator class="thin"/>
|
<separator class="thin"/>
|
||||||
|
@ -188,7 +188,7 @@
|
|||||||
<image id="PanelUI-panic-timeframe-icon-small" alt=""/>
|
<image id="PanelUI-panic-timeframe-icon-small" alt=""/>
|
||||||
<description id="PanelUI-panic-mainDesc" flex="1">&panicButton.view.mainTimeframeDesc;</description>
|
<description id="PanelUI-panic-mainDesc" flex="1">&panicButton.view.mainTimeframeDesc;</description>
|
||||||
</hbox>
|
</hbox>
|
||||||
<radiogroup id="PanelUI-panic-timeSpan" aria-labelledby="PanelUI-panic-mainDesc">
|
<radiogroup id="PanelUI-panic-timeSpan" aria-labelledby="PanelUI-panic-mainDesc" closemenu="none">
|
||||||
<radio id="PanelUI-panic-5min" label="&panicButton.view.5min;" selected="true"
|
<radio id="PanelUI-panic-5min" label="&panicButton.view.5min;" selected="true"
|
||||||
value="5" class="subviewradio"/>
|
value="5" class="subviewradio"/>
|
||||||
<radio id="PanelUI-panic-2hr" label="&panicButton.view.2hr;"
|
<radio id="PanelUI-panic-2hr" label="&panicButton.view.2hr;"
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<!-- Error Title -->
|
<!-- Error Title -->
|
||||||
<div id="errorTitle">
|
<div id="errorTitle">
|
||||||
<h1 id="errorTitleText">&welcomeback.pageTitle;</h1>
|
<h1 id="errorTitleText">&welcomeback2.pageTitle;</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- LONG CONTENT (the section most likely to require scrolling) -->
|
<!-- LONG CONTENT (the section most likely to require scrolling) -->
|
||||||
@ -41,7 +41,9 @@
|
|||||||
|
|
||||||
<!-- Short Description -->
|
<!-- Short Description -->
|
||||||
<div id="errorShortDesc">
|
<div id="errorShortDesc">
|
||||||
<p id="errorShortDescText">&welcomeback.pageInfo;</p>
|
<p>&welcomeback2.pageInfo1;</p>
|
||||||
|
<!-- Note a href in the anchor below is added by JS -->
|
||||||
|
<p>&welcomeback2.beforelink.pageInfo2;<a id="linkMoreTroubleshooting" target="_blank">&welcomeback2.link.pageInfo2;</a>&welcomeback2.afterlink.pageInfo2;</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
|
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
|
||||||
@ -66,21 +68,9 @@
|
|||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="buttons">
|
<hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="buttons">
|
||||||
#ifdef XP_UNIX
|
<button id="errorTryAgain" label="&welcomeback2.restoreButton;"
|
||||||
<button id="errorCancel" label="&restorepage.closeButton;"
|
accesskey="&welcomeback2.restoreButton.access;"
|
||||||
accesskey="&restorepage.close.access;"
|
|
||||||
oncommand="startNewSession();"/>
|
|
||||||
<button id="errorTryAgain" label="&restorepage.tryagainButton;"
|
|
||||||
accesskey="&restorepage.restore.access;"
|
|
||||||
oncommand="restoreSession();"/>
|
oncommand="restoreSession();"/>
|
||||||
#else
|
|
||||||
<button id="errorTryAgain" label="&restorepage.tryagainButton;"
|
|
||||||
accesskey="&restorepage.restore.access;"
|
|
||||||
oncommand="restoreSession();"/>
|
|
||||||
<button id="errorCancel" label="&restorepage.closeButton;"
|
|
||||||
accesskey="&restorepage.close.access;"
|
|
||||||
oncommand="startNewSession();"/>
|
|
||||||
#endif
|
|
||||||
</hbox>
|
</hbox>
|
||||||
<!-- holds the session data for when the tab is closed -->
|
<!-- holds the session data for when the tab is closed -->
|
||||||
<input type="text" id="sessionData" style="display: none;"/>
|
<input type="text" id="sessionData" style="display: none;"/>
|
||||||
|
@ -637,8 +637,8 @@ BrowserGlue.prototype = {
|
|||||||
let message = resetBundle.formatStringFromName("resetUnusedProfile.message", [productName], 1);
|
let message = resetBundle.formatStringFromName("resetUnusedProfile.message", [productName], 1);
|
||||||
let buttons = [
|
let buttons = [
|
||||||
{
|
{
|
||||||
label: resetBundle.formatStringFromName("resetProfile.resetButton.label", [productName], 1),
|
label: resetBundle.formatStringFromName("refreshProfile.resetButton.label", [productName], 1),
|
||||||
accessKey: resetBundle.GetStringFromName("resetProfile.resetButton.accesskey"),
|
accessKey: resetBundle.GetStringFromName("refreshProfile.resetButton.accesskey"),
|
||||||
callback: function () {
|
callback: function () {
|
||||||
ResetProfile.openConfirmationDialog(win);
|
ResetProfile.openConfirmationDialog(win);
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
const Cc = Components.classes;
|
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||||
const Ci = Components.interfaces;
|
|
||||||
|
Cu.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
var gStateObject;
|
var gStateObject;
|
||||||
var gTreeData;
|
var gTreeData;
|
||||||
@ -11,6 +12,14 @@ var gTreeData;
|
|||||||
// Page initialization
|
// Page initialization
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
|
// pages used by this script may have a link that needs to be updated to
|
||||||
|
// the in-product link.
|
||||||
|
let anchor = document.getElementById("linkMoreTroubleshooting");
|
||||||
|
if (anchor) {
|
||||||
|
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
|
||||||
|
anchor.setAttribute("href", baseURL + "troubleshooting");
|
||||||
|
}
|
||||||
|
|
||||||
// the crashed session state is kept inside a textbox so that SessionStore picks it up
|
// the crashed session state is kept inside a textbox so that SessionStore picks it up
|
||||||
// (for when the tab is closed or the session crashes right again)
|
// (for when the tab is closed or the session crashes right again)
|
||||||
var sessionData = document.getElementById("sessionData");
|
var sessionData = document.getElementById("sessionData");
|
||||||
@ -70,6 +79,14 @@ function initTreeView() {
|
|||||||
function restoreSession() {
|
function restoreSession() {
|
||||||
document.getElementById("errorTryAgain").disabled = true;
|
document.getElementById("errorTryAgain").disabled = true;
|
||||||
|
|
||||||
|
if (!gTreeData.some(aItem => aItem.checked)) {
|
||||||
|
// This should only be possible when we have no "cancel" button, and thus
|
||||||
|
// the "Restore session" button always remains enabled. In that case and
|
||||||
|
// when nothing is selected, we just want a new session.
|
||||||
|
startNewSession();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// remove all unselected tabs from the state before restoring it
|
// remove all unselected tabs from the state before restoring it
|
||||||
var ix = gStateObject.windows.length - 1;
|
var ix = gStateObject.windows.length - 1;
|
||||||
for (var t = gTreeData.length - 1; t >= 0; t--) {
|
for (var t = gTreeData.length - 1; t >= 0; t--) {
|
||||||
@ -191,7 +208,10 @@ function toggleRowChecked(aIx) {
|
|||||||
treeView.treeBox.invalidateRow(gTreeData.indexOf(item.parent));
|
treeView.treeBox.invalidateRow(gTreeData.indexOf(item.parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("errorTryAgain").disabled = !gTreeData.some(isChecked);
|
// we only disable the button when there's no cancel button.
|
||||||
|
if (document.getElementById("errorCancel")) {
|
||||||
|
document.getElementById("errorTryAgain").disabled = !gTreeData.some(isChecked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreSingleTab(aIx, aShifted) {
|
function restoreSingleTab(aIx, aShifted) {
|
||||||
|
@ -23,12 +23,28 @@
|
|||||||
<!ENTITY restorepage.windowLabel "Window %S">
|
<!ENTITY restorepage.windowLabel "Window %S">
|
||||||
|
|
||||||
|
|
||||||
<!-- LOCALIZATION NOTE: The following 'welcomeback' strings are for about:welcomeback,
|
<!-- LOCALIZATION NOTE: The following 'welcomeback2' strings are for about:welcomeback,
|
||||||
not for about:sessionstore -->
|
not for about:sessionstore -->
|
||||||
<!ENTITY welcomeback.tabtitle "Welcome Back!">
|
|
||||||
|
|
||||||
<!-- LOCALIZATION NOTE: The title is intended to be welcoming and congratulatory,
|
<!ENTITY welcomeback2.restoreButton "Let's go!">
|
||||||
expressing joy that the user has successfully migrated their stuff and hope
|
<!ENTITY welcomeback2.restoreButton.access "L">
|
||||||
that now they have a better experience. -->
|
|
||||||
<!ENTITY welcomeback.pageTitle "Welcome Back!">
|
<!ENTITY welcomeback2.tabtitle "Success!">
|
||||||
<!ENTITY welcomeback.pageInfo "&brandShortName; successfully reset your profile. Below is a list of windows and tabs you had open; you can restore them or start with a clean slate.">
|
|
||||||
|
<!ENTITY welcomeback2.pageTitle "Success!">
|
||||||
|
<!ENTITY welcomeback2.pageInfo1 "&brandShortName; is ready to go.">
|
||||||
|
|
||||||
|
<!ENTITY welcomeback2.label.restoreAll "Restore all Windows and Tabs">
|
||||||
|
<!ENTITY welcomeback2.label.restoreSome "Restore only the ones you want">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- LOCALIZATION NOTE (welcomeback2.beforelink.pageInfo2,
|
||||||
|
welcomeback2.afterlink.pageInfo2): these two string are used respectively
|
||||||
|
before and after the the "learn more" link (welcomeback2.link.pageInfo2).
|
||||||
|
Localizers can use one of them, or both, to better adapt this sentence to
|
||||||
|
their language.
|
||||||
|
-->
|
||||||
|
<!ENTITY welcomeback2.beforelink.pageInfo2 "Your add-ons and customizations have been removed and your browser settings have been restored to their defaults. If this didn't fix your issue, ">
|
||||||
|
<!ENTITY welcomeback2.afterlink.pageInfo2 "">
|
||||||
|
|
||||||
|
<!ENTITY welcomeback2.link.pageInfo2 "learn more about what you can do.">
|
||||||
|
@ -604,3 +604,12 @@ slowStartup.disableNotificationButton.accesskey = A
|
|||||||
customizeTips.tip0 = %1$S: You can customize %2$S to work the way you do. Simply drag any of the above to the menu or toolbar. %3$S about customizing %2$S.
|
customizeTips.tip0 = %1$S: You can customize %2$S to work the way you do. Simply drag any of the above to the menu or toolbar. %3$S about customizing %2$S.
|
||||||
customizeTips.tip0.hint = Hint
|
customizeTips.tip0.hint = Hint
|
||||||
customizeTips.tip0.learnMore = Learn more
|
customizeTips.tip0.learnMore = Learn more
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(appmenu.*.description, appmenu.*.label): these are used for
|
||||||
|
# the appmenu labels and buttons that appear when an update is staged for
|
||||||
|
# installation or a background update has failed and a manual download is required.
|
||||||
|
# %S is brandShortName
|
||||||
|
appmenu.restartNeeded.description = Restart %S to apply updates
|
||||||
|
appmenu.updateFailed.description = Background update failed, please download update
|
||||||
|
appmenu.restartBrowserButton.label = Restart %S
|
||||||
|
appmenu.downloadUpdateButton.label = Download Update
|
||||||
|
@ -97,6 +97,7 @@ new_contact_button=New Contact
|
|||||||
## and click the 'New Contact' button to see the fields.
|
## and click the 'New Contact' button to see the fields.
|
||||||
new_contact_name_placeholder=Name
|
new_contact_name_placeholder=Name
|
||||||
new_contact_email_placeholder=Email
|
new_contact_email_placeholder=Email
|
||||||
|
new_contact_phone_placeholder=Firefox OS Phone
|
||||||
|
|
||||||
contacts_blocked_contacts=Blocked Contacts
|
contacts_blocked_contacts=Blocked Contacts
|
||||||
|
|
||||||
|
@ -6,14 +6,12 @@
|
|||||||
<!ENTITY window.maxWidth "400">
|
<!ENTITY window.maxWidth "400">
|
||||||
|
|
||||||
<!ENTITY startSafeMode.label "Start in Safe Mode">
|
<!ENTITY startSafeMode.label "Start in Safe Mode">
|
||||||
<!ENTITY resetProfile.label "Reset &brandShortName;">
|
<!ENTITY refreshProfile.label "Refresh &brandShortName;">
|
||||||
|
|
||||||
<!ENTITY safeModeDescription3.label "Safe Mode is a special mode of &brandShortName; that can be used to troubleshoot issues.">
|
<!ENTITY safeModeDescription3.label "Safe Mode is a special mode of &brandShortName; that can be used to troubleshoot issues.">
|
||||||
<!ENTITY safeModeDescription4.label "Your add-ons and custom settings will be temporarily disabled.">
|
<!ENTITY safeModeDescription4.label "Your add-ons and custom settings will be temporarily disabled.">
|
||||||
|
|
||||||
<!ENTITY resetProfileInstead.label "You can also Reset &brandShortName; if you want to start fresh.">
|
<!ENTITY refreshProfileInstead.label "You can also skip troubleshooting and try refreshing &brandShortName;.">
|
||||||
|
|
||||||
<!-- LOCALIZATION NOTE (autoSafeModeDescription2.label safeModeInstead.label resetProfileFooter.label): Shown on the safe mode dialog after multiple startup crashes. See also chrome/global/resetProfile.dtd -->
|
<!-- LOCALIZATION NOTE (autoSafeModeDescription3.label): Shown on the safe mode dialog after multiple startup crashes. See also chrome/global/resetProfile.dtd -->
|
||||||
<!ENTITY autoSafeModeDescription2.label "&brandShortName; closed unexpectedly while starting. This might be caused by add-ons or other problems. You can try to resolve the problem by resetting &brandShortName; to its default state or troubleshooting in Safe Mode.">
|
<!ENTITY autoSafeModeDescription3.label "&brandShortName; closed unexpectedly while starting. This might be caused by add-ons or other problems. You can try to resolve the problem by troubleshooting in Safe Mode.">
|
||||||
<!ENTITY resetProfileFooter.label "Everything else will be reset to factory defaults.">
|
|
||||||
<!ENTITY safeModeInstead.label "If you don't want this, you can continue in Safe Mode to do your own troubleshooting with your add-ons and custom settings temporarily disabled.">
|
|
||||||
|
@ -18,9 +18,9 @@ class ActionModeCompat implements GeckoPopupMenu.OnMenuItemClickListener,
|
|||||||
View.OnClickListener {
|
View.OnClickListener {
|
||||||
private final String LOGTAG = "GeckoActionModeCompat";
|
private final String LOGTAG = "GeckoActionModeCompat";
|
||||||
|
|
||||||
private Callback mCallback;
|
private final Callback mCallback;
|
||||||
private ActionModeCompatView mView;
|
private final ActionModeCompatView mView;
|
||||||
private Presenter mPresenter;
|
private final Presenter mPresenter;
|
||||||
|
|
||||||
/* A set of callbacks to be called during this ActionMode's lifecycle. These will control the
|
/* A set of callbacks to be called during this ActionMode's lifecycle. These will control the
|
||||||
* creation, interaction with, and destruction of menuitems for the view */
|
* creation, interaction with, and destruction of menuitems for the view */
|
||||||
|
@ -33,7 +33,7 @@ public class AlertNotification
|
|||||||
private String mPrevAlertText = "";
|
private String mPrevAlertText = "";
|
||||||
|
|
||||||
private static final double UPDATE_THRESHOLD = .01;
|
private static final double UPDATE_THRESHOLD = .01;
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
public AlertNotification(Context aContext, int aNotificationId, int aIcon,
|
public AlertNotification(Context aContext, int aNotificationId, int aIcon,
|
||||||
String aTitle, String aText, long aWhen, Uri aIconUri) {
|
String aTitle, String aText, long aWhen, Uri aIconUri) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#filter substitution
|
//#filter substitution
|
||||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
/* -*- 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
|
* 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
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@ -31,11 +31,11 @@ public class AppConstants {
|
|||||||
public static final class Versions {
|
public static final class Versions {
|
||||||
public static final int MIN_SDK_VERSION = @MOZ_ANDROID_MIN_SDK_VERSION@;
|
public static final int MIN_SDK_VERSION = @MOZ_ANDROID_MIN_SDK_VERSION@;
|
||||||
public static final int MAX_SDK_VERSION =
|
public static final int MAX_SDK_VERSION =
|
||||||
#ifdef MOZ_ANDROID_MAX_SDK_VERSION
|
//#ifdef MOZ_ANDROID_MAX_SDK_VERSION
|
||||||
@MOZ_ANDROID_MAX_SDK_VERSION@;
|
@MOZ_ANDROID_MAX_SDK_VERSION@;
|
||||||
#else
|
//#else
|
||||||
999;
|
999;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The SDK_INT >= N check can only pass if our MAX_SDK_VERSION is
|
* The SDK_INT >= N check can only pass if our MAX_SDK_VERSION is
|
||||||
@ -93,11 +93,11 @@ public class AppConstants {
|
|||||||
public static final String MOZILLA_VERSION = @MOZILLA_VERSION@;
|
public static final String MOZILLA_VERSION = @MOZILLA_VERSION@;
|
||||||
|
|
||||||
public static final String MOZ_STUMBLER_API_KEY =
|
public static final String MOZ_STUMBLER_API_KEY =
|
||||||
#ifdef MOZ_ANDROID_MLS_STUMBLER
|
//#ifdef MOZ_ANDROID_MLS_STUMBLER
|
||||||
"@MOZ_STUMBLER_API_KEY@";
|
"@MOZ_STUMBLER_API_KEY@";
|
||||||
#else
|
//#else
|
||||||
null;
|
null;
|
||||||
#endif
|
//#endif
|
||||||
public static final boolean MOZ_STUMBLER_BUILD_TIME_ENABLED = (MOZ_STUMBLER_API_KEY != null);
|
public static final boolean MOZ_STUMBLER_BUILD_TIME_ENABLED = (MOZ_STUMBLER_API_KEY != null);
|
||||||
|
|
||||||
public static final String MOZ_CHILD_PROCESS_NAME = "@MOZ_CHILD_PROCESS_NAME@";
|
public static final String MOZ_CHILD_PROCESS_NAME = "@MOZ_CHILD_PROCESS_NAME@";
|
||||||
@ -122,142 +122,142 @@ public class AppConstants {
|
|||||||
public static final int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@;
|
public static final int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@;
|
||||||
|
|
||||||
public static final boolean MOZ_ANDROID_ANR_REPORTER =
|
public static final boolean MOZ_ANDROID_ANR_REPORTER =
|
||||||
#ifdef MOZ_ANDROID_ANR_REPORTER
|
//#ifdef MOZ_ANDROID_ANR_REPORTER
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final String MOZ_PKG_SPECIAL =
|
public static final String MOZ_PKG_SPECIAL =
|
||||||
#ifdef MOZ_PKG_SPECIAL
|
//#ifdef MOZ_PKG_SPECIAL
|
||||||
"@MOZ_PKG_SPECIAL@";
|
"@MOZ_PKG_SPECIAL@";
|
||||||
#else
|
//#else
|
||||||
null;
|
null;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this APK was built with constrained resources --
|
* Whether this APK was built with constrained resources --
|
||||||
* no xhdpi+ images, for example.
|
* no xhdpi+ images, for example.
|
||||||
*/
|
*/
|
||||||
public static final boolean MOZ_ANDROID_RESOURCE_CONSTRAINED =
|
public static final boolean MOZ_ANDROID_RESOURCE_CONSTRAINED =
|
||||||
#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
|
//#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_SERVICES_HEALTHREPORT =
|
public static final boolean MOZ_SERVICES_HEALTHREPORT =
|
||||||
#ifdef MOZ_SERVICES_HEALTHREPORT
|
//#ifdef MOZ_SERVICES_HEALTHREPORT
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_TELEMETRY_ON_BY_DEFAULT =
|
public static final boolean MOZ_TELEMETRY_ON_BY_DEFAULT =
|
||||||
#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
|
//#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final String TELEMETRY_PREF_NAME =
|
public static final String TELEMETRY_PREF_NAME =
|
||||||
"toolkit.telemetry.enabled";
|
"toolkit.telemetry.enabled";
|
||||||
|
|
||||||
public static final boolean MOZ_TELEMETRY_REPORTING =
|
public static final boolean MOZ_TELEMETRY_REPORTING =
|
||||||
#ifdef MOZ_TELEMETRY_REPORTING
|
//#ifdef MOZ_TELEMETRY_REPORTING
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_CRASHREPORTER =
|
public static final boolean MOZ_CRASHREPORTER =
|
||||||
#if MOZ_CRASHREPORTER
|
//#if MOZ_CRASHREPORTER
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_DATA_REPORTING =
|
public static final boolean MOZ_DATA_REPORTING =
|
||||||
#ifdef MOZ_DATA_REPORTING
|
//#ifdef MOZ_DATA_REPORTING
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_LOCALE_SWITCHER =
|
public static final boolean MOZ_LOCALE_SWITCHER =
|
||||||
#ifdef MOZ_LOCALE_SWITCHER
|
//#ifdef MOZ_LOCALE_SWITCHER
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_UPDATER =
|
public static final boolean MOZ_UPDATER =
|
||||||
#ifdef MOZ_UPDATER
|
//#ifdef MOZ_UPDATER
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_WEBSMS_BACKEND =
|
public static final boolean MOZ_WEBSMS_BACKEND =
|
||||||
#ifdef MOZ_WEBSMS_BACKEND
|
//#ifdef MOZ_WEBSMS_BACKEND
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
// Android Beam is only supported on API14+, so we don't even bother building
|
// Android Beam is only supported on API14+, so we don't even bother building
|
||||||
// it if this APK doesn't include API14 support.
|
// it if this APK doesn't include API14 support.
|
||||||
public static final boolean MOZ_ANDROID_BEAM =
|
public static final boolean MOZ_ANDROID_BEAM =
|
||||||
#ifdef MOZ_ANDROID_BEAM
|
//#ifdef MOZ_ANDROID_BEAM
|
||||||
Versions.feature14Plus;
|
Versions.feature14Plus;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_ANDROID_APZ =
|
public static final boolean MOZ_ANDROID_APZ =
|
||||||
#ifdef MOZ_ANDROID_APZ
|
//#ifdef MOZ_ANDROID_APZ
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
// See this wiki page for more details about channel specific build defines:
|
// See this wiki page for more details about channel specific build defines:
|
||||||
// https://wiki.mozilla.org/Platform/Channel-specific_build_defines
|
// https://wiki.mozilla.org/Platform/Channel-specific_build_defines
|
||||||
public static final boolean RELEASE_BUILD =
|
public static final boolean RELEASE_BUILD =
|
||||||
#ifdef RELEASE_BUILD
|
//#ifdef RELEASE_BUILD
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean DEBUG_BUILD =
|
public static final boolean DEBUG_BUILD =
|
||||||
#ifdef MOZ_DEBUG
|
//#ifdef MOZ_DEBUG
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean MOZ_MEDIA_PLAYER =
|
public static final boolean MOZ_MEDIA_PLAYER =
|
||||||
#ifdef MOZ_NATIVE_DEVICES
|
//#ifdef MOZ_NATIVE_DEVICES
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
// Official corresponds, roughly, to whether this build is performed on
|
// Official corresponds, roughly, to whether this build is performed on
|
||||||
// Mozilla's continuous integration infrastructure. You should disable
|
// Mozilla's continuous integration infrastructure. You should disable
|
||||||
// developer-only functionality when this flag is set.
|
// developer-only functionality when this flag is set.
|
||||||
public static final boolean MOZILLA_OFFICIAL =
|
public static final boolean MOZILLA_OFFICIAL =
|
||||||
#ifdef MOZILLA_OFFICIAL
|
//#ifdef MOZILLA_OFFICIAL
|
||||||
true;
|
true;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final boolean ANDROID_DOWNLOADS_INTEGRATION =
|
public static final boolean ANDROID_DOWNLOADS_INTEGRATION =
|
||||||
#ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
|
//#ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
|
||||||
AppConstants.Versions.feature12Plus;
|
AppConstants.Versions.feature12Plus;
|
||||||
#else
|
//#else
|
||||||
false;
|
false;
|
||||||
#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ public class BrowserApp extends GeckoApp
|
|||||||
// race by determining if the web content should be hidden at the animation's end.
|
// race by determining if the web content should be hidden at the animation's end.
|
||||||
private boolean mHideWebContentOnAnimationEnd;
|
private boolean mHideWebContentOnAnimationEnd;
|
||||||
|
|
||||||
private DynamicToolbar mDynamicToolbar = new DynamicToolbar();
|
private final DynamicToolbar mDynamicToolbar = new DynamicToolbar();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(final String name, final Context context, final AttributeSet attrs) {
|
public View onCreateView(final String name, final Context context, final AttributeSet attrs) {
|
||||||
|
@ -55,11 +55,11 @@ public class BrowserLocaleManager implements LocaleManager {
|
|||||||
private volatile Locale currentLocale;
|
private volatile Locale currentLocale;
|
||||||
private volatile Locale systemLocale = Locale.getDefault();
|
private volatile Locale systemLocale = Locale.getDefault();
|
||||||
|
|
||||||
private AtomicBoolean inited = new AtomicBoolean(false);
|
private final AtomicBoolean inited = new AtomicBoolean(false);
|
||||||
private boolean systemLocaleDidChange;
|
private boolean systemLocaleDidChange;
|
||||||
private BroadcastReceiver receiver;
|
private BroadcastReceiver receiver;
|
||||||
|
|
||||||
private static AtomicReference<LocaleManager> instance = new AtomicReference<LocaleManager>();
|
private static final AtomicReference<LocaleManager> instance = new AtomicReference<LocaleManager>();
|
||||||
|
|
||||||
public static LocaleManager getInstance() {
|
public static LocaleManager getInstance() {
|
||||||
LocaleManager localeManager = instance.get();
|
LocaleManager localeManager = instance.get();
|
||||||
|
@ -43,7 +43,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
|||||||
private final RouteInfo route;
|
private final RouteInfo route;
|
||||||
private GoogleApiClient apiClient;
|
private GoogleApiClient apiClient;
|
||||||
private RemoteMediaPlayer remoteMediaPlayer;
|
private RemoteMediaPlayer remoteMediaPlayer;
|
||||||
private boolean canMirror;
|
private final boolean canMirror;
|
||||||
private String mSessionId;
|
private String mSessionId;
|
||||||
private MirrorChannel mMirrorChannel;
|
private MirrorChannel mMirrorChannel;
|
||||||
private boolean mApplicationStarted = false;
|
private boolean mApplicationStarted = false;
|
||||||
|
@ -90,8 +90,8 @@ public class ContactService implements GeckoEventListener {
|
|||||||
private HashMap<String, Integer> mWebsiteTypesMap;
|
private HashMap<String, Integer> mWebsiteTypesMap;
|
||||||
private HashMap<String, Integer> mImTypesMap;
|
private HashMap<String, Integer> mImTypesMap;
|
||||||
|
|
||||||
private ContentResolver mContentResolver;
|
private final ContentResolver mContentResolver;
|
||||||
private GeckoApp mActivity;
|
private final GeckoApp mActivity;
|
||||||
|
|
||||||
ContactService(EventDispatcher eventDispatcher, GeckoApp activity) {
|
ContactService(EventDispatcher eventDispatcher, GeckoApp activity) {
|
||||||
mEventDispatcher = eventDispatcher;
|
mEventDispatcher = eventDispatcher;
|
||||||
@ -671,7 +671,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
if (typeConstant == BaseTypes.TYPE_CUSTOM) {
|
if (typeConstant == BaseTypes.TYPE_CUSTOM) {
|
||||||
type = cursor.getString(cursor.getColumnIndex(typeLabelColumn));
|
type = cursor.getString(cursor.getColumnIndex(typeLabelColumn));
|
||||||
} else {
|
} else {
|
||||||
type = getKeyFromMapValue(typeMap, Integer.valueOf(typeConstant));
|
type = getKeyFromMapValue(typeMap, typeConstant);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since an object may have multiple types, it may have already been added,
|
// Since an object may have multiple types, it may have already been added,
|
||||||
@ -712,7 +712,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
if (typeConstant == Phone.TYPE_CUSTOM) {
|
if (typeConstant == Phone.TYPE_CUSTOM) {
|
||||||
type = cursor.getString(cursor.getColumnIndex(Phone.LABEL));
|
type = cursor.getString(cursor.getColumnIndex(Phone.LABEL));
|
||||||
} else {
|
} else {
|
||||||
type = getKeyFromMapValue(mPhoneTypesMap, Integer.valueOf(typeConstant));
|
type = getKeyFromMapValue(mPhoneTypesMap, typeConstant);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since a phone may have multiple types, it may have already been added,
|
// Since a phone may have multiple types, it may have already been added,
|
||||||
@ -759,7 +759,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
if (typeConstant == StructuredPostal.TYPE_CUSTOM) {
|
if (typeConstant == StructuredPostal.TYPE_CUSTOM) {
|
||||||
type = cursor.getString(cursor.getColumnIndex(StructuredPostal.LABEL));
|
type = cursor.getString(cursor.getColumnIndex(StructuredPostal.LABEL));
|
||||||
} else {
|
} else {
|
||||||
type = getKeyFromMapValue(mAddressTypesMap, Integer.valueOf(typeConstant));
|
type = getKeyFromMapValue(mAddressTypesMap, typeConstant);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since an email may have multiple types, it may have already been added,
|
// Since an email may have multiple types, it may have already been added,
|
||||||
@ -984,7 +984,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String returnStatus = "KO";
|
String returnStatus = "KO";
|
||||||
Long newRawContactId = new Long(-1);
|
Long newRawContactId = -1L;
|
||||||
|
|
||||||
// Insert the contact!
|
// Insert the contact!
|
||||||
ContentProviderResult[] insertResults = applyBatch(newContactOptions);
|
ContentProviderResult[] insertResults = applyBatch(newContactOptions);
|
||||||
@ -1476,7 +1476,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
|
|
||||||
private void getContactsCount(final String requestID) {
|
private void getContactsCount(final String requestID) {
|
||||||
Cursor cursor = getAllRawContactIdsCursor();
|
Cursor cursor = getAllRawContactIdsCursor();
|
||||||
Integer numContacts = Integer.valueOf(cursor.getCount());
|
Integer numContacts = cursor.getCount();
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
|
||||||
sendCallbackToJavascript("Android:Contacts:Count", requestID, new String[] {"count"},
|
sendCallbackToJavascript("Android:Contacts:Count", requestID, new String[] {"count"},
|
||||||
@ -1823,7 +1823,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getKeyFromMapValue(final HashMap<String, Integer> map, Integer value) {
|
private static String getKeyFromMapValue(final HashMap<String, Integer> map, int value) {
|
||||||
for (Entry<String, Integer> entry : map.entrySet()) {
|
for (Entry<String, Integer> entry : map.entrySet()) {
|
||||||
if (value == entry.getValue()) {
|
if (value == entry.getValue()) {
|
||||||
return entry.getKey();
|
return entry.getKey();
|
||||||
@ -1898,7 +1898,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
private int getAddressType(String addressType) {
|
private int getAddressType(String addressType) {
|
||||||
initAddressTypesMap();
|
initAddressTypesMap();
|
||||||
Integer type = mAddressTypesMap.get(addressType.toLowerCase());
|
Integer type = mAddressTypesMap.get(addressType.toLowerCase());
|
||||||
return (type != null ? Integer.valueOf(type) : StructuredPostal.TYPE_CUSTOM);
|
return type != null ? type : StructuredPostal.TYPE_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initAddressTypesMap() {
|
private void initAddressTypesMap() {
|
||||||
@ -1914,7 +1914,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
private int getPhoneType(String phoneType) {
|
private int getPhoneType(String phoneType) {
|
||||||
initPhoneTypesMap();
|
initPhoneTypesMap();
|
||||||
Integer type = mPhoneTypesMap.get(phoneType.toLowerCase());
|
Integer type = mPhoneTypesMap.get(phoneType.toLowerCase());
|
||||||
return (type != null ? Integer.valueOf(type) : Phone.TYPE_CUSTOM);
|
return type != null ? type : Phone.TYPE_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initPhoneTypesMap() {
|
private void initPhoneTypesMap() {
|
||||||
@ -1949,7 +1949,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
private int getEmailType(String emailType) {
|
private int getEmailType(String emailType) {
|
||||||
initEmailTypesMap();
|
initEmailTypesMap();
|
||||||
Integer type = mEmailTypesMap.get(emailType.toLowerCase());
|
Integer type = mEmailTypesMap.get(emailType.toLowerCase());
|
||||||
return (type != null ? Integer.valueOf(type) : Email.TYPE_CUSTOM);
|
return type != null ? type : Email.TYPE_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initEmailTypesMap() {
|
private void initEmailTypesMap() {
|
||||||
@ -1966,7 +1966,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
private int getWebsiteType(String webisteType) {
|
private int getWebsiteType(String webisteType) {
|
||||||
initWebsiteTypesMap();
|
initWebsiteTypesMap();
|
||||||
Integer type = mWebsiteTypesMap.get(webisteType.toLowerCase());
|
Integer type = mWebsiteTypesMap.get(webisteType.toLowerCase());
|
||||||
return (type != null ? Integer.valueOf(type) : Website.TYPE_CUSTOM);
|
return type != null ? type : Website.TYPE_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initWebsiteTypesMap() {
|
private void initWebsiteTypesMap() {
|
||||||
@ -1986,7 +1986,7 @@ public class ContactService implements GeckoEventListener {
|
|||||||
private int getImType(String imType) {
|
private int getImType(String imType) {
|
||||||
initImTypesMap();
|
initImTypesMap();
|
||||||
Integer type = mImTypesMap.get(imType.toLowerCase());
|
Integer type = mImTypesMap.get(imType.toLowerCase());
|
||||||
return (type != null ? Integer.valueOf(type) : Im.TYPE_CUSTOM);
|
return type != null ? type : Im.TYPE_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initImTypesMap() {
|
private void initImTypesMap() {
|
||||||
|
@ -282,8 +282,8 @@ public class CrashReporter extends Activity
|
|||||||
|
|
||||||
private String generateBoundary() {
|
private String generateBoundary() {
|
||||||
// Generate some random numbers to fill out the boundary
|
// Generate some random numbers to fill out the boundary
|
||||||
int r0 = (int)((double)Integer.MAX_VALUE * Math.random());
|
int r0 = (int)(Integer.MAX_VALUE * Math.random());
|
||||||
int r1 = (int)((double)Integer.MAX_VALUE * Math.random());
|
int r1 = (int)(Integer.MAX_VALUE * Math.random());
|
||||||
return String.format("---------------------------%08X%08X", r0, r1);
|
return String.format("---------------------------%08X%08X", r0, r1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class DoorHangerPopup extends ArrowPopup
|
|||||||
|
|
||||||
// Stores a set of all active DoorHanger notifications. A DoorHanger is
|
// Stores a set of all active DoorHanger notifications. A DoorHanger is
|
||||||
// uniquely identified by its tabId and value.
|
// uniquely identified by its tabId and value.
|
||||||
private HashSet<DoorHanger> mDoorHangers;
|
private final HashSet<DoorHanger> mDoorHangers;
|
||||||
|
|
||||||
// Whether or not the doorhanger popup is disabled.
|
// Whether or not the doorhanger popup is disabled.
|
||||||
private boolean mDisabled;
|
private boolean mDisabled;
|
||||||
|
@ -106,7 +106,7 @@ public class DynamicToolbar {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean immediate = transition.equals(VisibilityTransition.IMMEDIATE);
|
final boolean immediate = transition == VisibilityTransition.IMMEDIATE;
|
||||||
if (visible) {
|
if (visible) {
|
||||||
layerView.getLayerMarginsAnimator().showMargins(immediate);
|
layerView.getLayerMarginsAnimator().showMargins(immediate);
|
||||||
} else {
|
} else {
|
||||||
|
@ -401,8 +401,8 @@ public class FormAssistPopup extends RelativeLayout implements GeckoEventListene
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class AutoCompleteListAdapter extends ArrayAdapter<Pair<String, String>> {
|
private class AutoCompleteListAdapter extends ArrayAdapter<Pair<String, String>> {
|
||||||
private LayoutInflater mInflater;
|
private final LayoutInflater mInflater;
|
||||||
private int mTextViewResourceId;
|
private final int mTextViewResourceId;
|
||||||
|
|
||||||
public AutoCompleteListAdapter(Context context, int textViewResourceId) {
|
public AutoCompleteListAdapter(Context context, int textViewResourceId) {
|
||||||
super(context, textViewResourceId);
|
super(context, textViewResourceId);
|
||||||
|
@ -183,7 +183,7 @@ public abstract class GeckoApp
|
|||||||
private FullScreenHolder mFullScreenPluginContainer;
|
private FullScreenHolder mFullScreenPluginContainer;
|
||||||
private View mFullScreenPluginView;
|
private View mFullScreenPluginView;
|
||||||
|
|
||||||
private HashMap<String, PowerManager.WakeLock> mWakeLocks = new HashMap<String, PowerManager.WakeLock>();
|
private final HashMap<String, PowerManager.WakeLock> mWakeLocks = new HashMap<String, PowerManager.WakeLock>();
|
||||||
|
|
||||||
protected boolean mShouldRestore;
|
protected boolean mShouldRestore;
|
||||||
protected boolean mInitialized;
|
protected boolean mInitialized;
|
||||||
@ -1016,9 +1016,9 @@ public abstract class GeckoApp
|
|||||||
int inSampleSize = 1;
|
int inSampleSize = 1;
|
||||||
if (height > idealHeight || width > idealWidth) {
|
if (height > idealHeight || width > idealWidth) {
|
||||||
if (width > height) {
|
if (width > height) {
|
||||||
inSampleSize = Math.round((float)height / (float)idealHeight);
|
inSampleSize = Math.round((float)height / idealHeight);
|
||||||
} else {
|
} else {
|
||||||
inSampleSize = Math.round((float)width / (float)idealWidth);
|
inSampleSize = Math.round((float)width / idealWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return inSampleSize;
|
return inSampleSize;
|
||||||
|
@ -30,7 +30,7 @@ public class GeckoBatteryManager extends BroadcastReceiver {
|
|||||||
private static boolean sCharging = kDefaultCharging;
|
private static boolean sCharging = kDefaultCharging;
|
||||||
private static double sRemainingTime = kDefaultRemainingTime;
|
private static double sRemainingTime = kDefaultRemainingTime;
|
||||||
|
|
||||||
private static GeckoBatteryManager sInstance = new GeckoBatteryManager();
|
private static final GeckoBatteryManager sInstance = new GeckoBatteryManager();
|
||||||
|
|
||||||
private final IntentFilter mFilter;
|
private final IntentFilter mFilter;
|
||||||
private Context mApplicationContext;
|
private Context mApplicationContext;
|
||||||
@ -107,8 +107,8 @@ public class GeckoBatteryManager extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We need two doubles because sLevel is a double.
|
// We need two doubles because sLevel is a double.
|
||||||
double current = (double)intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
double current = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
||||||
double max = (double)intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
double max = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||||
if (current == -1 || max == -1) {
|
if (current == -1 || max == -1) {
|
||||||
Log.e(LOGTAG, "Failed to get battery level!");
|
Log.e(LOGTAG, "Failed to get battery level!");
|
||||||
sLevel = kDefaultLevel;
|
sLevel = kDefaultLevel;
|
||||||
|
@ -25,7 +25,7 @@ public class GeckoConnectivityReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
private static final String LOGTAG = "GeckoConnectivityReceiver";
|
private static final String LOGTAG = "GeckoConnectivityReceiver";
|
||||||
|
|
||||||
private static GeckoConnectivityReceiver sInstance = new GeckoConnectivityReceiver();
|
private static final GeckoConnectivityReceiver sInstance = new GeckoConnectivityReceiver();
|
||||||
|
|
||||||
private final IntentFilter mFilter;
|
private final IntentFilter mFilter;
|
||||||
private Context mApplicationContext;
|
private Context mApplicationContext;
|
||||||
|
@ -43,7 +43,7 @@ public class GeckoEvent {
|
|||||||
private static final int EVENT_FACTORY_SIZE = 5;
|
private static final int EVENT_FACTORY_SIZE = 5;
|
||||||
|
|
||||||
// Maybe we're probably better to just make mType non final, and just store GeckoEvents in here...
|
// Maybe we're probably better to just make mType non final, and just store GeckoEvents in here...
|
||||||
private static SparseArray<ArrayBlockingQueue<GeckoEvent>> mEvents = new SparseArray<ArrayBlockingQueue<GeckoEvent>>();
|
private static final SparseArray<ArrayBlockingQueue<GeckoEvent>> mEvents = new SparseArray<ArrayBlockingQueue<GeckoEvent>>();
|
||||||
|
|
||||||
public static GeckoEvent get(NativeGeckoEvent type) {
|
public static GeckoEvent get(NativeGeckoEvent type) {
|
||||||
synchronized (mEvents) {
|
synchronized (mEvents) {
|
||||||
|
@ -997,7 +997,7 @@ final class DebugGeckoInputConnection
|
|||||||
implements InvocationHandler {
|
implements InvocationHandler {
|
||||||
|
|
||||||
private InputConnection mProxy;
|
private InputConnection mProxy;
|
||||||
private StringBuilder mCallLevel;
|
private final StringBuilder mCallLevel;
|
||||||
|
|
||||||
private DebugGeckoInputConnection(View targetView,
|
private DebugGeckoInputConnection(View targetView,
|
||||||
GeckoEditableClient editable) {
|
GeckoEditableClient editable) {
|
||||||
|
@ -62,7 +62,7 @@ public class GeckoJavaSampler {
|
|||||||
private boolean mPauseSampler;
|
private boolean mPauseSampler;
|
||||||
private boolean mStopSampler;
|
private boolean mStopSampler;
|
||||||
|
|
||||||
private SparseArray<Sample[]> mSamples = new SparseArray<Sample[]>();
|
private final SparseArray<Sample[]> mSamples = new SparseArray<Sample[]>();
|
||||||
private int mSamplePos;
|
private int mSamplePos;
|
||||||
|
|
||||||
public SamplingThread(final int aInterval, final int aSampleCount) {
|
public SamplingThread(final int aInterval, final int aSampleCount) {
|
||||||
@ -142,7 +142,7 @@ public class GeckoJavaSampler {
|
|||||||
Sample sample = getSample(aThreadId, aSampleId);
|
Sample sample = getSample(aThreadId, aSampleId);
|
||||||
if (sample != null) {
|
if (sample != null) {
|
||||||
if (sample.mJavaTime != 0) {
|
if (sample.mJavaTime != 0) {
|
||||||
return (double)(sample.mJavaTime -
|
return (sample.mJavaTime -
|
||||||
SystemClock.elapsedRealtime()) + getProfilerTime();
|
SystemClock.elapsedRealtime()) + getProfilerTime();
|
||||||
}
|
}
|
||||||
System.out.println("Sample: " + sample.mTime);
|
System.out.println("Sample: " + sample.mTime);
|
||||||
|
@ -40,7 +40,7 @@ public final class GeckoProfile {
|
|||||||
public static final String DEFAULT_PROFILE = "default";
|
public static final String DEFAULT_PROFILE = "default";
|
||||||
public static final String GUEST_PROFILE = "guest";
|
public static final String GUEST_PROFILE = "guest";
|
||||||
|
|
||||||
private static HashMap<String, GeckoProfile> sProfileCache = new HashMap<String, GeckoProfile>();
|
private static final HashMap<String, GeckoProfile> sProfileCache = new HashMap<String, GeckoProfile>();
|
||||||
private static String sDefaultProfileName;
|
private static String sDefaultProfileName;
|
||||||
|
|
||||||
// Caches the guest profile dir.
|
// Caches the guest profile dir.
|
||||||
|
@ -58,7 +58,7 @@ public class GeckoProfileDirectories {
|
|||||||
/**
|
/**
|
||||||
* Returns true if the supplied profile entry represents the default profile.
|
* Returns true if the supplied profile entry represents the default profile.
|
||||||
*/
|
*/
|
||||||
private static INISectionPredicate sectionIsDefault = new INISectionPredicate() {
|
private static final INISectionPredicate sectionIsDefault = new INISectionPredicate() {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(INISection section) {
|
public boolean matches(INISection section) {
|
||||||
return section.getIntProperty("Default") == 1;
|
return section.getIntProperty("Default") == 1;
|
||||||
@ -68,7 +68,7 @@ public class GeckoProfileDirectories {
|
|||||||
/**
|
/**
|
||||||
* Returns true if the supplied profile entry has a 'Name' field.
|
* Returns true if the supplied profile entry has a 'Name' field.
|
||||||
*/
|
*/
|
||||||
private static INISectionPredicate sectionHasName = new INISectionPredicate() {
|
private static final INISectionPredicate sectionHasName = new INISectionPredicate() {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(INISection section) {
|
public boolean matches(INISection section) {
|
||||||
final String name = section.getStringProperty("Name");
|
final String name = section.getStringProperty("Name");
|
||||||
|
@ -37,7 +37,7 @@ public class GeckoThread extends Thread implements GeckoEventListener {
|
|||||||
GeckoExited
|
GeckoExited
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AtomicReference<LaunchState> sLaunchState =
|
private static final AtomicReference<LaunchState> sLaunchState =
|
||||||
new AtomicReference<LaunchState>(LaunchState.Launching);
|
new AtomicReference<LaunchState>(LaunchState.Launching);
|
||||||
|
|
||||||
private static GeckoThread sGeckoThread;
|
private static GeckoThread sGeckoThread;
|
||||||
|
@ -31,7 +31,7 @@ public final class IntentHelper implements GeckoEventListener {
|
|||||||
};
|
};
|
||||||
private static IntentHelper instance;
|
private static IntentHelper instance;
|
||||||
|
|
||||||
private Activity activity;
|
private final Activity activity;
|
||||||
|
|
||||||
private IntentHelper(Activity activity) {
|
private IntentHelper(Activity activity) {
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
|
@ -26,11 +26,11 @@ import android.graphics.drawable.Drawable;
|
|||||||
* to specify the alpha) in order.
|
* to specify the alpha) in order.
|
||||||
*/
|
*/
|
||||||
public class LightweightThemeDrawable extends Drawable {
|
public class LightweightThemeDrawable extends Drawable {
|
||||||
private Paint mPaint;
|
private final Paint mPaint;
|
||||||
private Paint mColorPaint;
|
private Paint mColorPaint;
|
||||||
|
|
||||||
private Bitmap mBitmap;
|
private final Bitmap mBitmap;
|
||||||
private Resources mResources;
|
private final Resources mResources;
|
||||||
|
|
||||||
private int mStartColor;
|
private int mStartColor;
|
||||||
private int mEndColor;
|
private int mEndColor;
|
||||||
@ -53,8 +53,9 @@ public class LightweightThemeDrawable extends Drawable {
|
|||||||
@Override
|
@Override
|
||||||
public void draw(Canvas canvas) {
|
public void draw(Canvas canvas) {
|
||||||
// Draw the colors, if available.
|
// Draw the colors, if available.
|
||||||
if (mColorPaint != null)
|
if (mColorPaint != null) {
|
||||||
canvas.drawPaint(mColorPaint);
|
canvas.drawPaint(mColorPaint);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw the bitmap.
|
// Draw the bitmap.
|
||||||
canvas.drawPaint(mPaint);
|
canvas.drawPaint(mPaint);
|
||||||
@ -75,7 +76,7 @@ public class LightweightThemeDrawable extends Drawable {
|
|||||||
@Override
|
@Override
|
||||||
public void setColorFilter(ColorFilter filter) {
|
public void setColorFilter(ColorFilter filter) {
|
||||||
mPaint.setColorFilter(filter);
|
mPaint.setColorFilter(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a paint that paint a particular color.
|
* Creates a paint that paint a particular color.
|
||||||
@ -112,17 +113,17 @@ public class LightweightThemeDrawable extends Drawable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initializeBitmapShader() {
|
private void initializeBitmapShader() {
|
||||||
// A bitmap-shader to draw the bitmap.
|
// A bitmap-shader to draw the bitmap.
|
||||||
// Clamp mode will repeat the last row of pixels.
|
// Clamp mode will repeat the last row of pixels.
|
||||||
// Hence its better to have an endAlpha of 0 for the linear-gradient.
|
// Hence its better to have an endAlpha of 0 for the linear-gradient.
|
||||||
BitmapShader bitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
|
BitmapShader bitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
|
||||||
|
|
||||||
// A linear-gradient to specify the opacity of the bitmap.
|
// A linear-gradient to specify the opacity of the bitmap.
|
||||||
LinearGradient gradient = new LinearGradient(0, 0, 0, mBitmap.getHeight(), mStartColor, mEndColor, Shader.TileMode.CLAMP);
|
LinearGradient gradient = new LinearGradient(0, 0, 0, mBitmap.getHeight(), mStartColor, mEndColor, Shader.TileMode.CLAMP);
|
||||||
|
|
||||||
// Make a combined shader -- a performance win.
|
// Make a combined shader -- a performance win.
|
||||||
// The linear-gradient is the 'SRC' and the bitmap-shader is the 'DST'.
|
// The linear-gradient is the 'SRC' and the bitmap-shader is the 'DST'.
|
||||||
// Drawing the DST in the SRC will provide the opacity.
|
// Drawing the DST in the SRC will provide the opacity.
|
||||||
mPaint.setShader(new ComposeShader(bitmapShader, gradient, PorterDuff.Mode.DST_IN));
|
mPaint.setShader(new ComposeShader(bitmapShader, gradient, PorterDuff.Mode.DST_IN));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,6 +201,7 @@ preprocessed := $(addsuffix .in,$(subst generated/org/mozilla/gecko/,,$(filter g
|
|||||||
|
|
||||||
preprocessed_PATH := generated/org/mozilla/gecko
|
preprocessed_PATH := generated/org/mozilla/gecko
|
||||||
preprocessed_KEEP_PATH := 1
|
preprocessed_KEEP_PATH := 1
|
||||||
|
preprocessed_FLAGS := --marker='//\\\#'
|
||||||
|
|
||||||
PP_TARGETS += preprocessed
|
PP_TARGETS += preprocessed
|
||||||
|
|
||||||
@ -214,6 +215,7 @@ preprocessed_package := $(addsuffix .in,$(subst $(android_package_dir)/,,$(filte
|
|||||||
|
|
||||||
preprocessed_package_PATH := $(android_package_dir)
|
preprocessed_package_PATH := $(android_package_dir)
|
||||||
preprocessed_package_KEEP_PATH := 1
|
preprocessed_package_KEEP_PATH := 1
|
||||||
|
preprocessed_package_FLAGS := --marker='//\\\#'
|
||||||
|
|
||||||
PP_TARGETS += preprocessed_package
|
PP_TARGETS += preprocessed_package
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class MemoryMonitor extends BroadcastReceiver {
|
|||||||
private static final int MEMORY_PRESSURE_MEDIUM = 3;
|
private static final int MEMORY_PRESSURE_MEDIUM = 3;
|
||||||
private static final int MEMORY_PRESSURE_HIGH = 4;
|
private static final int MEMORY_PRESSURE_HIGH = 4;
|
||||||
|
|
||||||
private static MemoryMonitor sInstance = new MemoryMonitor();
|
private static final MemoryMonitor sInstance = new MemoryMonitor();
|
||||||
|
|
||||||
static MemoryMonitor getInstance() {
|
static MemoryMonitor getInstance() {
|
||||||
return sInstance;
|
return sInstance;
|
||||||
|
@ -64,7 +64,7 @@ public final class NotificationHelper implements GeckoEventListener {
|
|||||||
private static final String CLEARED_EVENT = "notification-cleared";
|
private static final String CLEARED_EVENT = "notification-cleared";
|
||||||
private static final String CLOSED_EVENT = "notification-closed";
|
private static final String CLOSED_EVENT = "notification-closed";
|
||||||
|
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
// Holds a list of notifications that should be cleared if the Fennec Activity is shut down.
|
// Holds a list of notifications that should be cleared if the Fennec Activity is shut down.
|
||||||
// Will not include ongoing or persistent notifications that are tied to Gecko's lifecycle.
|
// Will not include ongoing or persistent notifications that are tied to Gecko's lifecycle.
|
||||||
|
@ -26,7 +26,7 @@ public class ScrollAnimator implements View.OnGenericMotionListener {
|
|||||||
static final float MAX_SCROLL = 0.075f * GeckoAppShell.getDpi();
|
static final float MAX_SCROLL = 0.075f * GeckoAppShell.getDpi();
|
||||||
|
|
||||||
private class ScrollRunnable extends TimerTask {
|
private class ScrollRunnable extends TimerTask {
|
||||||
private View mView;
|
private final View mView;
|
||||||
|
|
||||||
public ScrollRunnable(View view) {
|
public ScrollRunnable(View view) {
|
||||||
mView = view;
|
mView = view;
|
||||||
|
@ -46,7 +46,7 @@ public class SuggestClient {
|
|||||||
private final int mMaxResults;
|
private final int mMaxResults;
|
||||||
|
|
||||||
// used by robocop for testing
|
// used by robocop for testing
|
||||||
private boolean mCheckNetwork;
|
private final boolean mCheckNetwork;
|
||||||
|
|
||||||
// used to make suggestions appear instantly after opt-in
|
// used to make suggestions appear instantly after opt-in
|
||||||
private String mPrevQuery;
|
private String mPrevQuery;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#filter substitution
|
//#filter substitution
|
||||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
/* -*- 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
|
* 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
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
@ -45,27 +45,27 @@ public class Tab {
|
|||||||
private int mFaviconSize;
|
private int mFaviconSize;
|
||||||
private boolean mHasFeeds;
|
private boolean mHasFeeds;
|
||||||
private boolean mHasOpenSearch;
|
private boolean mHasOpenSearch;
|
||||||
private SiteIdentity mSiteIdentity;
|
private final SiteIdentity mSiteIdentity;
|
||||||
private boolean mReaderEnabled;
|
private boolean mReaderEnabled;
|
||||||
private BitmapDrawable mThumbnail;
|
private BitmapDrawable mThumbnail;
|
||||||
private int mHistoryIndex;
|
private int mHistoryIndex;
|
||||||
private int mHistorySize;
|
private int mHistorySize;
|
||||||
private int mParentId;
|
private final int mParentId;
|
||||||
private boolean mExternal;
|
private final boolean mExternal;
|
||||||
private boolean mBookmark;
|
private boolean mBookmark;
|
||||||
private int mFaviconLoadId;
|
private int mFaviconLoadId;
|
||||||
private String mContentType;
|
private String mContentType;
|
||||||
private boolean mHasTouchListeners;
|
private boolean mHasTouchListeners;
|
||||||
private ZoomConstraints mZoomConstraints;
|
private ZoomConstraints mZoomConstraints;
|
||||||
private boolean mIsRTL;
|
private boolean mIsRTL;
|
||||||
private ArrayList<View> mPluginViews;
|
private final ArrayList<View> mPluginViews;
|
||||||
private HashMap<Object, Layer> mPluginLayers;
|
private final HashMap<Object, Layer> mPluginLayers;
|
||||||
private int mBackgroundColor;
|
private int mBackgroundColor;
|
||||||
private int mState;
|
private int mState;
|
||||||
private Bitmap mThumbnailBitmap;
|
private Bitmap mThumbnailBitmap;
|
||||||
private boolean mDesktopMode;
|
private boolean mDesktopMode;
|
||||||
private boolean mEnteringReaderMode;
|
private boolean mEnteringReaderMode;
|
||||||
private Context mAppContext;
|
private final Context mAppContext;
|
||||||
private ErrorType mErrorType = ErrorType.NONE;
|
private ErrorType mErrorType = ErrorType.NONE;
|
||||||
private static final int MAX_HISTORY_LIST_SIZE = 50;
|
private static final int MAX_HISTORY_LIST_SIZE = 50;
|
||||||
private volatile int mLoadProgress;
|
private volatile int mLoadProgress;
|
||||||
|
@ -65,7 +65,7 @@ public class Tabs implements GeckoEventListener {
|
|||||||
|
|
||||||
public static final int INVALID_TAB_ID = -1;
|
public static final int INVALID_TAB_ID = -1;
|
||||||
|
|
||||||
private static AtomicInteger sTabId = new AtomicInteger(0);
|
private static final AtomicInteger sTabId = new AtomicInteger(0);
|
||||||
private volatile boolean mInitialTabsAdded;
|
private volatile boolean mInitialTabsAdded;
|
||||||
|
|
||||||
private Context mAppContext;
|
private Context mAppContext;
|
||||||
|
@ -54,7 +54,7 @@ class TextSelection extends Layer implements GeckoEventListener {
|
|||||||
|
|
||||||
// These timers are used to avoid flicker caused by selection handles showing/hiding quickly. For isntance
|
// These timers are used to avoid flicker caused by selection handles showing/hiding quickly. For isntance
|
||||||
// when moving between single handle caret mode and two handle selection mode.
|
// when moving between single handle caret mode and two handle selection mode.
|
||||||
private Timer mActionModeTimer = new Timer("actionMode");
|
private final Timer mActionModeTimer = new Timer("actionMode");
|
||||||
private class ActionModeTimerTask extends TimerTask {
|
private class ActionModeTimerTask extends TimerTask {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -189,11 +189,11 @@ class TextSelection extends Layer implements GeckoEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showActionMode(final JSONArray items) {
|
private void showActionMode(final JSONArray items) {
|
||||||
String itemsString = items.toString();
|
String itemsString = items.toString();
|
||||||
if (itemsString.equals(mCurrentItems)) {
|
if (itemsString.equals(mCurrentItems)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mCurrentItems = itemsString;
|
mCurrentItems = itemsString;
|
||||||
|
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
mCallback.updateItems(items);
|
mCallback.updateItems(items);
|
||||||
@ -214,7 +214,7 @@ class TextSelection extends Layer implements GeckoEventListener {
|
|||||||
final ActionModeCompat.Presenter presenter = (ActionModeCompat.Presenter) context;
|
final ActionModeCompat.Presenter presenter = (ActionModeCompat.Presenter) context;
|
||||||
presenter.endActionModeCompat();
|
presenter.endActionModeCompat();
|
||||||
}
|
}
|
||||||
mCurrentItems = null;
|
mCurrentItems = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -132,7 +132,7 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener {
|
|||||||
// will tell us the position of the caret, so we set the handle
|
// will tell us the position of the caret, so we set the handle
|
||||||
// position then. This allows us to lock the handle to wherever the
|
// position then. This allows us to lock the handle to wherever the
|
||||||
// caret appears.
|
// caret appears.
|
||||||
if (!mHandleType.equals(HandleType.MIDDLE)) {
|
if (mHandleType != HandleType.MIDDLE) {
|
||||||
setLayoutPosition();
|
setLayoutPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,12 +166,13 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private float adjustLeftForHandle() {
|
private float adjustLeftForHandle() {
|
||||||
if (mHandleType.equals(HandleType.START))
|
if (mHandleType == HandleType.START) {
|
||||||
return mIsRTL ? mShadow : mWidth - mShadow;
|
return mIsRTL ? mShadow : mWidth - mShadow;
|
||||||
else if (mHandleType.equals(HandleType.MIDDLE))
|
} else if (mHandleType == HandleType.MIDDLE) {
|
||||||
return mWidth / 2;
|
return mWidth / 2;
|
||||||
else
|
} else {
|
||||||
return mIsRTL ? mWidth - mShadow : mShadow;
|
return mIsRTL ? mWidth - mShadow : mShadow;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setLayoutPosition() {
|
private void setLayoutPosition() {
|
||||||
|
@ -35,7 +35,7 @@ class AnimatorProxy {
|
|||||||
public View getView();
|
public View getView();
|
||||||
}
|
}
|
||||||
|
|
||||||
private AnimatorProxyImpl mImpl;
|
private final AnimatorProxyImpl mImpl;
|
||||||
|
|
||||||
private AnimatorProxy(AnimatorProxyImpl impl) {
|
private AnimatorProxy(AnimatorProxyImpl impl) {
|
||||||
mImpl = impl;
|
mImpl = impl;
|
||||||
@ -146,7 +146,7 @@ class AnimatorProxy {
|
|||||||
* the NineOldAndroids library under the Apache License 2.0.
|
* the NineOldAndroids library under the Apache License 2.0.
|
||||||
*/
|
*/
|
||||||
private static class AnimatorProxyPreHC extends Animation implements AnimatorProxyImpl {
|
private static class AnimatorProxyPreHC extends Animation implements AnimatorProxyImpl {
|
||||||
private WeakReference<View> mViewRef;
|
private final WeakReference<View> mViewRef;
|
||||||
|
|
||||||
private final RectF mBefore;
|
private final RectF mBefore;
|
||||||
private final RectF mAfter;
|
private final RectF mAfter;
|
||||||
@ -291,7 +291,7 @@ class AnimatorProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class AnimatorProxyPostHC implements AnimatorProxyImpl {
|
private static class AnimatorProxyPostHC implements AnimatorProxyImpl {
|
||||||
private WeakReference<View> mViewRef;
|
private final WeakReference<View> mViewRef;
|
||||||
|
|
||||||
public AnimatorProxyPostHC(View view) {
|
public AnimatorProxyPostHC(View view) {
|
||||||
mViewRef = new WeakReference<View>(view);
|
mViewRef = new WeakReference<View>(view);
|
||||||
|
@ -32,7 +32,7 @@ public class BounceAnimator extends ValueAnimator {
|
|||||||
|
|
||||||
private final View mView;
|
private final View mView;
|
||||||
private final String mPropertyName;
|
private final String mPropertyName;
|
||||||
private List<Animator> animatorChain = new LinkedList<Animator>();
|
private final List<Animator> animatorChain = new LinkedList<Animator>();
|
||||||
|
|
||||||
public BounceAnimator(View view, String property) {
|
public BounceAnimator(View view, String property) {
|
||||||
mView = view;
|
mView = view;
|
||||||
|
@ -46,11 +46,11 @@ public class PropertyAnimator implements Runnable {
|
|||||||
public void onPropertyAnimationEnd();
|
public void onPropertyAnimationEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Interpolator mInterpolator;
|
private final Interpolator mInterpolator;
|
||||||
private long mStartTime;
|
private long mStartTime;
|
||||||
private long mDuration;
|
private final long mDuration;
|
||||||
private float mDurationReciprocal;
|
private final float mDurationReciprocal;
|
||||||
private List<ElementHolder> mElementsList;
|
private final List<ElementHolder> mElementsList;
|
||||||
private List<PropertyAnimationListener> mListeners;
|
private List<PropertyAnimationListener> mListeners;
|
||||||
FramePoster mFramePoster;
|
FramePoster mFramePoster;
|
||||||
private boolean mUseHardwareLayer;
|
private boolean mUseHardwareLayer;
|
||||||
@ -61,7 +61,7 @@ public class PropertyAnimator implements Runnable {
|
|||||||
|
|
||||||
public PropertyAnimator(long duration, Interpolator interpolator) {
|
public PropertyAnimator(long duration, Interpolator interpolator) {
|
||||||
mDuration = duration;
|
mDuration = duration;
|
||||||
mDurationReciprocal = 1.0f / (float) mDuration;
|
mDurationReciprocal = 1.0f / mDuration;
|
||||||
mInterpolator = interpolator;
|
mInterpolator = interpolator;
|
||||||
mElementsList = new ArrayList<ElementHolder>();
|
mElementsList = new ArrayList<ElementHolder>();
|
||||||
mFramePoster = FramePoster.create(this);
|
mFramePoster = FramePoster.create(this);
|
||||||
|
@ -7,56 +7,56 @@ package org.mozilla.gecko.animation;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
public final class ViewHelper {
|
public final class ViewHelper {
|
||||||
private ViewHelper() {
|
private ViewHelper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getTranslationX(View view) {
|
public static float getTranslationX(View view) {
|
||||||
AnimatorProxy proxy = AnimatorProxy.create(view);
|
AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
return proxy.getTranslationX();
|
return proxy.getTranslationX();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTranslationX(View view, float translationX) {
|
public static void setTranslationX(View view, float translationX) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
proxy.setTranslationX(translationX);
|
proxy.setTranslationX(translationX);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getTranslationY(View view) {
|
public static float getTranslationY(View view) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
return proxy.getTranslationY();
|
return proxy.getTranslationY();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTranslationY(View view, float translationY) {
|
public static void setTranslationY(View view, float translationY) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
proxy.setTranslationY(translationY);
|
proxy.setTranslationY(translationY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getAlpha(View view) {
|
public static float getAlpha(View view) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
return proxy.getAlpha();
|
return proxy.getAlpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setAlpha(View view, float alpha) {
|
public static void setAlpha(View view, float alpha) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
proxy.setAlpha(alpha);
|
proxy.setAlpha(alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getWidth(View view) {
|
public static int getWidth(View view) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
return proxy.getWidth();
|
return proxy.getWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setWidth(View view, int width) {
|
public static void setWidth(View view, int width) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
proxy.setWidth(width);
|
proxy.setWidth(width);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getHeight(View view) {
|
public static int getHeight(View view) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
return proxy.getHeight();
|
return proxy.getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setHeight(View view, int height) {
|
public static void setHeight(View view, int height) {
|
||||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||||
proxy.setHeight(height);
|
proxy.setHeight(height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#filter substitution
|
//#filter substitution
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
/* 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
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
@ -16,11 +16,11 @@ public class GlobalConstants {
|
|||||||
// If this is an official build, 'default' means 'release'.
|
// If this is an official build, 'default' means 'release'.
|
||||||
// Otherwise, it means 'dev'.
|
// Otherwise, it means 'dev'.
|
||||||
public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@";
|
public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@";
|
||||||
#ifdef MOZ_OFFICIAL_BRANDING
|
//#ifdef MOZ_OFFICIAL_BRANDING
|
||||||
public static final boolean MOZ_OFFICIAL_BRANDING = true;
|
public static final boolean MOZ_OFFICIAL_BRANDING = true;
|
||||||
#else
|
//#else
|
||||||
public static final boolean MOZ_OFFICIAL_BRANDING = false;
|
public static final boolean MOZ_OFFICIAL_BRANDING = false;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static final long BUILD_TIMESTAMP_SECONDS = @MOZ_BUILD_TIMESTAMP@L;
|
public static final long BUILD_TIMESTAMP_SECONDS = @MOZ_BUILD_TIMESTAMP@L;
|
||||||
public static final long BUILD_TIMESTAMP_MSEC = 1000L * @MOZ_BUILD_TIMESTAMP@L;
|
public static final long BUILD_TIMESTAMP_MSEC = 1000L * @MOZ_BUILD_TIMESTAMP@L;
|
||||||
|
@ -50,7 +50,7 @@ public class TelemetryRecorder {
|
|||||||
|
|
||||||
private File tmpFile;
|
private File tmpFile;
|
||||||
private File destFile;
|
private File destFile;
|
||||||
private File cacheDir;
|
private final File cacheDir;
|
||||||
|
|
||||||
private OutputStream outputStream;
|
private OutputStream outputStream;
|
||||||
private MessageDigest checksum;
|
private MessageDigest checksum;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#filter substitution
|
//#filter substitution
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
/* 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
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
@ -909,7 +909,7 @@ public class HealthReportDatabaseStorage implements HealthReportStorage {
|
|||||||
* Cache the lookup from measurement and field specifier to field instance.
|
* Cache the lookup from measurement and field specifier to field instance.
|
||||||
* This allows us to memoize the field ID lookup, too.
|
* This allows us to memoize the field ID lookup, too.
|
||||||
*/
|
*/
|
||||||
private HashMap<String, Field> fields = new HashMap<String, Field>();
|
private final HashMap<String, Field> fields = new HashMap<String, Field>();
|
||||||
private boolean fieldsCacheUpdated = false;
|
private boolean fieldsCacheUpdated = false;
|
||||||
|
|
||||||
private void invalidateFieldsCache() {
|
private void invalidateFieldsCache() {
|
||||||
|
@ -17,7 +17,7 @@ import android.content.Context;
|
|||||||
public class HealthReportDatabases {
|
public class HealthReportDatabases {
|
||||||
private static final String LOG_TAG = "HealthReportDatabases";
|
private static final String LOG_TAG = "HealthReportDatabases";
|
||||||
|
|
||||||
private Context context;
|
private final Context context;
|
||||||
private final HashMap<File, HealthReportDatabaseStorage> storages = new HashMap<File, HealthReportDatabaseStorage>();
|
private final HashMap<File, HealthReportDatabaseStorage> storages = new HashMap<File, HealthReportDatabaseStorage>();
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ public abstract class PreferenceFragment extends Fragment implements PreferenceM
|
|||||||
// The issue is that the Handler references the Fragment; messages targeting
|
// The issue is that the Handler references the Fragment; messages targeting
|
||||||
// the Handler reference it; and if such messages are long lived, the Fragment
|
// the Handler reference it; and if such messages are long lived, the Fragment
|
||||||
// cannot be GCed. This is not an issue for us; our messages are short-lived.
|
// cannot be GCed. This is not an issue for us; our messages are short-lived.
|
||||||
private Handler mHandler = new Handler() {
|
private final Handler mHandler = new Handler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
@ -299,7 +299,7 @@ public abstract class PreferenceFragment extends Fragment implements PreferenceM
|
|||||||
mHandler.post(mRequestFocus);
|
mHandler.post(mRequestFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
private OnKeyListener mListOnKeyListener = new OnKeyListener() {
|
private final OnKeyListener mListOnKeyListener = new OnKeyListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||||
|
@ -32,7 +32,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
public class PreferenceManagerCompat {
|
public class PreferenceManagerCompat {
|
||||||
|
|
||||||
private static final String TAG = PreferenceManagerCompat.class.getSimpleName();
|
private static final String TAG = PreferenceManagerCompat.class.getSimpleName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface definition for a callback to be invoked when a
|
* Interface definition for a callback to be invoked when a
|
||||||
@ -52,22 +52,22 @@ public class PreferenceManagerCompat {
|
|||||||
boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference);
|
boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
|
static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
|
||||||
try {
|
try {
|
||||||
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
|
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
|
||||||
c.setAccessible(true);
|
c.setAccessible(true);
|
||||||
return c.newInstance(activity, firstRequestCode);
|
return c.newInstance(activity, firstRequestCode);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
|
Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the owning preference fragment
|
* Sets the owning preference fragment
|
||||||
*/
|
*/
|
||||||
static void setFragment(PreferenceManager manager, PreferenceFragment fragment) {
|
static void setFragment(PreferenceManager manager, PreferenceFragment fragment) {
|
||||||
// stub
|
// stub
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,34 +76,34 @@ public class PreferenceManagerCompat {
|
|||||||
*
|
*
|
||||||
* @param listener The callback to be invoked.
|
* @param listener The callback to be invoked.
|
||||||
*/
|
*/
|
||||||
static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
|
static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
|
||||||
try {
|
try {
|
||||||
Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
|
Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
|
||||||
onPreferenceTreeClickListener.setAccessible(true);
|
onPreferenceTreeClickListener.setAccessible(true);
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
Object proxy = Proxy.newProxyInstance(
|
Object proxy = Proxy.newProxyInstance(
|
||||||
onPreferenceTreeClickListener.getType().getClassLoader(),
|
onPreferenceTreeClickListener.getType().getClassLoader(),
|
||||||
new Class<?>[] { onPreferenceTreeClickListener.getType() },
|
new Class<?>[] { onPreferenceTreeClickListener.getType() },
|
||||||
new InvocationHandler() {
|
new InvocationHandler() {
|
||||||
@Override
|
@Override
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) {
|
public Object invoke(Object proxy, Method method, Object[] args) {
|
||||||
if (method.getName().equals("onPreferenceTreeClick")) {
|
if (method.getName().equals("onPreferenceTreeClick")) {
|
||||||
return Boolean.valueOf(listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]));
|
return Boolean.valueOf(listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
onPreferenceTreeClickListener.set(manager, proxy);
|
onPreferenceTreeClickListener.set(manager, proxy);
|
||||||
} else {
|
} else {
|
||||||
onPreferenceTreeClickListener.set(manager, null);
|
onPreferenceTreeClickListener.set(manager, null);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
|
Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inflates a preference hierarchy from the preference hierarchies of
|
* Inflates a preference hierarchy from the preference hierarchies of
|
||||||
* {@link Activity Activities} that match the given {@link Intent}. An
|
* {@link Activity Activities} that match the given {@link Intent}. An
|
||||||
* {@link Activity} defines its preference hierarchy with meta-data using
|
* {@link Activity} defines its preference hierarchy with meta-data using
|
||||||
@ -118,19 +118,19 @@ public class PreferenceManagerCompat {
|
|||||||
* @return The root hierarchy (if one was not provided, the new hierarchy's
|
* @return The root hierarchy (if one was not provided, the new hierarchy's
|
||||||
* root).
|
* root).
|
||||||
*/
|
*/
|
||||||
static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
|
static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
|
||||||
try {
|
try {
|
||||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
|
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, intent, screen);
|
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, intent, screen);
|
||||||
return prefScreen;
|
return prefScreen;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
|
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inflates a preference hierarchy from XML. If a preference hierarchy is
|
* Inflates a preference hierarchy from XML. If a preference hierarchy is
|
||||||
* given, the new preference hierarchies will be merged in.
|
* given, the new preference hierarchies will be merged in.
|
||||||
*
|
*
|
||||||
@ -142,90 +142,90 @@ public class PreferenceManagerCompat {
|
|||||||
* root).
|
* root).
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
|
static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
|
||||||
try {
|
try {
|
||||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
|
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, activity, resId, screen);
|
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, activity, resId, screen);
|
||||||
return prefScreen;
|
return prefScreen;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
|
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the root of the preference hierarchy managed by this class.
|
* Returns the root of the preference hierarchy managed by this class.
|
||||||
*
|
*
|
||||||
* @return The {@link PreferenceScreen} object that is at the root of the hierarchy.
|
* @return The {@link PreferenceScreen} object that is at the root of the hierarchy.
|
||||||
*/
|
*/
|
||||||
static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
|
static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
|
||||||
try {
|
try {
|
||||||
Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen");
|
Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen");
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
return (PreferenceScreen) m.invoke(manager);
|
return (PreferenceScreen) m.invoke(manager);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
|
Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the {@link PreferenceManager} to dispatch a subactivity result.
|
* Called by the {@link PreferenceManager} to dispatch a subactivity result.
|
||||||
*/
|
*/
|
||||||
static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
|
static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
|
||||||
try {
|
try {
|
||||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityResult", int.class, int.class, Intent.class);
|
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityResult", int.class, int.class, Intent.class);
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
m.invoke(manager, requestCode, resultCode, data);
|
m.invoke(manager, requestCode, resultCode, data);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityResult by reflection", e);
|
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityResult by reflection", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the {@link PreferenceManager} to dispatch the activity stop
|
* Called by the {@link PreferenceManager} to dispatch the activity stop
|
||||||
* event.
|
* event.
|
||||||
*/
|
*/
|
||||||
static void dispatchActivityStop(PreferenceManager manager) {
|
static void dispatchActivityStop(PreferenceManager manager) {
|
||||||
try {
|
try {
|
||||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop");
|
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop");
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
m.invoke(manager);
|
m.invoke(manager);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityStop by reflection", e);
|
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityStop by reflection", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the {@link PreferenceManager} to dispatch the activity destroy
|
* Called by the {@link PreferenceManager} to dispatch the activity destroy
|
||||||
* event.
|
* event.
|
||||||
*/
|
*/
|
||||||
static void dispatchActivityDestroy(PreferenceManager manager) {
|
static void dispatchActivityDestroy(PreferenceManager manager) {
|
||||||
try {
|
try {
|
||||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
|
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
m.invoke(manager);
|
m.invoke(manager);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
|
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the root of the preference hierarchy.
|
* Sets the root of the preference hierarchy.
|
||||||
*
|
*
|
||||||
* @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
|
* @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
|
||||||
* @return Whether the {@link PreferenceScreen} given is different than the previous.
|
* @return Whether the {@link PreferenceScreen} given is different than the previous.
|
||||||
*/
|
*/
|
||||||
static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
|
static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
|
||||||
try {
|
try {
|
||||||
Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
|
Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
|
||||||
m.setAccessible(true);
|
m.setAccessible(true);
|
||||||
return ((Boolean) m.invoke(manager, screen));
|
return ((Boolean) m.invoke(manager, screen));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
|
Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,8 @@ import android.util.Log;
|
|||||||
public abstract class AbstractTransactionalProvider extends ContentProvider {
|
public abstract class AbstractTransactionalProvider extends ContentProvider {
|
||||||
private static final String LOGTAG = "GeckoTransProvider";
|
private static final String LOGTAG = "GeckoTransProvider";
|
||||||
|
|
||||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||||
|
|
||||||
protected abstract SQLiteDatabase getReadableDatabase(Uri uri);
|
protected abstract SQLiteDatabase getReadableDatabase(Uri uri);
|
||||||
protected abstract SQLiteDatabase getWritableDatabase(Uri uri);
|
protected abstract SQLiteDatabase getWritableDatabase(Uri uri);
|
||||||
@ -103,7 +103,8 @@ public abstract class AbstractTransactionalProvider extends ContentProvider {
|
|||||||
if (isInBatch == null) {
|
if (isInBatch == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isInBatch.booleanValue();
|
|
||||||
|
return isInBatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1565,8 +1565,8 @@ final class BrowserDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
// Calculate these once, at initialization. isLoggable is too expensive to
|
// Calculate these once, at initialization. isLoggable is too expensive to
|
||||||
// have in-line in each log call.
|
// have in-line in each log call.
|
||||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||||
protected static void trace(String message) {
|
protected static void trace(String message) {
|
||||||
if (logVerbose) {
|
if (logVerbose) {
|
||||||
Log.v(LOGTAG, message);
|
Log.v(LOGTAG, message);
|
||||||
|
@ -247,8 +247,8 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
|
|||||||
|
|
||||||
// Calculate these once, at initialization. isLoggable is too expensive to
|
// Calculate these once, at initialization. isLoggable is too expensive to
|
||||||
// have in-line in each log call.
|
// have in-line in each log call.
|
||||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||||
protected static void trace(String message) {
|
protected static void trace(String message) {
|
||||||
if (logVerbose) {
|
if (logVerbose) {
|
||||||
Log.v(LOGTAG, message);
|
Log.v(LOGTAG, message);
|
||||||
@ -1065,7 +1065,7 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
|
|||||||
Long additional = values.getAsLong(History.VISITS);
|
Long additional = values.getAsLong(History.VISITS);
|
||||||
|
|
||||||
// Increment visit count by a specified amount, or default to increment by 1
|
// Increment visit count by a specified amount, or default to increment by 1
|
||||||
values.put(History.VISITS, existing + ((additional != null) ? additional.longValue() : 1));
|
values.put(History.VISITS, existing + ((additional != null) ? additional : 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
updated += db.update(TABLE_HISTORY, values, "_id = ?",
|
updated += db.update(TABLE_HISTORY, values, "_id = ?",
|
||||||
|
@ -32,8 +32,8 @@ public class FormHistoryProvider extends SQLiteBridgeContentProvider {
|
|||||||
|
|
||||||
|
|
||||||
// This should be kept in sync with the db version in toolkit/components/satchel/nsFormHistory.js
|
// This should be kept in sync with the db version in toolkit/components/satchel/nsFormHistory.js
|
||||||
private static int DB_VERSION = 4;
|
private static final int DB_VERSION = 4;
|
||||||
private static String DB_FILENAME = "formhistory.sqlite";
|
private static final String DB_FILENAME = "formhistory.sqlite";
|
||||||
private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_FORMS";
|
private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_FORMS";
|
||||||
|
|
||||||
private static final String WHERE_GUID_IS_NULL = BrowserContract.DeletedFormHistory.GUID + " IS NULL";
|
private static final String WHERE_GUID_IS_NULL = BrowserContract.DeletedFormHistory.GUID + " IS NULL";
|
||||||
|
@ -27,8 +27,8 @@ public class HomeProvider extends SQLiteBridgeContentProvider {
|
|||||||
private static final String LOGTAG = "GeckoHomeProvider";
|
private static final String LOGTAG = "GeckoHomeProvider";
|
||||||
|
|
||||||
// This should be kept in sync with the db version in mobile/android/modules/HomeProvider.jsm
|
// This should be kept in sync with the db version in mobile/android/modules/HomeProvider.jsm
|
||||||
private static int DB_VERSION = 2;
|
private static final int DB_VERSION = 2;
|
||||||
private static String DB_FILENAME = "home.sqlite";
|
private static final String DB_FILENAME = "home.sqlite";
|
||||||
private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_HOME";
|
private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_HOME";
|
||||||
|
|
||||||
private static final String TABLE_ITEMS = "items";
|
private static final String TABLE_ITEMS = "items";
|
||||||
|
@ -1078,7 +1078,7 @@ public class LocalBrowserDB {
|
|||||||
|
|
||||||
// After writing the encodedFavicon, ensure that the favicon_id in both the bookmark and
|
// After writing the encodedFavicon, ensure that the favicon_id in both the bookmark and
|
||||||
// history tables are also up-to-date.
|
// history tables are also up-to-date.
|
||||||
final Integer id = getIDForFaviconURL(cr, faviconUri);
|
final int id = getIDForFaviconURL(cr, faviconUri);
|
||||||
if (id == FAVICON_ID_NOT_FOUND) {
|
if (id == FAVICON_ID_NOT_FOUND) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ public class PasswordsProvider extends SQLiteBridgeContentProvider {
|
|||||||
|
|
||||||
private static final UriMatcher URI_MATCHER;
|
private static final UriMatcher URI_MATCHER;
|
||||||
|
|
||||||
private static HashMap<String, String> PASSWORDS_PROJECTION_MAP;
|
private static final HashMap<String, String> PASSWORDS_PROJECTION_MAP;
|
||||||
private static HashMap<String, String> DELETED_PASSWORDS_PROJECTION_MAP;
|
private static final HashMap<String, String> DELETED_PASSWORDS_PROJECTION_MAP;
|
||||||
|
|
||||||
// this should be kept in sync with the version in toolkit/components/passwordmgr/storage-mozStorage.js
|
// this should be kept in sync with the version in toolkit/components/passwordmgr/storage-mozStorage.js
|
||||||
private static final int DB_VERSION = 5;
|
private static final int DB_VERSION = 5;
|
||||||
@ -176,7 +176,7 @@ public class PasswordsProvider extends SQLiteBridgeContentProvider {
|
|||||||
String guid = Utils.generateGuid();
|
String guid = Utils.generateGuid();
|
||||||
values.put(Passwords.GUID, guid);
|
values.put(Passwords.GUID, guid);
|
||||||
}
|
}
|
||||||
String nowString = new Long(now).toString();
|
String nowString = Long.toString(now);
|
||||||
DBUtils.replaceKey(values, null, Passwords.HOSTNAME, "");
|
DBUtils.replaceKey(values, null, Passwords.HOSTNAME, "");
|
||||||
DBUtils.replaceKey(values, null, Passwords.HTTP_REALM, "");
|
DBUtils.replaceKey(values, null, Passwords.HTTP_REALM, "");
|
||||||
DBUtils.replaceKey(values, null, Passwords.FORM_SUBMIT_URL, "");
|
DBUtils.replaceKey(values, null, Passwords.FORM_SUBMIT_URL, "");
|
||||||
|
@ -293,10 +293,10 @@ public class ICODecoder implements Iterable<Bitmap> {
|
|||||||
System.arraycopy(decodand, offset + iconDirEntry.payloadOffset, decodeTarget, singlePayloadOffset, iconDirEntry.payloadSize);
|
System.arraycopy(decodand, offset + iconDirEntry.payloadOffset, decodeTarget, singlePayloadOffset, iconDirEntry.payloadSize);
|
||||||
|
|
||||||
// Update the offset field of the ICONDIRENTRY to make the new ICO valid.
|
// Update the offset field of the ICONDIRENTRY to make the new ICO valid.
|
||||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 12] = (byte) singlePayloadOffset;
|
decodeTarget[ICO_HEADER_LENGTH_BYTES + 12] = singlePayloadOffset;
|
||||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 13] = (byte) (singlePayloadOffset >>> 8);
|
decodeTarget[ICO_HEADER_LENGTH_BYTES + 13] = (singlePayloadOffset >>> 8);
|
||||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 14] = (byte) (singlePayloadOffset >>> 16);
|
decodeTarget[ICO_HEADER_LENGTH_BYTES + 14] = (singlePayloadOffset >>> 16);
|
||||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 15] = (byte) (singlePayloadOffset >>> 24);
|
decodeTarget[ICO_HEADER_LENGTH_BYTES + 15] = (singlePayloadOffset >>> 24);
|
||||||
|
|
||||||
// Decode the newly-constructed singleton-ICO.
|
// Decode the newly-constructed singleton-ICO.
|
||||||
return BitmapUtils.decodeByteArray(decodeTarget);
|
return BitmapUtils.decodeByteArray(decodeTarget);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#filter substitution
|
//#filter substitution
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
/* 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
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
@ -74,7 +74,7 @@ abstract public class FxAccountAbstractSetupActivity extends FxAccountAbstractAc
|
|||||||
|
|
||||||
// By default, any custom server configuration is only shown when the account
|
// By default, any custom server configuration is only shown when the account
|
||||||
// is configured to use a custom server.
|
// is configured to use a custom server.
|
||||||
private static boolean ALWAYS_SHOW_CUSTOM_SERVER_LAYOUT = false;
|
private static final boolean ALWAYS_SHOW_CUSTOM_SERVER_LAYOUT = false;
|
||||||
|
|
||||||
protected int minimumPasswordLength = 8;
|
protected int minimumPasswordLength = 8;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
package org.mozilla.gecko.fxa.login;
|
package org.mozilla.gecko.fxa.login;
|
||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.HashSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.mozilla.gecko.background.fxa.FxAccountClient;
|
import org.mozilla.gecko.background.fxa.FxAccountClient;
|
||||||
@ -29,7 +29,7 @@ public class FxAccountLoginStateMachine {
|
|||||||
protected final LoginStateMachineDelegate delegate;
|
protected final LoginStateMachineDelegate delegate;
|
||||||
protected final StateLabel desiredStateLabel;
|
protected final StateLabel desiredStateLabel;
|
||||||
// It's as difficult to detect arbitrary cycles as repeated states.
|
// It's as difficult to detect arbitrary cycles as repeated states.
|
||||||
protected final Set<StateLabel> stateLabelsSeen = new HashSet<StateLabel>();
|
protected final Set<StateLabel> stateLabelsSeen = EnumSet.noneOf(StateLabel.class);
|
||||||
|
|
||||||
protected ExecuteDelegate(StateLabel initialStateLabel, StateLabel desiredStateLabel, LoginStateMachineDelegate delegate) {
|
protected ExecuteDelegate(StateLabel initialStateLabel, StateLabel desiredStateLabel, LoginStateMachineDelegate delegate) {
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
|
@ -7,7 +7,9 @@ package org.mozilla.gecko.fxa.sync;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.json.simple.parser.ParseException;
|
import org.json.simple.parser.ParseException;
|
||||||
import org.mozilla.gecko.sync.GlobalSession;
|
import org.mozilla.gecko.sync.GlobalSession;
|
||||||
@ -34,7 +36,7 @@ public class FxAccountGlobalSession extends GlobalSession {
|
|||||||
@Override
|
@Override
|
||||||
public void prepareStages() {
|
public void prepareStages() {
|
||||||
super.prepareStages();
|
super.prepareStages();
|
||||||
HashMap<Stage, GlobalSyncStage> stages = new HashMap<Stage, GlobalSyncStage>();
|
Map<Stage, GlobalSyncStage> stages = new EnumMap<>(Stage.class);
|
||||||
stages.putAll(this.stages);
|
stages.putAll(this.stages);
|
||||||
stages.put(Stage.ensureClusterURL, new CheckPreconditionsStage());
|
stages.put(Stage.ensureClusterURL, new CheckPreconditionsStage());
|
||||||
this.stages = Collections.unmodifiableMap(stages);
|
this.stages = Collections.unmodifiableMap(stages);
|
||||||
|
@ -53,7 +53,7 @@ abstract class Axis {
|
|||||||
|
|
||||||
private static float getFloatPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
private static float getFloatPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
||||||
Integer value = (prefs == null ? null : prefs.get(prefName));
|
Integer value = (prefs == null ? null : prefs.get(prefName));
|
||||||
return (float)(value == null || value < 0 ? defaultValue : value) / 1000f;
|
return (value == null || value < 0 ? defaultValue : value) / 1000f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getIntPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
private static int getIntPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
||||||
@ -130,7 +130,7 @@ abstract class Axis {
|
|||||||
private float mTouchPos; /* Position of the most recent touch event on the current drag. */
|
private float mTouchPos; /* Position of the most recent touch event on the current drag. */
|
||||||
private float mLastTouchPos; /* Position of the touch event before touchPos. */
|
private float mLastTouchPos; /* Position of the touch event before touchPos. */
|
||||||
private float mVelocity; /* Velocity in this direction; pixels per animation frame. */
|
private float mVelocity; /* Velocity in this direction; pixels per animation frame. */
|
||||||
private float[] mRecentVelocities; /* Circular buffer of recent velocities since last touch start. */
|
private final float[] mRecentVelocities;/* Circular buffer of recent velocities since last touch start. */
|
||||||
private int mRecentVelocityCount; /* Number of values put into mRecentVelocities (unbounded). */
|
private int mRecentVelocityCount; /* Number of values put into mRecentVelocities (unbounded). */
|
||||||
private boolean mScrollingDisabled; /* Whether movement on this axis is locked. */
|
private boolean mScrollingDisabled; /* Whether movement on this axis is locked. */
|
||||||
private boolean mDisableSnap; /* Whether overscroll snapping is disabled. */
|
private boolean mDisableSnap; /* Whether overscroll snapping is disabled. */
|
||||||
|
@ -18,7 +18,7 @@ public class BufferedCairoImage extends CairoImage {
|
|||||||
private IntSize mSize;
|
private IntSize mSize;
|
||||||
private int mFormat;
|
private int mFormat;
|
||||||
|
|
||||||
private static String LOGTAG = "GeckoBufferedCairoImage";
|
private static final String LOGTAG = "GeckoBufferedCairoImage";
|
||||||
|
|
||||||
/** Creates a buffered Cairo image from a byte buffer. */
|
/** Creates a buffered Cairo image from a byte buffer. */
|
||||||
public BufferedCairoImage(ByteBuffer inBuffer, int inWidth, int inHeight, int inFormat) {
|
public BufferedCairoImage(ByteBuffer inBuffer, int inWidth, int inHeight, int inFormat) {
|
||||||
|
@ -75,7 +75,7 @@ final class DisplayPortCalculator {
|
|||||||
PREF_DISPLAYPORT_PB_VELOCITY_THRESHOLD };
|
PREF_DISPLAYPORT_PB_VELOCITY_THRESHOLD };
|
||||||
|
|
||||||
PrefsHelper.getPrefs(prefs, new PrefsHelper.PrefHandlerBase() {
|
PrefsHelper.getPrefs(prefs, new PrefsHelper.PrefHandlerBase() {
|
||||||
private Map<String, Integer> mValues = new HashMap<String, Integer>();
|
private final Map<String, Integer> mValues = new HashMap<String, Integer>();
|
||||||
|
|
||||||
@Override public void prefValue(String pref, int value) {
|
@Override public void prefValue(String pref, int value) {
|
||||||
mValues.put(pref, value);
|
mValues.put(pref, value);
|
||||||
@ -124,7 +124,7 @@ final class DisplayPortCalculator {
|
|||||||
|
|
||||||
private static float getFloatPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
private static float getFloatPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
||||||
Integer value = (prefs == null ? null : prefs.get(prefName));
|
Integer value = (prefs == null ? null : prefs.get(prefName));
|
||||||
return (float)(value == null || value < 0 ? defaultValue : value) / 1000f;
|
return (value == null || value < 0 ? defaultValue : value) / 1000f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static abstract class DisplayPortStrategy {
|
private static abstract class DisplayPortStrategy {
|
||||||
@ -746,7 +746,7 @@ final class DisplayPortCalculator {
|
|||||||
@Override
|
@Override
|
||||||
public boolean drawTimeUpdate(long millis, int pixels) {
|
public boolean drawTimeUpdate(long millis, int pixels) {
|
||||||
// calculate the number of frames it took to draw a viewport-sized area
|
// calculate the number of frames it took to draw a viewport-sized area
|
||||||
float normalizedTime = (float)mPixelArea * (float)millis / (float)pixels;
|
float normalizedTime = (float)mPixelArea * millis / pixels;
|
||||||
int normalizedFrames = (int)FloatMath.ceil(normalizedTime * 60f / 1000f);
|
int normalizedFrames = (int)FloatMath.ceil(normalizedTime * 60f / 1000f);
|
||||||
// broaden our range on how long it takes to draw if the draw falls outside
|
// broaden our range on how long it takes to draw if the draw falls outside
|
||||||
// the range. this allows it to grow gradually. this heuristic may need to
|
// the range. this allows it to grow gradually. this heuristic may need to
|
||||||
|
@ -88,7 +88,7 @@ public class GLController {
|
|||||||
private EGL10 mEGL;
|
private EGL10 mEGL;
|
||||||
private EGLDisplay mEGLDisplay;
|
private EGLDisplay mEGLDisplay;
|
||||||
private EGLConfig mEGLConfig;
|
private EGLConfig mEGLConfig;
|
||||||
private EGLPreloadingThread mEGLPreloadingThread;
|
private final EGLPreloadingThread mEGLPreloadingThread;
|
||||||
private EGLSurface mEGLSurfaceForCompositor;
|
private EGLSurface mEGLSurfaceForCompositor;
|
||||||
|
|
||||||
private static final int LOCAL_EGL_OPENGL_ES2_BIT = 4;
|
private static final int LOCAL_EGL_OPENGL_ES2_BIT = 4;
|
||||||
|
@ -33,7 +33,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
|
|||||||
private LayerRenderer mLayerRenderer;
|
private LayerRenderer mLayerRenderer;
|
||||||
private boolean mLayerRendererInitialized;
|
private boolean mLayerRendererInitialized;
|
||||||
|
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
private IntSize mScreenSize;
|
private IntSize mScreenSize;
|
||||||
private IntSize mWindowSize;
|
private IntSize mWindowSize;
|
||||||
private DisplayPortMetrics mDisplayPort;
|
private DisplayPortMetrics mDisplayPort;
|
||||||
@ -59,7 +59,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
|
|||||||
*/
|
*/
|
||||||
private ImmutableViewportMetrics mFrameMetrics;
|
private ImmutableViewportMetrics mFrameMetrics;
|
||||||
|
|
||||||
private List<DrawListener> mDrawListeners;
|
private final List<DrawListener> mDrawListeners;
|
||||||
|
|
||||||
/* Used as temporaries by syncViewportInfo */
|
/* Used as temporaries by syncViewportInfo */
|
||||||
private final ViewTransform mCurrentViewTransform;
|
private final ViewTransform mCurrentViewTransform;
|
||||||
@ -94,7 +94,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
|
|||||||
|
|
||||||
private final PanZoomController mPanZoomController;
|
private final PanZoomController mPanZoomController;
|
||||||
private final LayerMarginsAnimator mMarginsAnimator;
|
private final LayerMarginsAnimator mMarginsAnimator;
|
||||||
private LayerView mView;
|
private final LayerView mView;
|
||||||
|
|
||||||
/* This flag is true from the time that browser.js detects a first-paint is about to start,
|
/* This flag is true from the time that browser.js detects a first-paint is about to start,
|
||||||
* to the time that we receive the first-paint composite notification from the compositor.
|
* to the time that we receive the first-paint composite notification from the compositor.
|
||||||
|
@ -41,9 +41,9 @@ class JavaPanZoomController
|
|||||||
{
|
{
|
||||||
private static final String LOGTAG = "GeckoPanZoomController";
|
private static final String LOGTAG = "GeckoPanZoomController";
|
||||||
|
|
||||||
private static String MESSAGE_ZOOM_RECT = "Browser:ZoomToRect";
|
private static final String MESSAGE_ZOOM_RECT = "Browser:ZoomToRect";
|
||||||
private static String MESSAGE_ZOOM_PAGE = "Browser:ZoomToPageWidth";
|
private static final String MESSAGE_ZOOM_PAGE = "Browser:ZoomToPageWidth";
|
||||||
private static String MESSAGE_TOUCH_LISTENER = "Tab:HasTouchListener";
|
private static final String MESSAGE_TOUCH_LISTENER = "Tab:HasTouchListener";
|
||||||
|
|
||||||
// Animation stops if the velocity is below this value when overscrolled or panning.
|
// Animation stops if the velocity is below this value when overscrolled or panning.
|
||||||
private static final float STOPPED_THRESHOLD = 4.0f;
|
private static final float STOPPED_THRESHOLD = 4.0f;
|
||||||
@ -170,7 +170,7 @@ class JavaPanZoomController
|
|||||||
|
|
||||||
@Override public void prefValue(String pref, int value) {
|
@Override public void prefValue(String pref, int value) {
|
||||||
if (pref.equals("ui.scrolling.gamepad_dead_zone")) {
|
if (pref.equals("ui.scrolling.gamepad_dead_zone")) {
|
||||||
GamepadUtils.overrideDeadZoneThreshold((float)value / 1000f);
|
GamepadUtils.overrideDeadZoneThreshold(value / 1000f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ class JavaPanZoomController
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void track(float x, float y, long time) {
|
private void track(float x, float y, long time) {
|
||||||
float timeDelta = (float)(time - mLastEventTime);
|
float timeDelta = (time - mLastEventTime);
|
||||||
if (FloatUtils.fuzzyEquals(timeDelta, 0)) {
|
if (FloatUtils.fuzzyEquals(timeDelta, 0)) {
|
||||||
// probably a duplicate event, ignore it. using a zero timeDelta will mess
|
// probably a duplicate event, ignore it. using a zero timeDelta will mess
|
||||||
// up our velocity
|
// up our velocity
|
||||||
@ -902,8 +902,8 @@ class JavaPanZoomController
|
|||||||
* The viewport metrics that represent the start and end of the bounce-back animation,
|
* The viewport metrics that represent the start and end of the bounce-back animation,
|
||||||
* respectively.
|
* respectively.
|
||||||
*/
|
*/
|
||||||
private ImmutableViewportMetrics mBounceStartMetrics;
|
private final ImmutableViewportMetrics mBounceStartMetrics;
|
||||||
private ImmutableViewportMetrics mBounceEndMetrics;
|
private final ImmutableViewportMetrics mBounceEndMetrics;
|
||||||
// How long ago this bounce was started in ns.
|
// How long ago this bounce was started in ns.
|
||||||
private long mBounceDuration;
|
private long mBounceDuration;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public class LayerMarginsAnimator {
|
|||||||
mPrefObserverId = PrefsHelper.getPref(PREF_SHOW_MARGINS_THRESHOLD, new PrefsHelper.PrefHandlerBase() {
|
mPrefObserverId = PrefsHelper.getPref(PREF_SHOW_MARGINS_THRESHOLD, new PrefsHelper.PrefHandlerBase() {
|
||||||
@Override
|
@Override
|
||||||
public void prefValue(String pref, int value) {
|
public void prefValue(String pref, int value) {
|
||||||
SHOW_MARGINS_THRESHOLD = (float)value / 100.0f;
|
SHOW_MARGINS_THRESHOLD = value / 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -253,8 +253,8 @@ public class LayerMarginsAnimator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LayerMarginsAnimationTask extends RenderTask {
|
class LayerMarginsAnimationTask extends RenderTask {
|
||||||
private float mStartLeft, mStartTop, mStartRight, mStartBottom;
|
private final float mStartLeft, mStartTop, mStartRight, mStartBottom;
|
||||||
private float mTop, mBottom, mLeft, mRight;
|
private final float mTop, mBottom, mLeft, mRight;
|
||||||
private boolean mContinueAnimation;
|
private boolean mContinueAnimation;
|
||||||
|
|
||||||
public LayerMarginsAnimationTask(boolean runAfter, ImmutableViewportMetrics metrics,
|
public LayerMarginsAnimationTask(boolean runAfter, ImmutableViewportMetrics metrics,
|
||||||
|
@ -69,10 +69,10 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
|||||||
private long mLastFrameTime;
|
private long mLastFrameTime;
|
||||||
private final CopyOnWriteArrayList<RenderTask> mTasks;
|
private final CopyOnWriteArrayList<RenderTask> mTasks;
|
||||||
|
|
||||||
private CopyOnWriteArrayList<Layer> mExtraLayers = new CopyOnWriteArrayList<Layer>();
|
private final CopyOnWriteArrayList<Layer> mExtraLayers = new CopyOnWriteArrayList<Layer>();
|
||||||
|
|
||||||
// Dropped frames display
|
// Dropped frames display
|
||||||
private int[] mFrameTimings;
|
private final int[] mFrameTimings;
|
||||||
private int mCurrentFrame, mFrameTimingsSum, mDroppedFrames;
|
private int mCurrentFrame, mFrameTimingsSum, mDroppedFrames;
|
||||||
|
|
||||||
// Render profiling output
|
// Render profiling output
|
||||||
@ -417,9 +417,9 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
|||||||
// The timestamp recording the start of this frame.
|
// The timestamp recording the start of this frame.
|
||||||
private long mFrameStartTime;
|
private long mFrameStartTime;
|
||||||
// A fixed snapshot of the viewport metrics that this frame is using to render content.
|
// A fixed snapshot of the viewport metrics that this frame is using to render content.
|
||||||
private ImmutableViewportMetrics mFrameMetrics;
|
private final ImmutableViewportMetrics mFrameMetrics;
|
||||||
// A rendering context for page-positioned layers, and one for screen-positioned layers.
|
// A rendering context for page-positioned layers, and one for screen-positioned layers.
|
||||||
private RenderContext mPageContext, mScreenContext;
|
private final RenderContext mPageContext, mScreenContext;
|
||||||
// Whether a layer was updated.
|
// Whether a layer was updated.
|
||||||
private boolean mUpdated;
|
private boolean mUpdated;
|
||||||
private final Rect mPageRect;
|
private final Rect mPageRect;
|
||||||
|
@ -50,12 +50,12 @@ import android.widget.FrameLayout;
|
|||||||
* Note that LayerView is accessed by Robocop via reflection.
|
* Note that LayerView is accessed by Robocop via reflection.
|
||||||
*/
|
*/
|
||||||
public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener {
|
public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener {
|
||||||
private static String LOGTAG = "GeckoLayerView";
|
private static final String LOGTAG = "GeckoLayerView";
|
||||||
|
|
||||||
private GeckoLayerClient mLayerClient;
|
private GeckoLayerClient mLayerClient;
|
||||||
private PanZoomController mPanZoomController;
|
private PanZoomController mPanZoomController;
|
||||||
private LayerMarginsAnimator mMarginsAnimator;
|
private LayerMarginsAnimator mMarginsAnimator;
|
||||||
private GLController mGLController;
|
private final GLController mGLController;
|
||||||
private InputConnectionHandler mInputConnectionHandler;
|
private InputConnectionHandler mInputConnectionHandler;
|
||||||
private LayerRenderer mRenderer;
|
private LayerRenderer mRenderer;
|
||||||
/* Must be a PAINT_xxx constant */
|
/* Must be a PAINT_xxx constant */
|
||||||
|
@ -18,10 +18,10 @@ import android.widget.AbsoluteLayout;
|
|||||||
public class PluginLayer extends TileLayer {
|
public class PluginLayer extends TileLayer {
|
||||||
private static final String LOGTAG = "PluginLayer";
|
private static final String LOGTAG = "PluginLayer";
|
||||||
|
|
||||||
private View mView;
|
private final View mView;
|
||||||
private SurfaceView mSurfaceView;
|
private SurfaceView mSurfaceView;
|
||||||
private PluginLayoutParams mLayoutParams;
|
private final PluginLayoutParams mLayoutParams;
|
||||||
private AbsoluteLayout mContainer;
|
private final AbsoluteLayout mContainer;
|
||||||
|
|
||||||
private boolean mDestroyed;
|
private boolean mDestroyed;
|
||||||
private boolean mViewVisible;
|
private boolean mViewVisible;
|
||||||
@ -123,7 +123,7 @@ public class PluginLayer extends TileLayer {
|
|||||||
private static final String LOGTAG = "GeckoApp.PluginLayoutParams";
|
private static final String LOGTAG = "GeckoApp.PluginLayoutParams";
|
||||||
|
|
||||||
private RectF mRect;
|
private RectF mRect;
|
||||||
private int mMaxDimension;
|
private final int mMaxDimension;
|
||||||
private float mLastResolution;
|
private float mLastResolution;
|
||||||
|
|
||||||
public PluginLayoutParams(RectF rect, int maxDimension) {
|
public PluginLayoutParams(RectF rect, int maxDimension) {
|
||||||
@ -136,10 +136,10 @@ public class PluginLayer extends TileLayer {
|
|||||||
private void clampToMaxSize() {
|
private void clampToMaxSize() {
|
||||||
if (width > mMaxDimension || height > mMaxDimension) {
|
if (width > mMaxDimension || height > mMaxDimension) {
|
||||||
if (width > height) {
|
if (width > height) {
|
||||||
height = Math.round(((float)height/(float)width) * mMaxDimension);
|
height = Math.round(((float)height/ width) * mMaxDimension);
|
||||||
width = mMaxDimension;
|
width = mMaxDimension;
|
||||||
} else {
|
} else {
|
||||||
width = Math.round(((float)width/(float)height) * mMaxDimension);
|
width = Math.round(((float)width/ height) * mMaxDimension);
|
||||||
height = mMaxDimension;
|
height = mMaxDimension;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class ScrollbarLayer extends TileLayer {
|
|||||||
private final float[] mCoords;
|
private final float[] mCoords;
|
||||||
private final RectF mCapRectF;
|
private final RectF mCapRectF;
|
||||||
|
|
||||||
private LayerRenderer mRenderer;
|
private final LayerRenderer mRenderer;
|
||||||
private int mProgram;
|
private int mProgram;
|
||||||
private int mPositionHandle;
|
private int mPositionHandle;
|
||||||
private int mTextureHandle;
|
private int mTextureHandle;
|
||||||
|
@ -36,12 +36,12 @@ import java.util.Stack;
|
|||||||
class SimpleScaleGestureDetector {
|
class SimpleScaleGestureDetector {
|
||||||
private static final String LOGTAG = "GeckoSimpleScaleGestureDetector";
|
private static final String LOGTAG = "GeckoSimpleScaleGestureDetector";
|
||||||
|
|
||||||
private SimpleScaleGestureListener mListener;
|
private final SimpleScaleGestureListener mListener;
|
||||||
private long mLastEventTime;
|
private long mLastEventTime;
|
||||||
private boolean mScaleResult;
|
private boolean mScaleResult;
|
||||||
|
|
||||||
/* Information about all pointers that are down. */
|
/* Information about all pointers that are down. */
|
||||||
private LinkedList<PointerInfo> mPointerInfo;
|
private final LinkedList<PointerInfo> mPointerInfo;
|
||||||
|
|
||||||
/** Creates a new gesture detector with the given listener. */
|
/** Creates a new gesture detector with the given listener. */
|
||||||
SimpleScaleGestureDetector(SimpleScaleGestureListener listener) {
|
SimpleScaleGestureDetector(SimpleScaleGestureListener listener) {
|
||||||
|
@ -20,10 +20,10 @@ import android.util.Log;
|
|||||||
class SubdocumentScrollHelper implements GeckoEventListener {
|
class SubdocumentScrollHelper implements GeckoEventListener {
|
||||||
private static final String LOGTAG = "GeckoSubdocScroll";
|
private static final String LOGTAG = "GeckoSubdocScroll";
|
||||||
|
|
||||||
private static String MESSAGE_PANNING_OVERRIDE = "Panning:Override";
|
private static final String MESSAGE_PANNING_OVERRIDE = "Panning:Override";
|
||||||
private static String MESSAGE_CANCEL_OVERRIDE = "Panning:CancelOverride";
|
private static final String MESSAGE_CANCEL_OVERRIDE = "Panning:CancelOverride";
|
||||||
private static String MESSAGE_SCROLL = "Gesture:Scroll";
|
private static final String MESSAGE_SCROLL = "Gesture:Scroll";
|
||||||
private static String MESSAGE_SCROLL_ACK = "Gesture:ScrollAck";
|
private static final String MESSAGE_SCROLL_ACK = "Gesture:ScrollAck";
|
||||||
|
|
||||||
private final Handler mUiHandler;
|
private final Handler mUiHandler;
|
||||||
private final EventDispatcher mEventDispatcher;
|
private final EventDispatcher mEventDispatcher;
|
||||||
|
@ -19,7 +19,7 @@ public class TextureGenerator {
|
|||||||
|
|
||||||
private static TextureGenerator sSharedInstance;
|
private static TextureGenerator sSharedInstance;
|
||||||
|
|
||||||
private ArrayBlockingQueue<Integer> mTextureIds;
|
private final ArrayBlockingQueue<Integer> mTextureIds;
|
||||||
private EGLContext mContext;
|
private EGLContext mContext;
|
||||||
|
|
||||||
private TextureGenerator() { mTextureIds = new ArrayBlockingQueue<Integer>(POOL_SIZE); }
|
private TextureGenerator() { mTextureIds = new ArrayBlockingQueue<Integer>(POOL_SIZE); }
|
||||||
|
@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||||||
/** Manages a list of dead tiles, so we don't leak resources. */
|
/** Manages a list of dead tiles, so we don't leak resources. */
|
||||||
public class TextureReaper {
|
public class TextureReaper {
|
||||||
private static TextureReaper sSharedInstance;
|
private static TextureReaper sSharedInstance;
|
||||||
private ArrayList<Integer> mDeadTextureIDs;
|
private final ArrayList<Integer> mDeadTextureIDs;
|
||||||
|
|
||||||
private TextureReaper() { mDeadTextureIDs = new ArrayList<Integer>(); }
|
private TextureReaper() { mDeadTextureIDs = new ArrayList<Integer>(); }
|
||||||
|
|
||||||
|
@ -915,7 +915,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ConcurrentLinkedQueue<Search> delayedSearches = new ConcurrentLinkedQueue<>();
|
private static final ConcurrentLinkedQueue<Search> delayedSearches = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
public static void recordSearchDelayed(String location, String engineID) {
|
public static void recordSearchDelayed(String location, String engineID) {
|
||||||
final Search search = new Search(location, engineID);
|
final Search search = new Search(location, engineID);
|
||||||
|
@ -104,7 +104,7 @@ class BookmarksListAdapter extends MultiTypeCursorAdapter {
|
|||||||
|
|
||||||
// mParentStack holds folder info instances (id + title) that allow
|
// mParentStack holds folder info instances (id + title) that allow
|
||||||
// us to navigate back up the folder hierarchy.
|
// us to navigate back up the folder hierarchy.
|
||||||
private LinkedList<FolderInfo> mParentStack;
|
private final LinkedList<FolderInfo> mParentStack;
|
||||||
|
|
||||||
// Refresh folder listener.
|
// Refresh folder listener.
|
||||||
private OnRefreshFolderListener mListener;
|
private OnRefreshFolderListener mListener;
|
||||||
|
@ -441,7 +441,7 @@ public class BrowserSearch extends HomeFragment
|
|||||||
|
|
||||||
if (searchCount == 0) {
|
if (searchCount == 0) {
|
||||||
// Prefetch the first item in the list since it's weighted the highest
|
// Prefetch the first item in the list since it's weighted the highest
|
||||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Session:Prefetch", url.toString()));
|
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Session:Prefetch", url));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does the completion match against the whole URL? This will match
|
// Does the completion match against the whole URL? This will match
|
||||||
|
@ -33,7 +33,7 @@ public class HomeListView extends ListView
|
|||||||
protected OnUrlOpenListener mUrlOpenListener;
|
protected OnUrlOpenListener mUrlOpenListener;
|
||||||
|
|
||||||
// Top divider
|
// Top divider
|
||||||
private boolean mShowTopDivider;
|
private final boolean mShowTopDivider;
|
||||||
|
|
||||||
// ContextMenuInfo maker
|
// ContextMenuInfo maker
|
||||||
private HomeContextMenuInfo.Factory mContextMenuInfoFactory;
|
private HomeContextMenuInfo.Factory mContextMenuInfoFactory;
|
||||||
|
@ -45,7 +45,7 @@ public class HomePager extends ViewPager {
|
|||||||
private final OnAddPanelListener mAddPanelListener;
|
private final OnAddPanelListener mAddPanelListener;
|
||||||
|
|
||||||
private final HomeConfig mConfig;
|
private final HomeConfig mConfig;
|
||||||
private ConfigLoaderCallbacks mConfigLoaderCallbacks;
|
private final ConfigLoaderCallbacks mConfigLoaderCallbacks;
|
||||||
|
|
||||||
private String mInitialPanelId;
|
private String mInitialPanelId;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ public class PanelGridView extends GridView
|
|||||||
|
|
||||||
private final ViewConfig viewConfig;
|
private final ViewConfig viewConfig;
|
||||||
private final PanelViewAdapter adapter;
|
private final PanelViewAdapter adapter;
|
||||||
private PanelViewItemHandler itemHandler;
|
private final PanelViewItemHandler itemHandler;
|
||||||
private OnItemOpenListener itemOpenListener;
|
private OnItemOpenListener itemOpenListener;
|
||||||
private HomeContextMenuInfo mContextMenuInfo;
|
private HomeContextMenuInfo mContextMenuInfo;
|
||||||
private HomeContextMenuInfo.Factory mContextMenuInfoFactory;
|
private HomeContextMenuInfo.Factory mContextMenuInfoFactory;
|
||||||
|
@ -59,7 +59,7 @@ public class PanelInfoManager implements GeckoEventListener {
|
|||||||
public void onComplete(List<PanelInfo> panelInfos);
|
public void onComplete(List<PanelInfo> panelInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AtomicInteger sRequestId = new AtomicInteger(0);
|
private static final AtomicInteger sRequestId = new AtomicInteger(0);
|
||||||
|
|
||||||
// Stores set of pending request callbacks.
|
// Stores set of pending request callbacks.
|
||||||
private static final SparseArray<RequestCallback> sCallbacks = new SparseArray<RequestCallback>();
|
private static final SparseArray<RequestCallback> sCallbacks = new SparseArray<RequestCallback>();
|
||||||
|
@ -679,7 +679,7 @@ abstract class PanelLayout extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class PanelOnItemOpenListener implements OnItemOpenListener {
|
private class PanelOnItemOpenListener implements OnItemOpenListener {
|
||||||
private ViewState mViewState;
|
private final ViewState mViewState;
|
||||||
|
|
||||||
public PanelOnItemOpenListener(ViewState viewState) {
|
public PanelOnItemOpenListener(ViewState viewState) {
|
||||||
mViewState = viewState;
|
mViewState = viewState;
|
||||||
@ -702,7 +702,7 @@ abstract class PanelLayout extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class PanelKeyListener implements View.OnKeyListener {
|
private class PanelKeyListener implements View.OnKeyListener {
|
||||||
private ViewState mViewState;
|
private final ViewState mViewState;
|
||||||
|
|
||||||
public PanelKeyListener(ViewState viewState) {
|
public PanelKeyListener(ViewState viewState) {
|
||||||
mViewState = viewState;
|
mViewState = viewState;
|
||||||
|
@ -206,7 +206,7 @@ class PinSiteDialog extends DialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class SearchAdapter extends CursorAdapter {
|
private static class SearchAdapter extends CursorAdapter {
|
||||||
private LayoutInflater mInflater;
|
private final LayoutInflater mInflater;
|
||||||
|
|
||||||
public SearchAdapter(Context context) {
|
public SearchAdapter(Context context) {
|
||||||
super(context, null, 0);
|
super(context, null, 0);
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
|
|
||||||
package org.mozilla.gecko.home;
|
package org.mozilla.gecko.home;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.mozilla.gecko.R;
|
import org.mozilla.gecko.R;
|
||||||
import org.mozilla.gecko.fxa.AccountLoader;
|
import org.mozilla.gecko.fxa.AccountLoader;
|
||||||
@ -52,7 +54,7 @@ public class RemoteTabsPanel extends HomeFragment {
|
|||||||
// system account states. We don't want to re-create panels unnecessarily,
|
// system account states. We don't want to re-create panels unnecessarily,
|
||||||
// because that can cause flickering. Be aware that null is a valid key; it
|
// because that can cause flickering. Be aware that null is a valid key; it
|
||||||
// corresponds to "no Account, neither Firefox nor Legacy Sync."
|
// corresponds to "no Account, neither Firefox nor Legacy Sync."
|
||||||
private final HashMap<Action, Fragment> mFragmentCache = new HashMap<Action, Fragment>();
|
private final Map<Action, Fragment> mFragmentCache = new EnumMap<>(Action.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
@ -105,8 +105,8 @@ public class TopSitesPanel extends HomeFragment {
|
|||||||
return new TopSitesPanel();
|
return new TopSitesPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||||
|
|
||||||
private static void debug(final String message) {
|
private static void debug(final String message) {
|
||||||
if (logDebug) {
|
if (logDebug) {
|
||||||
@ -406,7 +406,7 @@ public class TopSitesPanel extends HomeFragment {
|
|||||||
// Max number of search results.
|
// Max number of search results.
|
||||||
private static final int SEARCH_LIMIT = 30;
|
private static final int SEARCH_LIMIT = 30;
|
||||||
private static final String TELEMETRY_HISTOGRAM_LOAD_CURSOR = "FENNEC_TOPSITES_LOADER_TIME_MS";
|
private static final String TELEMETRY_HISTOGRAM_LOAD_CURSOR = "FENNEC_TOPSITES_LOADER_TIME_MS";
|
||||||
private int mMaxGridEntries;
|
private final int mMaxGridEntries;
|
||||||
|
|
||||||
public TopSitesLoader(Context context) {
|
public TopSitesLoader(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -701,7 +701,7 @@ public class TopSitesPanel extends HomeFragment {
|
|||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
static class ThumbnailsLoader extends AsyncTaskLoader<Map<String, ThumbnailInfo>> {
|
static class ThumbnailsLoader extends AsyncTaskLoader<Map<String, ThumbnailInfo>> {
|
||||||
private Map<String, ThumbnailInfo> mThumbnailInfos;
|
private Map<String, ThumbnailInfo> mThumbnailInfos;
|
||||||
private ArrayList<String> mUrls;
|
private final ArrayList<String> mUrls;
|
||||||
|
|
||||||
private static final ArrayList<String> COLUMNS = new ArrayList<String>() {{
|
private static final ArrayList<String> COLUMNS = new ArrayList<String>() {{
|
||||||
add(TILE_IMAGE_URL_COLUMN);
|
add(TILE_IMAGE_URL_COLUMN);
|
||||||
|
@ -32,7 +32,7 @@ public class TopSitesThumbnailView extends ImageView {
|
|||||||
private final float mStrokeWidth = getResources().getDisplayMetrics().density * 2;
|
private final float mStrokeWidth = getResources().getDisplayMetrics().density * 2;
|
||||||
|
|
||||||
// Paint for drawing the border.
|
// Paint for drawing the border.
|
||||||
private static Paint sBorderPaint;
|
private static final Paint sBorderPaint;
|
||||||
|
|
||||||
// Initializing the static border paint.
|
// Initializing the static border paint.
|
||||||
static {
|
static {
|
||||||
|
@ -88,13 +88,13 @@ public class GeckoMenu extends ListView
|
|||||||
protected static final int NO_ID = 0;
|
protected static final int NO_ID = 0;
|
||||||
|
|
||||||
// List of all menu items.
|
// List of all menu items.
|
||||||
private List<GeckoMenuItem> mItems;
|
private final List<GeckoMenuItem> mItems;
|
||||||
|
|
||||||
// Map of "always" action-items in action-bar and their views.
|
// Map of "always" action-items in action-bar and their views.
|
||||||
private Map<GeckoMenuItem, View> mPrimaryActionItems;
|
private final Map<GeckoMenuItem, View> mPrimaryActionItems;
|
||||||
|
|
||||||
// Map of "ifRoom" action-items in action-bar and their views.
|
// Map of "ifRoom" action-items in action-bar and their views.
|
||||||
private Map<GeckoMenuItem, View> mSecondaryActionItems;
|
private final Map<GeckoMenuItem, View> mSecondaryActionItems;
|
||||||
|
|
||||||
// Reference to a callback for menu events.
|
// Reference to a callback for menu events.
|
||||||
private Callback mCallback;
|
private Callback mCallback;
|
||||||
@ -109,7 +109,7 @@ public class GeckoMenu extends ListView
|
|||||||
private final ActionItemBarPresenter mSecondaryActionItemBar;
|
private final ActionItemBarPresenter mSecondaryActionItemBar;
|
||||||
|
|
||||||
// Adapter to hold the list of menu items.
|
// Adapter to hold the list of menu items.
|
||||||
private MenuItemsAdapter mAdapter;
|
private final MenuItemsAdapter mAdapter;
|
||||||
|
|
||||||
// Show/hide icons in the list.
|
// Show/hide icons in the list.
|
||||||
boolean mShowIcons;
|
boolean mShowIcons;
|
||||||
@ -686,7 +686,7 @@ public class GeckoMenu extends ListView
|
|||||||
private static final int VIEW_TYPE_DEFAULT = 0;
|
private static final int VIEW_TYPE_DEFAULT = 0;
|
||||||
private static final int VIEW_TYPE_ACTION_MODE = 1;
|
private static final int VIEW_TYPE_ACTION_MODE = 1;
|
||||||
|
|
||||||
private List<GeckoMenuItem> mItems;
|
private final List<GeckoMenuItem> mItems;
|
||||||
|
|
||||||
public MenuItemsAdapter() {
|
public MenuItemsAdapter() {
|
||||||
mItems = new ArrayList<GeckoMenuItem>();
|
mItems = new ArrayList<GeckoMenuItem>();
|
||||||
|
@ -20,7 +20,7 @@ public class MenuItemDefault extends TextView
|
|||||||
private static final int[] STATE_UNCHECKED = new int[] { android.R.attr.state_checkable };
|
private static final int[] STATE_UNCHECKED = new int[] { android.R.attr.state_checkable };
|
||||||
|
|
||||||
private Drawable mIcon;
|
private Drawable mIcon;
|
||||||
private Drawable mState;
|
private final Drawable mState;
|
||||||
private static Rect sIconBounds;
|
private static Rect sIconBounds;
|
||||||
|
|
||||||
private boolean mCheckable;
|
private boolean mCheckable;
|
||||||
|
@ -12,7 +12,7 @@ class ByteBufferInputStream extends InputStream {
|
|||||||
|
|
||||||
protected ByteBuffer mBuf;
|
protected ByteBuffer mBuf;
|
||||||
// Reference to a native object holding the data backing the ByteBuffer.
|
// Reference to a native object holding the data backing the ByteBuffer.
|
||||||
private NativeReference mNativeRef;
|
private final NativeReference mNativeRef;
|
||||||
|
|
||||||
protected ByteBufferInputStream(ByteBuffer buffer, NativeReference ref) {
|
protected ByteBufferInputStream(ByteBuffer buffer, NativeReference ref) {
|
||||||
mBuf = buffer;
|
mBuf = buffer;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#filter substitution
|
//#filter substitution
|
||||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
/* -*- 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
|
* 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
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@ -226,7 +226,7 @@ public final class GeckoLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_LINKER_EXTRACT
|
//#ifdef MOZ_LINKER_EXTRACT
|
||||||
putenv("MOZ_LINKER_EXTRACT=1");
|
putenv("MOZ_LINKER_EXTRACT=1");
|
||||||
// Ensure that the cache dir is world-writable
|
// Ensure that the cache dir is world-writable
|
||||||
File cacheDir = new File(linkerCache);
|
File cacheDir = new File(linkerCache);
|
||||||
@ -235,7 +235,7 @@ public final class GeckoLoader {
|
|||||||
cacheDir.setExecutable(true, false);
|
cacheDir.setExecutable(true, false);
|
||||||
cacheDir.setReadable(true, false);
|
cacheDir.setReadable(true, false);
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@RobocopTarget
|
@RobocopTarget
|
||||||
|
@ -55,7 +55,7 @@ public class SendTabList extends ListView {
|
|||||||
// Listener to fire when a share target is selected (either directly or via the prompt)
|
// Listener to fire when a share target is selected (either directly or via the prompt)
|
||||||
private SendTabTargetSelectedListener listener;
|
private SendTabTargetSelectedListener listener;
|
||||||
|
|
||||||
private State currentState = LOADING;
|
private final State currentState = LOADING;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum defining the states this view may occupy.
|
* Enum defining the states this view may occupy.
|
||||||
|
@ -22,14 +22,14 @@ import android.util.Log;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
class AndroidImport implements Runnable {
|
class AndroidImport implements Runnable {
|
||||||
static final private String LOGTAG = "AndroidImport";
|
private static final String LOGTAG = "AndroidImport";
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
private Runnable mOnDoneRunnable;
|
private final Runnable mOnDoneRunnable;
|
||||||
private ArrayList<ContentProviderOperation> mOperations;
|
private final ArrayList<ContentProviderOperation> mOperations;
|
||||||
private ContentResolver mCr;
|
private final ContentResolver mCr;
|
||||||
private LocalBrowserDB mDB;
|
private final LocalBrowserDB mDB;
|
||||||
private boolean mImportBookmarks;
|
private final boolean mImportBookmarks;
|
||||||
private boolean mImportHistory;
|
private final boolean mImportHistory;
|
||||||
|
|
||||||
public AndroidImport(Context context, Runnable onDoneRunnable,
|
public AndroidImport(Context context, Runnable onDoneRunnable,
|
||||||
boolean doBookmarks, boolean doHistory) {
|
boolean doBookmarks, boolean doHistory) {
|
||||||
|
@ -16,9 +16,9 @@ import android.util.AttributeSet;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
class AndroidImportPreference extends MultiPrefMultiChoicePreference {
|
class AndroidImportPreference extends MultiPrefMultiChoicePreference {
|
||||||
static final private String LOGTAG = "AndroidImport";
|
private static final String LOGTAG = "AndroidImport";
|
||||||
private static final String PREF_KEY_PREFIX = "import_android.data.";
|
private static final String PREF_KEY_PREFIX = "import_android.data.";
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
public AndroidImportPreference(Context context, AttributeSet attrs) {
|
public AndroidImportPreference(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
|
@ -11,6 +11,7 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.mozilla.gecko.AppConstants;
|
import org.mozilla.gecko.AppConstants;
|
||||||
import org.mozilla.gecko.AppConstants.Versions;
|
import org.mozilla.gecko.AppConstants.Versions;
|
||||||
@ -36,6 +37,7 @@ import org.mozilla.gecko.TelemetryContract.Method;
|
|||||||
import org.mozilla.gecko.background.common.GlobalConstants;
|
import org.mozilla.gecko.background.common.GlobalConstants;
|
||||||
import org.mozilla.gecko.background.healthreport.HealthReportConstants;
|
import org.mozilla.gecko.background.healthreport.HealthReportConstants;
|
||||||
import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
|
import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
|
||||||
|
import org.mozilla.gecko.updater.UpdateServiceHelper;
|
||||||
import org.mozilla.gecko.util.GeckoEventListener;
|
import org.mozilla.gecko.util.GeckoEventListener;
|
||||||
import org.mozilla.gecko.util.HardwareUtils;
|
import org.mozilla.gecko.util.HardwareUtils;
|
||||||
import org.mozilla.gecko.util.ThreadUtils;
|
import org.mozilla.gecko.util.ThreadUtils;
|
||||||
@ -325,7 +327,7 @@ OnSharedPreferenceChangeListener
|
|||||||
// all) in the action bar.
|
// all) in the action bar.
|
||||||
updateActionBarTitle(R.string.settings_title);
|
updateActionBarTitle(R.string.settings_title);
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT < 13) {
|
if (Build.VERSION.SDK_INT < 13) {
|
||||||
// Affected by Bug 1015209 -- no detach/attach.
|
// Affected by Bug 1015209 -- no detach/attach.
|
||||||
// If we try rejigging fragments, we'll crash, so don't
|
// If we try rejigging fragments, we'll crash, so don't
|
||||||
// enable locale switching at all.
|
// enable locale switching at all.
|
||||||
@ -1028,7 +1030,7 @@ OnSharedPreferenceChangeListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
private Map<String, PrefHandler> handlers = new HashMap<String, PrefHandler>() {{
|
private final Map<String, PrefHandler> handlers = new HashMap<String, PrefHandler>() {{
|
||||||
put(ClearOnShutdownPref.PREF, new ClearOnShutdownPref());
|
put(ClearOnShutdownPref.PREF, new ClearOnShutdownPref());
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@ -1056,17 +1058,17 @@ OnSharedPreferenceChangeListener
|
|||||||
if (PREFS_MENU_CHAR_ENCODING.equals(prefName)) {
|
if (PREFS_MENU_CHAR_ENCODING.equals(prefName)) {
|
||||||
setCharEncodingState(((String) newValue).equals("true"));
|
setCharEncodingState(((String) newValue).equals("true"));
|
||||||
} else if (PREFS_UPDATER_AUTODOWNLOAD.equals(prefName)) {
|
} else if (PREFS_UPDATER_AUTODOWNLOAD.equals(prefName)) {
|
||||||
org.mozilla.gecko.updater.UpdateServiceHelper.registerForUpdates(this, (String) newValue);
|
UpdateServiceHelper.registerForUpdates(this, (String) newValue);
|
||||||
} else if (PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(prefName)) {
|
} else if (PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(prefName)) {
|
||||||
// The healthreport pref only lives in Android, so we do not persist
|
// The healthreport pref only lives in Android, so we do not persist
|
||||||
// to Gecko, but we do broadcast intent to the health report
|
// to Gecko, but we do broadcast intent to the health report
|
||||||
// background uploader service, which will start or stop the
|
// background uploader service, which will start or stop the
|
||||||
// repeated background upload attempts.
|
// repeated background upload attempts.
|
||||||
broadcastHealthReportUploadPref(this, ((Boolean) newValue).booleanValue());
|
broadcastHealthReportUploadPref(this, (Boolean) newValue);
|
||||||
} else if (PREFS_GEO_REPORTING.equals(prefName)) {
|
} else if (PREFS_GEO_REPORTING.equals(prefName)) {
|
||||||
broadcastStumblerPref(this, ((Boolean) newValue).booleanValue());
|
broadcastStumblerPref(this, (Boolean) newValue);
|
||||||
// Translate boolean value to int for geo reporting pref.
|
// Translate boolean value to int for geo reporting pref.
|
||||||
newValue = ((Boolean) newValue) ? 1 : 0;
|
newValue = (Boolean) newValue ? 1 : 0;
|
||||||
} else if (handlers.containsKey(prefName)) {
|
} else if (handlers.containsKey(prefName)) {
|
||||||
PrefHandler handler = handlers.get(prefName);
|
PrefHandler handler = handlers.get(prefName);
|
||||||
handler.onChange(this, preference, newValue);
|
handler.onChange(this, preference, newValue);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user