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("safeMode").hidden = true;
|
||||
if (ResetProfile.resetSupported()) {
|
||||
populateResetPane("resetProfileItems");
|
||||
document.getElementById("resetProfile").hidden = false;
|
||||
} else {
|
||||
// Hide the reset button is it's not supported.
|
||||
|
@ -21,7 +21,7 @@
|
||||
title="&safeModeDialog.title;"
|
||||
buttons="accept,extra1"
|
||||
buttonlabelaccept="&startSafeMode.label;"
|
||||
buttonlabelextra1="&resetProfile.label;"
|
||||
buttonlabelextra1="&refreshProfile.label;"
|
||||
maxwidth="&window.maxWidth;"
|
||||
ondialogaccept="return onDefaultButton()"
|
||||
ondialogcancel="onCancel();"
|
||||
@ -32,30 +32,19 @@
|
||||
<script type="application/javascript" src="chrome://browser/content/safeMode.js"/>
|
||||
|
||||
<vbox id="autoSafeMode" hidden="true">
|
||||
<description>&autoSafeModeDescription2.label;</description>
|
||||
<description>&autoSafeModeDescription3.label;</description>
|
||||
</vbox>
|
||||
|
||||
<vbox id ="safeMode">
|
||||
<vbox id="safeMode">
|
||||
<label>&safeModeDescription3.label;</label>
|
||||
<separator class="thin"/>
|
||||
<label>&safeModeDescription4.label;</label>
|
||||
<separator class="thin"/>
|
||||
<label id="resetProfileInstead">&resetProfileInstead.label;</label>
|
||||
<label id="resetProfileInstead">&refreshProfileInstead.label;</label>
|
||||
</vbox>
|
||||
|
||||
<vbox id="resetProfile" hidden="true">
|
||||
<label>&resetProfile.dialog.items2.label;</label>
|
||||
|
||||
<vbox id="resetProfileItems" class="indent">
|
||||
</vbox>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
<label id="resetProfileFooter">&resetProfileFooter.label;</label>
|
||||
|
||||
<label>&safeModeInstead.label;</label>
|
||||
|
||||
<separator/>
|
||||
<label id="resetProfileInstead">&refreshProfileInstead.label;</label>
|
||||
</vbox>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
@ -188,7 +188,7 @@
|
||||
<image id="PanelUI-panic-timeframe-icon-small" alt=""/>
|
||||
<description id="PanelUI-panic-mainDesc" flex="1">&panicButton.view.mainTimeframeDesc;</description>
|
||||
</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"
|
||||
value="5" class="subviewradio"/>
|
||||
<radio id="PanelUI-panic-2hr" label="&panicButton.view.2hr;"
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
<!-- Error Title -->
|
||||
<div id="errorTitle">
|
||||
<h1 id="errorTitleText">&welcomeback.pageTitle;</h1>
|
||||
<h1 id="errorTitleText">&welcomeback2.pageTitle;</h1>
|
||||
</div>
|
||||
|
||||
<!-- LONG CONTENT (the section most likely to require scrolling) -->
|
||||
@ -41,7 +41,9 @@
|
||||
|
||||
<!-- Short Description -->
|
||||
<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>
|
||||
|
||||
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
|
||||
@ -66,21 +68,9 @@
|
||||
|
||||
<!-- Buttons -->
|
||||
<hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="buttons">
|
||||
#ifdef XP_UNIX
|
||||
<button id="errorCancel" label="&restorepage.closeButton;"
|
||||
accesskey="&restorepage.close.access;"
|
||||
oncommand="startNewSession();"/>
|
||||
<button id="errorTryAgain" label="&restorepage.tryagainButton;"
|
||||
accesskey="&restorepage.restore.access;"
|
||||
<button id="errorTryAgain" label="&welcomeback2.restoreButton;"
|
||||
accesskey="&welcomeback2.restoreButton.access;"
|
||||
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>
|
||||
<!-- holds the session data for when the tab is closed -->
|
||||
<input type="text" id="sessionData" style="display: none;"/>
|
||||
|
@ -637,8 +637,8 @@ BrowserGlue.prototype = {
|
||||
let message = resetBundle.formatStringFromName("resetUnusedProfile.message", [productName], 1);
|
||||
let buttons = [
|
||||
{
|
||||
label: resetBundle.formatStringFromName("resetProfile.resetButton.label", [productName], 1),
|
||||
accessKey: resetBundle.GetStringFromName("resetProfile.resetButton.accesskey"),
|
||||
label: resetBundle.formatStringFromName("refreshProfile.resetButton.label", [productName], 1),
|
||||
accessKey: resetBundle.GetStringFromName("refreshProfile.resetButton.accesskey"),
|
||||
callback: function () {
|
||||
ResetProfile.openConfirmationDialog(win);
|
||||
}
|
||||
|
@ -2,8 +2,9 @@
|
||||
* 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/. */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var gStateObject;
|
||||
var gTreeData;
|
||||
@ -11,6 +12,14 @@ var gTreeData;
|
||||
// Page initialization
|
||||
|
||||
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
|
||||
// (for when the tab is closed or the session crashes right again)
|
||||
var sessionData = document.getElementById("sessionData");
|
||||
@ -70,6 +79,14 @@ function initTreeView() {
|
||||
function restoreSession() {
|
||||
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
|
||||
var ix = gStateObject.windows.length - 1;
|
||||
for (var t = gTreeData.length - 1; t >= 0; t--) {
|
||||
@ -191,7 +208,10 @@ function toggleRowChecked(aIx) {
|
||||
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) {
|
||||
|
@ -23,12 +23,28 @@
|
||||
<!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 -->
|
||||
<!ENTITY welcomeback.tabtitle "Welcome Back!">
|
||||
|
||||
<!-- LOCALIZATION NOTE: The title is intended to be welcoming and congratulatory,
|
||||
expressing joy that the user has successfully migrated their stuff and hope
|
||||
that now they have a better experience. -->
|
||||
<!ENTITY welcomeback.pageTitle "Welcome Back!">
|
||||
<!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.restoreButton "Let's go!">
|
||||
<!ENTITY welcomeback2.restoreButton.access "L">
|
||||
|
||||
<!ENTITY welcomeback2.tabtitle "Success!">
|
||||
|
||||
<!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.hint = Hint
|
||||
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.
|
||||
new_contact_name_placeholder=Name
|
||||
new_contact_email_placeholder=Email
|
||||
new_contact_phone_placeholder=Firefox OS Phone
|
||||
|
||||
contacts_blocked_contacts=Blocked Contacts
|
||||
|
||||
|
@ -6,14 +6,12 @@
|
||||
<!ENTITY window.maxWidth "400">
|
||||
|
||||
<!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 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 -->
|
||||
<!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 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.">
|
||||
<!-- LOCALIZATION NOTE (autoSafeModeDescription3.label): Shown on the safe mode dialog after multiple startup crashes. See also chrome/global/resetProfile.dtd -->
|
||||
<!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.">
|
||||
|
@ -18,9 +18,9 @@ class ActionModeCompat implements GeckoPopupMenu.OnMenuItemClickListener,
|
||||
View.OnClickListener {
|
||||
private final String LOGTAG = "GeckoActionModeCompat";
|
||||
|
||||
private Callback mCallback;
|
||||
private ActionModeCompatView mView;
|
||||
private Presenter mPresenter;
|
||||
private final Callback mCallback;
|
||||
private final ActionModeCompatView mView;
|
||||
private final Presenter mPresenter;
|
||||
|
||||
/* 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 */
|
||||
|
@ -33,7 +33,7 @@ public class AlertNotification
|
||||
private String mPrevAlertText = "";
|
||||
|
||||
private static final double UPDATE_THRESHOLD = .01;
|
||||
private Context mContext;
|
||||
private final Context mContext;
|
||||
|
||||
public AlertNotification(Context aContext, int aNotificationId, int aIcon,
|
||||
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; -*-
|
||||
* 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
|
||||
@ -31,11 +31,11 @@ public class AppConstants {
|
||||
public static final class Versions {
|
||||
public static final int MIN_SDK_VERSION = @MOZ_ANDROID_MIN_SDK_VERSION@;
|
||||
public static final int MAX_SDK_VERSION =
|
||||
#ifdef MOZ_ANDROID_MAX_SDK_VERSION
|
||||
//#ifdef MOZ_ANDROID_MAX_SDK_VERSION
|
||||
@MOZ_ANDROID_MAX_SDK_VERSION@;
|
||||
#else
|
||||
//#else
|
||||
999;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
/*
|
||||
* 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 MOZ_STUMBLER_API_KEY =
|
||||
#ifdef MOZ_ANDROID_MLS_STUMBLER
|
||||
//#ifdef MOZ_ANDROID_MLS_STUMBLER
|
||||
"@MOZ_STUMBLER_API_KEY@";
|
||||
#else
|
||||
//#else
|
||||
null;
|
||||
#endif
|
||||
//#endif
|
||||
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@";
|
||||
@ -122,142 +122,142 @@ public class AppConstants {
|
||||
public static final int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@;
|
||||
|
||||
public static final boolean MOZ_ANDROID_ANR_REPORTER =
|
||||
#ifdef MOZ_ANDROID_ANR_REPORTER
|
||||
//#ifdef MOZ_ANDROID_ANR_REPORTER
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final String MOZ_PKG_SPECIAL =
|
||||
#ifdef MOZ_PKG_SPECIAL
|
||||
//#ifdef MOZ_PKG_SPECIAL
|
||||
"@MOZ_PKG_SPECIAL@";
|
||||
#else
|
||||
//#else
|
||||
null;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
/**
|
||||
* Whether this APK was built with constrained resources --
|
||||
* no xhdpi+ images, for example.
|
||||
*/
|
||||
public static final boolean MOZ_ANDROID_RESOURCE_CONSTRAINED =
|
||||
#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
|
||||
//#ifdef MOZ_ANDROID_RESOURCE_CONSTRAINED
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_SERVICES_HEALTHREPORT =
|
||||
#ifdef MOZ_SERVICES_HEALTHREPORT
|
||||
//#ifdef MOZ_SERVICES_HEALTHREPORT
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_TELEMETRY_ON_BY_DEFAULT =
|
||||
#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
|
||||
//#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final String TELEMETRY_PREF_NAME =
|
||||
"toolkit.telemetry.enabled";
|
||||
|
||||
public static final boolean MOZ_TELEMETRY_REPORTING =
|
||||
#ifdef MOZ_TELEMETRY_REPORTING
|
||||
//#ifdef MOZ_TELEMETRY_REPORTING
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_CRASHREPORTER =
|
||||
#if MOZ_CRASHREPORTER
|
||||
//#if MOZ_CRASHREPORTER
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_DATA_REPORTING =
|
||||
#ifdef MOZ_DATA_REPORTING
|
||||
//#ifdef MOZ_DATA_REPORTING
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_LOCALE_SWITCHER =
|
||||
#ifdef MOZ_LOCALE_SWITCHER
|
||||
//#ifdef MOZ_LOCALE_SWITCHER
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_UPDATER =
|
||||
#ifdef MOZ_UPDATER
|
||||
//#ifdef MOZ_UPDATER
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_WEBSMS_BACKEND =
|
||||
#ifdef MOZ_WEBSMS_BACKEND
|
||||
//#ifdef MOZ_WEBSMS_BACKEND
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
// Android Beam is only supported on API14+, so we don't even bother building
|
||||
// it if this APK doesn't include API14 support.
|
||||
public static final boolean MOZ_ANDROID_BEAM =
|
||||
#ifdef MOZ_ANDROID_BEAM
|
||||
//#ifdef MOZ_ANDROID_BEAM
|
||||
Versions.feature14Plus;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_ANDROID_APZ =
|
||||
#ifdef MOZ_ANDROID_APZ
|
||||
//#ifdef MOZ_ANDROID_APZ
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
// See this wiki page for more details about channel specific build defines:
|
||||
// https://wiki.mozilla.org/Platform/Channel-specific_build_defines
|
||||
public static final boolean RELEASE_BUILD =
|
||||
#ifdef RELEASE_BUILD
|
||||
//#ifdef RELEASE_BUILD
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean DEBUG_BUILD =
|
||||
#ifdef MOZ_DEBUG
|
||||
//#ifdef MOZ_DEBUG
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean MOZ_MEDIA_PLAYER =
|
||||
#ifdef MOZ_NATIVE_DEVICES
|
||||
//#ifdef MOZ_NATIVE_DEVICES
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
// Official corresponds, roughly, to whether this build is performed on
|
||||
// Mozilla's continuous integration infrastructure. You should disable
|
||||
// developer-only functionality when this flag is set.
|
||||
public static final boolean MOZILLA_OFFICIAL =
|
||||
#ifdef MOZILLA_OFFICIAL
|
||||
//#ifdef MOZILLA_OFFICIAL
|
||||
true;
|
||||
#else
|
||||
//#else
|
||||
false;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
public static final boolean ANDROID_DOWNLOADS_INTEGRATION =
|
||||
#ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
|
||||
//#ifdef MOZ_ANDROID_DOWNLOADS_INTEGRATION
|
||||
AppConstants.Versions.feature12Plus;
|
||||
#else
|
||||
//#else
|
||||
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.
|
||||
private boolean mHideWebContentOnAnimationEnd;
|
||||
|
||||
private DynamicToolbar mDynamicToolbar = new DynamicToolbar();
|
||||
private final DynamicToolbar mDynamicToolbar = new DynamicToolbar();
|
||||
|
||||
@Override
|
||||
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 systemLocale = Locale.getDefault();
|
||||
|
||||
private AtomicBoolean inited = new AtomicBoolean(false);
|
||||
private final AtomicBoolean inited = new AtomicBoolean(false);
|
||||
private boolean systemLocaleDidChange;
|
||||
private BroadcastReceiver receiver;
|
||||
|
||||
private static AtomicReference<LocaleManager> instance = new AtomicReference<LocaleManager>();
|
||||
private static final AtomicReference<LocaleManager> instance = new AtomicReference<LocaleManager>();
|
||||
|
||||
public static LocaleManager getInstance() {
|
||||
LocaleManager localeManager = instance.get();
|
||||
|
@ -43,7 +43,7 @@ class ChromeCast implements GeckoMediaPlayer {
|
||||
private final RouteInfo route;
|
||||
private GoogleApiClient apiClient;
|
||||
private RemoteMediaPlayer remoteMediaPlayer;
|
||||
private boolean canMirror;
|
||||
private final boolean canMirror;
|
||||
private String mSessionId;
|
||||
private MirrorChannel mMirrorChannel;
|
||||
private boolean mApplicationStarted = false;
|
||||
|
@ -90,8 +90,8 @@ public class ContactService implements GeckoEventListener {
|
||||
private HashMap<String, Integer> mWebsiteTypesMap;
|
||||
private HashMap<String, Integer> mImTypesMap;
|
||||
|
||||
private ContentResolver mContentResolver;
|
||||
private GeckoApp mActivity;
|
||||
private final ContentResolver mContentResolver;
|
||||
private final GeckoApp mActivity;
|
||||
|
||||
ContactService(EventDispatcher eventDispatcher, GeckoApp activity) {
|
||||
mEventDispatcher = eventDispatcher;
|
||||
@ -671,7 +671,7 @@ public class ContactService implements GeckoEventListener {
|
||||
if (typeConstant == BaseTypes.TYPE_CUSTOM) {
|
||||
type = cursor.getString(cursor.getColumnIndex(typeLabelColumn));
|
||||
} else {
|
||||
type = getKeyFromMapValue(typeMap, Integer.valueOf(typeConstant));
|
||||
type = getKeyFromMapValue(typeMap, typeConstant);
|
||||
}
|
||||
|
||||
// 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) {
|
||||
type = cursor.getString(cursor.getColumnIndex(Phone.LABEL));
|
||||
} else {
|
||||
type = getKeyFromMapValue(mPhoneTypesMap, Integer.valueOf(typeConstant));
|
||||
type = getKeyFromMapValue(mPhoneTypesMap, typeConstant);
|
||||
}
|
||||
|
||||
// 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) {
|
||||
type = cursor.getString(cursor.getColumnIndex(StructuredPostal.LABEL));
|
||||
} else {
|
||||
type = getKeyFromMapValue(mAddressTypesMap, Integer.valueOf(typeConstant));
|
||||
type = getKeyFromMapValue(mAddressTypesMap, typeConstant);
|
||||
}
|
||||
|
||||
// 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";
|
||||
Long newRawContactId = new Long(-1);
|
||||
Long newRawContactId = -1L;
|
||||
|
||||
// Insert the contact!
|
||||
ContentProviderResult[] insertResults = applyBatch(newContactOptions);
|
||||
@ -1476,7 +1476,7 @@ public class ContactService implements GeckoEventListener {
|
||||
|
||||
private void getContactsCount(final String requestID) {
|
||||
Cursor cursor = getAllRawContactIdsCursor();
|
||||
Integer numContacts = Integer.valueOf(cursor.getCount());
|
||||
Integer numContacts = cursor.getCount();
|
||||
cursor.close();
|
||||
|
||||
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()) {
|
||||
if (value == entry.getValue()) {
|
||||
return entry.getKey();
|
||||
@ -1898,7 +1898,7 @@ public class ContactService implements GeckoEventListener {
|
||||
private int getAddressType(String addressType) {
|
||||
initAddressTypesMap();
|
||||
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() {
|
||||
@ -1914,7 +1914,7 @@ public class ContactService implements GeckoEventListener {
|
||||
private int getPhoneType(String phoneType) {
|
||||
initPhoneTypesMap();
|
||||
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() {
|
||||
@ -1949,7 +1949,7 @@ public class ContactService implements GeckoEventListener {
|
||||
private int getEmailType(String emailType) {
|
||||
initEmailTypesMap();
|
||||
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() {
|
||||
@ -1966,7 +1966,7 @@ public class ContactService implements GeckoEventListener {
|
||||
private int getWebsiteType(String webisteType) {
|
||||
initWebsiteTypesMap();
|
||||
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() {
|
||||
@ -1986,7 +1986,7 @@ public class ContactService implements GeckoEventListener {
|
||||
private int getImType(String imType) {
|
||||
initImTypesMap();
|
||||
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() {
|
||||
|
@ -282,8 +282,8 @@ public class CrashReporter extends Activity
|
||||
|
||||
private String generateBoundary() {
|
||||
// Generate some random numbers to fill out the boundary
|
||||
int r0 = (int)((double)Integer.MAX_VALUE * Math.random());
|
||||
int r1 = (int)((double)Integer.MAX_VALUE * Math.random());
|
||||
int r0 = (int)(Integer.MAX_VALUE * Math.random());
|
||||
int r1 = (int)(Integer.MAX_VALUE * Math.random());
|
||||
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
|
||||
// uniquely identified by its tabId and value.
|
||||
private HashSet<DoorHanger> mDoorHangers;
|
||||
private final HashSet<DoorHanger> mDoorHangers;
|
||||
|
||||
// Whether or not the doorhanger popup is disabled.
|
||||
private boolean mDisabled;
|
||||
|
@ -106,7 +106,7 @@ public class DynamicToolbar {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean immediate = transition.equals(VisibilityTransition.IMMEDIATE);
|
||||
final boolean immediate = transition == VisibilityTransition.IMMEDIATE;
|
||||
if (visible) {
|
||||
layerView.getLayerMarginsAnimator().showMargins(immediate);
|
||||
} else {
|
||||
|
@ -401,8 +401,8 @@ public class FormAssistPopup extends RelativeLayout implements GeckoEventListene
|
||||
}
|
||||
|
||||
private class AutoCompleteListAdapter extends ArrayAdapter<Pair<String, String>> {
|
||||
private LayoutInflater mInflater;
|
||||
private int mTextViewResourceId;
|
||||
private final LayoutInflater mInflater;
|
||||
private final int mTextViewResourceId;
|
||||
|
||||
public AutoCompleteListAdapter(Context context, int textViewResourceId) {
|
||||
super(context, textViewResourceId);
|
||||
|
@ -183,7 +183,7 @@ public abstract class GeckoApp
|
||||
private FullScreenHolder mFullScreenPluginContainer;
|
||||
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 mInitialized;
|
||||
@ -1016,9 +1016,9 @@ public abstract class GeckoApp
|
||||
int inSampleSize = 1;
|
||||
if (height > idealHeight || width > idealWidth) {
|
||||
if (width > height) {
|
||||
inSampleSize = Math.round((float)height / (float)idealHeight);
|
||||
inSampleSize = Math.round((float)height / idealHeight);
|
||||
} else {
|
||||
inSampleSize = Math.round((float)width / (float)idealWidth);
|
||||
inSampleSize = Math.round((float)width / idealWidth);
|
||||
}
|
||||
}
|
||||
return inSampleSize;
|
||||
|
@ -30,7 +30,7 @@ public class GeckoBatteryManager extends BroadcastReceiver {
|
||||
private static boolean sCharging = kDefaultCharging;
|
||||
private static double sRemainingTime = kDefaultRemainingTime;
|
||||
|
||||
private static GeckoBatteryManager sInstance = new GeckoBatteryManager();
|
||||
private static final GeckoBatteryManager sInstance = new GeckoBatteryManager();
|
||||
|
||||
private final IntentFilter mFilter;
|
||||
private Context mApplicationContext;
|
||||
@ -107,8 +107,8 @@ public class GeckoBatteryManager extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
// We need two doubles because sLevel is a double.
|
||||
double current = (double)intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
||||
double max = (double)intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||
double current = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
||||
double max = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||
if (current == -1 || max == -1) {
|
||||
Log.e(LOGTAG, "Failed to get battery level!");
|
||||
sLevel = kDefaultLevel;
|
||||
|
@ -25,7 +25,7 @@ public class GeckoConnectivityReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String LOGTAG = "GeckoConnectivityReceiver";
|
||||
|
||||
private static GeckoConnectivityReceiver sInstance = new GeckoConnectivityReceiver();
|
||||
private static final GeckoConnectivityReceiver sInstance = new GeckoConnectivityReceiver();
|
||||
|
||||
private final IntentFilter mFilter;
|
||||
private Context mApplicationContext;
|
||||
|
@ -43,7 +43,7 @@ public class GeckoEvent {
|
||||
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...
|
||||
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) {
|
||||
synchronized (mEvents) {
|
||||
|
@ -997,7 +997,7 @@ final class DebugGeckoInputConnection
|
||||
implements InvocationHandler {
|
||||
|
||||
private InputConnection mProxy;
|
||||
private StringBuilder mCallLevel;
|
||||
private final StringBuilder mCallLevel;
|
||||
|
||||
private DebugGeckoInputConnection(View targetView,
|
||||
GeckoEditableClient editable) {
|
||||
|
@ -62,7 +62,7 @@ public class GeckoJavaSampler {
|
||||
private boolean mPauseSampler;
|
||||
private boolean mStopSampler;
|
||||
|
||||
private SparseArray<Sample[]> mSamples = new SparseArray<Sample[]>();
|
||||
private final SparseArray<Sample[]> mSamples = new SparseArray<Sample[]>();
|
||||
private int mSamplePos;
|
||||
|
||||
public SamplingThread(final int aInterval, final int aSampleCount) {
|
||||
@ -142,7 +142,7 @@ public class GeckoJavaSampler {
|
||||
Sample sample = getSample(aThreadId, aSampleId);
|
||||
if (sample != null) {
|
||||
if (sample.mJavaTime != 0) {
|
||||
return (double)(sample.mJavaTime -
|
||||
return (sample.mJavaTime -
|
||||
SystemClock.elapsedRealtime()) + getProfilerTime();
|
||||
}
|
||||
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 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;
|
||||
|
||||
// Caches the guest profile dir.
|
||||
|
@ -58,7 +58,7 @@ public class GeckoProfileDirectories {
|
||||
/**
|
||||
* 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
|
||||
public boolean matches(INISection section) {
|
||||
return section.getIntProperty("Default") == 1;
|
||||
@ -68,7 +68,7 @@ public class GeckoProfileDirectories {
|
||||
/**
|
||||
* 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
|
||||
public boolean matches(INISection section) {
|
||||
final String name = section.getStringProperty("Name");
|
||||
|
@ -37,7 +37,7 @@ public class GeckoThread extends Thread implements GeckoEventListener {
|
||||
GeckoExited
|
||||
}
|
||||
|
||||
private static AtomicReference<LaunchState> sLaunchState =
|
||||
private static final AtomicReference<LaunchState> sLaunchState =
|
||||
new AtomicReference<LaunchState>(LaunchState.Launching);
|
||||
|
||||
private static GeckoThread sGeckoThread;
|
||||
|
@ -31,7 +31,7 @@ public final class IntentHelper implements GeckoEventListener {
|
||||
};
|
||||
private static IntentHelper instance;
|
||||
|
||||
private Activity activity;
|
||||
private final Activity activity;
|
||||
|
||||
private IntentHelper(Activity activity) {
|
||||
this.activity = activity;
|
||||
|
@ -26,11 +26,11 @@ import android.graphics.drawable.Drawable;
|
||||
* to specify the alpha) in order.
|
||||
*/
|
||||
public class LightweightThemeDrawable extends Drawable {
|
||||
private Paint mPaint;
|
||||
private final Paint mPaint;
|
||||
private Paint mColorPaint;
|
||||
|
||||
private Bitmap mBitmap;
|
||||
private Resources mResources;
|
||||
private final Bitmap mBitmap;
|
||||
private final Resources mResources;
|
||||
|
||||
private int mStartColor;
|
||||
private int mEndColor;
|
||||
@ -53,8 +53,9 @@ public class LightweightThemeDrawable extends Drawable {
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
// Draw the colors, if available.
|
||||
if (mColorPaint != null)
|
||||
if (mColorPaint != null) {
|
||||
canvas.drawPaint(mColorPaint);
|
||||
}
|
||||
|
||||
// Draw the bitmap.
|
||||
canvas.drawPaint(mPaint);
|
||||
@ -75,7 +76,7 @@ public class LightweightThemeDrawable extends Drawable {
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter filter) {
|
||||
mPaint.setColorFilter(filter);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a paint that paint a particular color.
|
||||
@ -112,17 +113,17 @@ public class LightweightThemeDrawable extends Drawable {
|
||||
}
|
||||
|
||||
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.
|
||||
// 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.
|
||||
LinearGradient gradient = new LinearGradient(0, 0, 0, mBitmap.getHeight(), mStartColor, mEndColor, Shader.TileMode.CLAMP);
|
||||
// A linear-gradient to specify the opacity of the bitmap.
|
||||
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'.
|
||||
// Drawing the DST in the SRC will provide the opacity.
|
||||
mPaint.setShader(new ComposeShader(bitmapShader, gradient, PorterDuff.Mode.DST_IN));
|
||||
// Drawing the DST in the SRC will provide the opacity.
|
||||
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_KEEP_PATH := 1
|
||||
preprocessed_FLAGS := --marker='//\\\#'
|
||||
|
||||
PP_TARGETS += preprocessed
|
||||
|
||||
@ -214,6 +215,7 @@ preprocessed_package := $(addsuffix .in,$(subst $(android_package_dir)/,,$(filte
|
||||
|
||||
preprocessed_package_PATH := $(android_package_dir)
|
||||
preprocessed_package_KEEP_PATH := 1
|
||||
preprocessed_package_FLAGS := --marker='//\\\#'
|
||||
|
||||
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_HIGH = 4;
|
||||
|
||||
private static MemoryMonitor sInstance = new MemoryMonitor();
|
||||
private static final MemoryMonitor sInstance = new MemoryMonitor();
|
||||
|
||||
static MemoryMonitor getInstance() {
|
||||
return sInstance;
|
||||
|
@ -64,7 +64,7 @@ public final class NotificationHelper implements GeckoEventListener {
|
||||
private static final String CLEARED_EVENT = "notification-cleared";
|
||||
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.
|
||||
// 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();
|
||||
|
||||
private class ScrollRunnable extends TimerTask {
|
||||
private View mView;
|
||||
private final View mView;
|
||||
|
||||
public ScrollRunnable(View view) {
|
||||
mView = view;
|
||||
|
@ -46,7 +46,7 @@ public class SuggestClient {
|
||||
private final int mMaxResults;
|
||||
|
||||
// used by robocop for testing
|
||||
private boolean mCheckNetwork;
|
||||
private final boolean mCheckNetwork;
|
||||
|
||||
// used to make suggestions appear instantly after opt-in
|
||||
private String mPrevQuery;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#filter substitution
|
||||
//#filter substitution
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
@ -45,27 +45,27 @@ public class Tab {
|
||||
private int mFaviconSize;
|
||||
private boolean mHasFeeds;
|
||||
private boolean mHasOpenSearch;
|
||||
private SiteIdentity mSiteIdentity;
|
||||
private final SiteIdentity mSiteIdentity;
|
||||
private boolean mReaderEnabled;
|
||||
private BitmapDrawable mThumbnail;
|
||||
private int mHistoryIndex;
|
||||
private int mHistorySize;
|
||||
private int mParentId;
|
||||
private boolean mExternal;
|
||||
private final int mParentId;
|
||||
private final boolean mExternal;
|
||||
private boolean mBookmark;
|
||||
private int mFaviconLoadId;
|
||||
private String mContentType;
|
||||
private boolean mHasTouchListeners;
|
||||
private ZoomConstraints mZoomConstraints;
|
||||
private boolean mIsRTL;
|
||||
private ArrayList<View> mPluginViews;
|
||||
private HashMap<Object, Layer> mPluginLayers;
|
||||
private final ArrayList<View> mPluginViews;
|
||||
private final HashMap<Object, Layer> mPluginLayers;
|
||||
private int mBackgroundColor;
|
||||
private int mState;
|
||||
private Bitmap mThumbnailBitmap;
|
||||
private boolean mDesktopMode;
|
||||
private boolean mEnteringReaderMode;
|
||||
private Context mAppContext;
|
||||
private final Context mAppContext;
|
||||
private ErrorType mErrorType = ErrorType.NONE;
|
||||
private static final int MAX_HISTORY_LIST_SIZE = 50;
|
||||
private volatile int mLoadProgress;
|
||||
|
@ -65,7 +65,7 @@ public class Tabs implements GeckoEventListener {
|
||||
|
||||
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 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
|
||||
// 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 {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -189,11 +189,11 @@ class TextSelection extends Layer implements GeckoEventListener {
|
||||
}
|
||||
|
||||
private void showActionMode(final JSONArray items) {
|
||||
String itemsString = items.toString();
|
||||
if (itemsString.equals(mCurrentItems)) {
|
||||
return;
|
||||
}
|
||||
mCurrentItems = itemsString;
|
||||
String itemsString = items.toString();
|
||||
if (itemsString.equals(mCurrentItems)) {
|
||||
return;
|
||||
}
|
||||
mCurrentItems = itemsString;
|
||||
|
||||
if (mCallback != null) {
|
||||
mCallback.updateItems(items);
|
||||
@ -214,7 +214,7 @@ class TextSelection extends Layer implements GeckoEventListener {
|
||||
final ActionModeCompat.Presenter presenter = (ActionModeCompat.Presenter) context;
|
||||
presenter.endActionModeCompat();
|
||||
}
|
||||
mCurrentItems = null;
|
||||
mCurrentItems = null;
|
||||
}
|
||||
|
||||
@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
|
||||
// position then. This allows us to lock the handle to wherever the
|
||||
// caret appears.
|
||||
if (!mHandleType.equals(HandleType.MIDDLE)) {
|
||||
if (mHandleType != HandleType.MIDDLE) {
|
||||
setLayoutPosition();
|
||||
}
|
||||
}
|
||||
@ -166,12 +166,13 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener {
|
||||
}
|
||||
|
||||
private float adjustLeftForHandle() {
|
||||
if (mHandleType.equals(HandleType.START))
|
||||
if (mHandleType == HandleType.START) {
|
||||
return mIsRTL ? mShadow : mWidth - mShadow;
|
||||
else if (mHandleType.equals(HandleType.MIDDLE))
|
||||
} else if (mHandleType == HandleType.MIDDLE) {
|
||||
return mWidth / 2;
|
||||
else
|
||||
} else {
|
||||
return mIsRTL ? mWidth - mShadow : mShadow;
|
||||
}
|
||||
}
|
||||
|
||||
private void setLayoutPosition() {
|
||||
|
@ -35,7 +35,7 @@ class AnimatorProxy {
|
||||
public View getView();
|
||||
}
|
||||
|
||||
private AnimatorProxyImpl mImpl;
|
||||
private final AnimatorProxyImpl mImpl;
|
||||
|
||||
private AnimatorProxy(AnimatorProxyImpl impl) {
|
||||
mImpl = impl;
|
||||
@ -146,7 +146,7 @@ class AnimatorProxy {
|
||||
* the NineOldAndroids library under the Apache License 2.0.
|
||||
*/
|
||||
private static class AnimatorProxyPreHC extends Animation implements AnimatorProxyImpl {
|
||||
private WeakReference<View> mViewRef;
|
||||
private final WeakReference<View> mViewRef;
|
||||
|
||||
private final RectF mBefore;
|
||||
private final RectF mAfter;
|
||||
@ -291,7 +291,7 @@ class AnimatorProxy {
|
||||
}
|
||||
|
||||
private static class AnimatorProxyPostHC implements AnimatorProxyImpl {
|
||||
private WeakReference<View> mViewRef;
|
||||
private final WeakReference<View> mViewRef;
|
||||
|
||||
public AnimatorProxyPostHC(View view) {
|
||||
mViewRef = new WeakReference<View>(view);
|
||||
|
@ -32,7 +32,7 @@ public class BounceAnimator extends ValueAnimator {
|
||||
|
||||
private final View mView;
|
||||
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) {
|
||||
mView = view;
|
||||
|
@ -46,11 +46,11 @@ public class PropertyAnimator implements Runnable {
|
||||
public void onPropertyAnimationEnd();
|
||||
}
|
||||
|
||||
private Interpolator mInterpolator;
|
||||
private final Interpolator mInterpolator;
|
||||
private long mStartTime;
|
||||
private long mDuration;
|
||||
private float mDurationReciprocal;
|
||||
private List<ElementHolder> mElementsList;
|
||||
private final long mDuration;
|
||||
private final float mDurationReciprocal;
|
||||
private final List<ElementHolder> mElementsList;
|
||||
private List<PropertyAnimationListener> mListeners;
|
||||
FramePoster mFramePoster;
|
||||
private boolean mUseHardwareLayer;
|
||||
@ -61,7 +61,7 @@ public class PropertyAnimator implements Runnable {
|
||||
|
||||
public PropertyAnimator(long duration, Interpolator interpolator) {
|
||||
mDuration = duration;
|
||||
mDurationReciprocal = 1.0f / (float) mDuration;
|
||||
mDurationReciprocal = 1.0f / mDuration;
|
||||
mInterpolator = interpolator;
|
||||
mElementsList = new ArrayList<ElementHolder>();
|
||||
mFramePoster = FramePoster.create(this);
|
||||
|
@ -7,56 +7,56 @@ package org.mozilla.gecko.animation;
|
||||
import android.view.View;
|
||||
|
||||
public final class ViewHelper {
|
||||
private ViewHelper() {
|
||||
}
|
||||
private ViewHelper() {
|
||||
}
|
||||
|
||||
public static float getTranslationX(View view) {
|
||||
AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getTranslationX();
|
||||
}
|
||||
public static float getTranslationX(View view) {
|
||||
AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getTranslationX();
|
||||
}
|
||||
|
||||
public static void setTranslationX(View view, float translationX) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setTranslationX(translationX);
|
||||
}
|
||||
public static void setTranslationX(View view, float translationX) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setTranslationX(translationX);
|
||||
}
|
||||
|
||||
public static float getTranslationY(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getTranslationY();
|
||||
}
|
||||
public static float getTranslationY(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getTranslationY();
|
||||
}
|
||||
|
||||
public static void setTranslationY(View view, float translationY) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setTranslationY(translationY);
|
||||
}
|
||||
public static void setTranslationY(View view, float translationY) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setTranslationY(translationY);
|
||||
}
|
||||
|
||||
public static float getAlpha(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getAlpha();
|
||||
}
|
||||
public static float getAlpha(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getAlpha();
|
||||
}
|
||||
|
||||
public static void setAlpha(View view, float alpha) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setAlpha(alpha);
|
||||
}
|
||||
public static void setAlpha(View view, float alpha) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setAlpha(alpha);
|
||||
}
|
||||
|
||||
public static int getWidth(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getWidth();
|
||||
}
|
||||
public static int getWidth(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getWidth();
|
||||
}
|
||||
|
||||
public static void setWidth(View view, int width) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setWidth(width);
|
||||
}
|
||||
public static void setWidth(View view, int width) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setWidth(width);
|
||||
}
|
||||
|
||||
public static int getHeight(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getHeight();
|
||||
}
|
||||
public static int getHeight(View view) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
return proxy.getHeight();
|
||||
}
|
||||
|
||||
public static void setHeight(View view, int height) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setHeight(height);
|
||||
}
|
||||
public static void setHeight(View view, int height) {
|
||||
final AnimatorProxy proxy = AnimatorProxy.create(view);
|
||||
proxy.setHeight(height);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#filter substitution
|
||||
//#filter substitution
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
@ -16,11 +16,11 @@ public class GlobalConstants {
|
||||
// If this is an official build, 'default' means 'release'.
|
||||
// Otherwise, it means 'dev'.
|
||||
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;
|
||||
#else
|
||||
//#else
|
||||
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_MSEC = 1000L * @MOZ_BUILD_TIMESTAMP@L;
|
||||
|
@ -50,7 +50,7 @@ public class TelemetryRecorder {
|
||||
|
||||
private File tmpFile;
|
||||
private File destFile;
|
||||
private File cacheDir;
|
||||
private final File cacheDir;
|
||||
|
||||
private OutputStream outputStream;
|
||||
private MessageDigest checksum;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#filter substitution
|
||||
//#filter substitution
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -909,7 +909,7 @@ public class HealthReportDatabaseStorage implements HealthReportStorage {
|
||||
* Cache the lookup from measurement and field specifier to field instance.
|
||||
* 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 void invalidateFieldsCache() {
|
||||
|
@ -17,7 +17,7 @@ import android.content.Context;
|
||||
public class 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>();
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ public abstract class PreferenceFragment extends Fragment implements PreferenceM
|
||||
// The issue is that the Handler references the Fragment; messages targeting
|
||||
// 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.
|
||||
private Handler mHandler = new Handler() {
|
||||
private final Handler mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
@ -299,7 +299,7 @@ public abstract class PreferenceFragment extends Fragment implements PreferenceM
|
||||
mHandler.post(mRequestFocus);
|
||||
}
|
||||
|
||||
private OnKeyListener mListOnKeyListener = new OnKeyListener() {
|
||||
private final OnKeyListener mListOnKeyListener = new OnKeyListener() {
|
||||
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
|
@ -32,7 +32,7 @@ import android.util.Log;
|
||||
|
||||
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
|
||||
@ -52,22 +52,22 @@ public class PreferenceManagerCompat {
|
||||
boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference);
|
||||
}
|
||||
|
||||
static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
|
||||
try {
|
||||
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
|
||||
c.setAccessible(true);
|
||||
return c.newInstance(activity, firstRequestCode);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
static PreferenceManager newInstance(Activity activity, int firstRequestCode) {
|
||||
try {
|
||||
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
|
||||
c.setAccessible(true);
|
||||
return c.newInstance(activity, firstRequestCode);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call constructor PreferenceManager by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Sets the owning preference fragment
|
||||
*/
|
||||
static void setFragment(PreferenceManager manager, PreferenceFragment fragment) {
|
||||
// stub
|
||||
// stub
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,34 +76,34 @@ public class PreferenceManagerCompat {
|
||||
*
|
||||
* @param listener The callback to be invoked.
|
||||
*/
|
||||
static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
|
||||
try {
|
||||
Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
|
||||
onPreferenceTreeClickListener.setAccessible(true);
|
||||
if (listener != null) {
|
||||
Object proxy = Proxy.newProxyInstance(
|
||||
onPreferenceTreeClickListener.getType().getClassLoader(),
|
||||
new Class<?>[] { onPreferenceTreeClickListener.getType() },
|
||||
new InvocationHandler() {
|
||||
@Override
|
||||
static void setOnPreferenceTreeClickListener(PreferenceManager manager, final OnPreferenceTreeClickListener listener) {
|
||||
try {
|
||||
Field onPreferenceTreeClickListener = PreferenceManager.class.getDeclaredField("mOnPreferenceTreeClickListener");
|
||||
onPreferenceTreeClickListener.setAccessible(true);
|
||||
if (listener != null) {
|
||||
Object proxy = Proxy.newProxyInstance(
|
||||
onPreferenceTreeClickListener.getType().getClassLoader(),
|
||||
new Class<?>[] { onPreferenceTreeClickListener.getType() },
|
||||
new InvocationHandler() {
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) {
|
||||
if (method.getName().equals("onPreferenceTreeClick")) {
|
||||
return Boolean.valueOf(listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
onPreferenceTreeClickListener.set(manager, proxy);
|
||||
} else {
|
||||
onPreferenceTreeClickListener.set(manager, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
|
||||
}
|
||||
}
|
||||
if (method.getName().equals("onPreferenceTreeClick")) {
|
||||
return Boolean.valueOf(listener.onPreferenceTreeClick((PreferenceScreen) args[0], (Preference) args[1]));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
onPreferenceTreeClickListener.set(manager, proxy);
|
||||
} else {
|
||||
onPreferenceTreeClickListener.set(manager, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't set PreferenceManager.mOnPreferenceTreeClickListener by reflection", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Inflates a preference hierarchy from the preference hierarchies of
|
||||
* {@link Activity Activities} that match the given {@link Intent}. An
|
||||
* {@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
|
||||
* root).
|
||||
*/
|
||||
static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
|
||||
try {
|
||||
static PreferenceScreen inflateFromIntent(PreferenceManager manager, Intent intent, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, intent, screen);
|
||||
return prefScreen;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromIntent by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Inflates a preference hierarchy from XML. If a preference hierarchy is
|
||||
* given, the new preference hierarchies will be merged in.
|
||||
*
|
||||
@ -142,90 +142,90 @@ public class PreferenceManagerCompat {
|
||||
* root).
|
||||
* @hide
|
||||
*/
|
||||
static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
|
||||
try {
|
||||
static PreferenceScreen inflateFromResource(PreferenceManager manager, Activity activity, int resId, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
PreferenceScreen prefScreen = (PreferenceScreen) m.invoke(manager, activity, resId, screen);
|
||||
return prefScreen;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.inflateFromResource by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns the root of the preference hierarchy managed by this class.
|
||||
*
|
||||
* @return The {@link PreferenceScreen} object that is at the root of the hierarchy.
|
||||
*/
|
||||
static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
|
||||
try {
|
||||
static PreferenceScreen getPreferenceScreen(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen");
|
||||
m.setAccessible(true);
|
||||
return (PreferenceScreen) m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.getPreferenceScreen by reflection", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Called by the {@link PreferenceManager} to dispatch a subactivity result.
|
||||
*/
|
||||
static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
|
||||
try {
|
||||
static void dispatchActivityResult(PreferenceManager manager, int requestCode, int resultCode, Intent data) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityResult", int.class, int.class, Intent.class);
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager, requestCode, resultCode, data);
|
||||
} 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
|
||||
* event.
|
||||
*/
|
||||
static void dispatchActivityStop(PreferenceManager manager) {
|
||||
try {
|
||||
static void dispatchActivityStop(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop");
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager);
|
||||
} 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
|
||||
* event.
|
||||
*/
|
||||
static void dispatchActivityDestroy(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
|
||||
}
|
||||
}
|
||||
static void dispatchActivityDestroy(PreferenceManager manager) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy");
|
||||
m.setAccessible(true);
|
||||
m.invoke(manager);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.dispatchActivityDestroy by reflection", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Sets the root 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.
|
||||
*/
|
||||
static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
return ((Boolean) m.invoke(manager, screen));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
static boolean setPreferences(PreferenceManager manager, PreferenceScreen screen) {
|
||||
try {
|
||||
Method m = PreferenceManager.class.getDeclaredMethod("setPreferences", PreferenceScreen.class);
|
||||
m.setAccessible(true);
|
||||
return ((Boolean) m.invoke(manager, screen));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Couldn't call PreferenceManager.setPreferences by reflection", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ import android.util.Log;
|
||||
public abstract class AbstractTransactionalProvider extends ContentProvider {
|
||||
private static final String LOGTAG = "GeckoTransProvider";
|
||||
|
||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
|
||||
protected abstract SQLiteDatabase getReadableDatabase(Uri uri);
|
||||
protected abstract SQLiteDatabase getWritableDatabase(Uri uri);
|
||||
@ -103,7 +103,8 @@ public abstract class AbstractTransactionalProvider extends ContentProvider {
|
||||
if (isInBatch == null) {
|
||||
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
|
||||
// have in-line in each log call.
|
||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
protected static void trace(String message) {
|
||||
if (logVerbose) {
|
||||
Log.v(LOGTAG, message);
|
||||
|
@ -247,8 +247,8 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
|
||||
|
||||
// Calculate these once, at initialization. isLoggable is too expensive to
|
||||
// have in-line in each log call.
|
||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
protected static void trace(String message) {
|
||||
if (logVerbose) {
|
||||
Log.v(LOGTAG, message);
|
||||
@ -1065,7 +1065,7 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
|
||||
Long additional = values.getAsLong(History.VISITS);
|
||||
|
||||
// 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 = ?",
|
||||
|
@ -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
|
||||
private static int DB_VERSION = 4;
|
||||
private static String DB_FILENAME = "formhistory.sqlite";
|
||||
private static final int DB_VERSION = 4;
|
||||
private static final String DB_FILENAME = "formhistory.sqlite";
|
||||
private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_FORMS";
|
||||
|
||||
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";
|
||||
|
||||
// This should be kept in sync with the db version in mobile/android/modules/HomeProvider.jsm
|
||||
private static int DB_VERSION = 2;
|
||||
private static String DB_FILENAME = "home.sqlite";
|
||||
private static final int DB_VERSION = 2;
|
||||
private static final String DB_FILENAME = "home.sqlite";
|
||||
private static final String TELEMETRY_TAG = "SQLITEBRIDGE_PROVIDER_HOME";
|
||||
|
||||
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
|
||||
// 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) {
|
||||
return;
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ public class PasswordsProvider extends SQLiteBridgeContentProvider {
|
||||
|
||||
private static final UriMatcher URI_MATCHER;
|
||||
|
||||
private static HashMap<String, String> PASSWORDS_PROJECTION_MAP;
|
||||
private static HashMap<String, String> DELETED_PASSWORDS_PROJECTION_MAP;
|
||||
private static final HashMap<String, String> 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
|
||||
private static final int DB_VERSION = 5;
|
||||
@ -176,7 +176,7 @@ public class PasswordsProvider extends SQLiteBridgeContentProvider {
|
||||
String guid = Utils.generateGuid();
|
||||
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.HTTP_REALM, "");
|
||||
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);
|
||||
|
||||
// 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 + 13] = (byte) (singlePayloadOffset >>> 8);
|
||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 14] = (byte) (singlePayloadOffset >>> 16);
|
||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 15] = (byte) (singlePayloadOffset >>> 24);
|
||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 12] = singlePayloadOffset;
|
||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 13] = (singlePayloadOffset >>> 8);
|
||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 14] = (singlePayloadOffset >>> 16);
|
||||
decodeTarget[ICO_HEADER_LENGTH_BYTES + 15] = (singlePayloadOffset >>> 24);
|
||||
|
||||
// Decode the newly-constructed singleton-ICO.
|
||||
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
|
||||
* 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/. */
|
||||
|
@ -74,7 +74,7 @@ abstract public class FxAccountAbstractSetupActivity extends FxAccountAbstractAc
|
||||
|
||||
// By default, any custom server configuration is only shown when the account
|
||||
// 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;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
package org.mozilla.gecko.fxa.login;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashSet;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.mozilla.gecko.background.fxa.FxAccountClient;
|
||||
@ -29,7 +29,7 @@ public class FxAccountLoginStateMachine {
|
||||
protected final LoginStateMachineDelegate delegate;
|
||||
protected final StateLabel desiredStateLabel;
|
||||
// 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) {
|
||||
this.delegate = delegate;
|
||||
|
@ -7,7 +7,9 @@ package org.mozilla.gecko.fxa.sync;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.mozilla.gecko.sync.GlobalSession;
|
||||
@ -34,7 +36,7 @@ public class FxAccountGlobalSession extends GlobalSession {
|
||||
@Override
|
||||
public void prepareStages() {
|
||||
super.prepareStages();
|
||||
HashMap<Stage, GlobalSyncStage> stages = new HashMap<Stage, GlobalSyncStage>();
|
||||
Map<Stage, GlobalSyncStage> stages = new EnumMap<>(Stage.class);
|
||||
stages.putAll(this.stages);
|
||||
stages.put(Stage.ensureClusterURL, new CheckPreconditionsStage());
|
||||
this.stages = Collections.unmodifiableMap(stages);
|
||||
|
@ -53,7 +53,7 @@ abstract class Axis {
|
||||
|
||||
private static float getFloatPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
||||
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) {
|
||||
@ -130,7 +130,7 @@ abstract class Axis {
|
||||
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 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 boolean mScrollingDisabled; /* Whether movement on this axis is locked. */
|
||||
private boolean mDisableSnap; /* Whether overscroll snapping is disabled. */
|
||||
|
@ -18,7 +18,7 @@ public class BufferedCairoImage extends CairoImage {
|
||||
private IntSize mSize;
|
||||
private int mFormat;
|
||||
|
||||
private static String LOGTAG = "GeckoBufferedCairoImage";
|
||||
private static final String LOGTAG = "GeckoBufferedCairoImage";
|
||||
|
||||
/** Creates a buffered Cairo image from a byte buffer. */
|
||||
public BufferedCairoImage(ByteBuffer inBuffer, int inWidth, int inHeight, int inFormat) {
|
||||
|
@ -75,7 +75,7 @@ final class DisplayPortCalculator {
|
||||
PREF_DISPLAYPORT_PB_VELOCITY_THRESHOLD };
|
||||
|
||||
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) {
|
||||
mValues.put(pref, value);
|
||||
@ -124,7 +124,7 @@ final class DisplayPortCalculator {
|
||||
|
||||
private static float getFloatPref(Map<String, Integer> prefs, String prefName, int defaultValue) {
|
||||
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 {
|
||||
@ -746,7 +746,7 @@ final class DisplayPortCalculator {
|
||||
@Override
|
||||
public boolean drawTimeUpdate(long millis, int pixels) {
|
||||
// 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);
|
||||
// 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
|
||||
|
@ -88,7 +88,7 @@ public class GLController {
|
||||
private EGL10 mEGL;
|
||||
private EGLDisplay mEGLDisplay;
|
||||
private EGLConfig mEGLConfig;
|
||||
private EGLPreloadingThread mEGLPreloadingThread;
|
||||
private final EGLPreloadingThread mEGLPreloadingThread;
|
||||
private EGLSurface mEGLSurfaceForCompositor;
|
||||
|
||||
private static final int LOCAL_EGL_OPENGL_ES2_BIT = 4;
|
||||
|
@ -33,7 +33,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
|
||||
private LayerRenderer mLayerRenderer;
|
||||
private boolean mLayerRendererInitialized;
|
||||
|
||||
private Context mContext;
|
||||
private final Context mContext;
|
||||
private IntSize mScreenSize;
|
||||
private IntSize mWindowSize;
|
||||
private DisplayPortMetrics mDisplayPort;
|
||||
@ -59,7 +59,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
|
||||
*/
|
||||
private ImmutableViewportMetrics mFrameMetrics;
|
||||
|
||||
private List<DrawListener> mDrawListeners;
|
||||
private final List<DrawListener> mDrawListeners;
|
||||
|
||||
/* Used as temporaries by syncViewportInfo */
|
||||
private final ViewTransform mCurrentViewTransform;
|
||||
@ -94,7 +94,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
|
||||
|
||||
private final PanZoomController mPanZoomController;
|
||||
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,
|
||||
* 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 String MESSAGE_ZOOM_RECT = "Browser:ZoomToRect";
|
||||
private static String MESSAGE_ZOOM_PAGE = "Browser:ZoomToPageWidth";
|
||||
private static String MESSAGE_TOUCH_LISTENER = "Tab:HasTouchListener";
|
||||
private static final String MESSAGE_ZOOM_RECT = "Browser:ZoomToRect";
|
||||
private static final String MESSAGE_ZOOM_PAGE = "Browser:ZoomToPageWidth";
|
||||
private static final String MESSAGE_TOUCH_LISTENER = "Tab:HasTouchListener";
|
||||
|
||||
// Animation stops if the velocity is below this value when overscrolled or panning.
|
||||
private static final float STOPPED_THRESHOLD = 4.0f;
|
||||
@ -170,7 +170,7 @@ class JavaPanZoomController
|
||||
|
||||
@Override public void prefValue(String pref, int value) {
|
||||
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) {
|
||||
float timeDelta = (float)(time - mLastEventTime);
|
||||
float timeDelta = (time - mLastEventTime);
|
||||
if (FloatUtils.fuzzyEquals(timeDelta, 0)) {
|
||||
// probably a duplicate event, ignore it. using a zero timeDelta will mess
|
||||
// up our velocity
|
||||
@ -902,8 +902,8 @@ class JavaPanZoomController
|
||||
* The viewport metrics that represent the start and end of the bounce-back animation,
|
||||
* respectively.
|
||||
*/
|
||||
private ImmutableViewportMetrics mBounceStartMetrics;
|
||||
private ImmutableViewportMetrics mBounceEndMetrics;
|
||||
private final ImmutableViewportMetrics mBounceStartMetrics;
|
||||
private final ImmutableViewportMetrics mBounceEndMetrics;
|
||||
// How long ago this bounce was started in ns.
|
||||
private long mBounceDuration;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class LayerMarginsAnimator {
|
||||
mPrefObserverId = PrefsHelper.getPref(PREF_SHOW_MARGINS_THRESHOLD, new PrefsHelper.PrefHandlerBase() {
|
||||
@Override
|
||||
public void prefValue(String pref, int value) {
|
||||
SHOW_MARGINS_THRESHOLD = (float)value / 100.0f;
|
||||
SHOW_MARGINS_THRESHOLD = value / 100.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -253,8 +253,8 @@ public class LayerMarginsAnimator {
|
||||
}
|
||||
|
||||
class LayerMarginsAnimationTask extends RenderTask {
|
||||
private float mStartLeft, mStartTop, mStartRight, mStartBottom;
|
||||
private float mTop, mBottom, mLeft, mRight;
|
||||
private final float mStartLeft, mStartTop, mStartRight, mStartBottom;
|
||||
private final float mTop, mBottom, mLeft, mRight;
|
||||
private boolean mContinueAnimation;
|
||||
|
||||
public LayerMarginsAnimationTask(boolean runAfter, ImmutableViewportMetrics metrics,
|
||||
|
@ -69,10 +69,10 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
private long mLastFrameTime;
|
||||
private final CopyOnWriteArrayList<RenderTask> mTasks;
|
||||
|
||||
private CopyOnWriteArrayList<Layer> mExtraLayers = new CopyOnWriteArrayList<Layer>();
|
||||
private final CopyOnWriteArrayList<Layer> mExtraLayers = new CopyOnWriteArrayList<Layer>();
|
||||
|
||||
// Dropped frames display
|
||||
private int[] mFrameTimings;
|
||||
private final int[] mFrameTimings;
|
||||
private int mCurrentFrame, mFrameTimingsSum, mDroppedFrames;
|
||||
|
||||
// Render profiling output
|
||||
@ -417,9 +417,9 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
// The timestamp recording the start of this frame.
|
||||
private long mFrameStartTime;
|
||||
// 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.
|
||||
private RenderContext mPageContext, mScreenContext;
|
||||
private final RenderContext mPageContext, mScreenContext;
|
||||
// Whether a layer was updated.
|
||||
private boolean mUpdated;
|
||||
private final Rect mPageRect;
|
||||
|
@ -50,12 +50,12 @@ import android.widget.FrameLayout;
|
||||
* Note that LayerView is accessed by Robocop via reflection.
|
||||
*/
|
||||
public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener {
|
||||
private static String LOGTAG = "GeckoLayerView";
|
||||
private static final String LOGTAG = "GeckoLayerView";
|
||||
|
||||
private GeckoLayerClient mLayerClient;
|
||||
private PanZoomController mPanZoomController;
|
||||
private LayerMarginsAnimator mMarginsAnimator;
|
||||
private GLController mGLController;
|
||||
private final GLController mGLController;
|
||||
private InputConnectionHandler mInputConnectionHandler;
|
||||
private LayerRenderer mRenderer;
|
||||
/* Must be a PAINT_xxx constant */
|
||||
|
@ -18,10 +18,10 @@ import android.widget.AbsoluteLayout;
|
||||
public class PluginLayer extends TileLayer {
|
||||
private static final String LOGTAG = "PluginLayer";
|
||||
|
||||
private View mView;
|
||||
private final View mView;
|
||||
private SurfaceView mSurfaceView;
|
||||
private PluginLayoutParams mLayoutParams;
|
||||
private AbsoluteLayout mContainer;
|
||||
private final PluginLayoutParams mLayoutParams;
|
||||
private final AbsoluteLayout mContainer;
|
||||
|
||||
private boolean mDestroyed;
|
||||
private boolean mViewVisible;
|
||||
@ -123,7 +123,7 @@ public class PluginLayer extends TileLayer {
|
||||
private static final String LOGTAG = "GeckoApp.PluginLayoutParams";
|
||||
|
||||
private RectF mRect;
|
||||
private int mMaxDimension;
|
||||
private final int mMaxDimension;
|
||||
private float mLastResolution;
|
||||
|
||||
public PluginLayoutParams(RectF rect, int maxDimension) {
|
||||
@ -136,10 +136,10 @@ public class PluginLayer extends TileLayer {
|
||||
private void clampToMaxSize() {
|
||||
if (width > mMaxDimension || height > mMaxDimension) {
|
||||
if (width > height) {
|
||||
height = Math.round(((float)height/(float)width) * mMaxDimension);
|
||||
height = Math.round(((float)height/ width) * mMaxDimension);
|
||||
width = mMaxDimension;
|
||||
} else {
|
||||
width = Math.round(((float)width/(float)height) * mMaxDimension);
|
||||
width = Math.round(((float)width/ height) * mMaxDimension);
|
||||
height = mMaxDimension;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ScrollbarLayer extends TileLayer {
|
||||
private final float[] mCoords;
|
||||
private final RectF mCapRectF;
|
||||
|
||||
private LayerRenderer mRenderer;
|
||||
private final LayerRenderer mRenderer;
|
||||
private int mProgram;
|
||||
private int mPositionHandle;
|
||||
private int mTextureHandle;
|
||||
|
@ -36,12 +36,12 @@ import java.util.Stack;
|
||||
class SimpleScaleGestureDetector {
|
||||
private static final String LOGTAG = "GeckoSimpleScaleGestureDetector";
|
||||
|
||||
private SimpleScaleGestureListener mListener;
|
||||
private final SimpleScaleGestureListener mListener;
|
||||
private long mLastEventTime;
|
||||
private boolean mScaleResult;
|
||||
|
||||
/* 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. */
|
||||
SimpleScaleGestureDetector(SimpleScaleGestureListener listener) {
|
||||
|
@ -20,10 +20,10 @@ import android.util.Log;
|
||||
class SubdocumentScrollHelper implements GeckoEventListener {
|
||||
private static final String LOGTAG = "GeckoSubdocScroll";
|
||||
|
||||
private static String MESSAGE_PANNING_OVERRIDE = "Panning:Override";
|
||||
private static String MESSAGE_CANCEL_OVERRIDE = "Panning:CancelOverride";
|
||||
private static String MESSAGE_SCROLL = "Gesture:Scroll";
|
||||
private static String MESSAGE_SCROLL_ACK = "Gesture:ScrollAck";
|
||||
private static final String MESSAGE_PANNING_OVERRIDE = "Panning:Override";
|
||||
private static final String MESSAGE_CANCEL_OVERRIDE = "Panning:CancelOverride";
|
||||
private static final String MESSAGE_SCROLL = "Gesture:Scroll";
|
||||
private static final String MESSAGE_SCROLL_ACK = "Gesture:ScrollAck";
|
||||
|
||||
private final Handler mUiHandler;
|
||||
private final EventDispatcher mEventDispatcher;
|
||||
|
@ -19,7 +19,7 @@ public class TextureGenerator {
|
||||
|
||||
private static TextureGenerator sSharedInstance;
|
||||
|
||||
private ArrayBlockingQueue<Integer> mTextureIds;
|
||||
private final ArrayBlockingQueue<Integer> mTextureIds;
|
||||
private EGLContext mContext;
|
||||
|
||||
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. */
|
||||
public class TextureReaper {
|
||||
private static TextureReaper sSharedInstance;
|
||||
private ArrayList<Integer> mDeadTextureIDs;
|
||||
private final ArrayList<Integer> mDeadTextureIDs;
|
||||
|
||||
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) {
|
||||
final Search search = new Search(location, engineID);
|
||||
|
@ -104,7 +104,7 @@ class BookmarksListAdapter extends MultiTypeCursorAdapter {
|
||||
|
||||
// mParentStack holds folder info instances (id + title) that allow
|
||||
// us to navigate back up the folder hierarchy.
|
||||
private LinkedList<FolderInfo> mParentStack;
|
||||
private final LinkedList<FolderInfo> mParentStack;
|
||||
|
||||
// Refresh folder listener.
|
||||
private OnRefreshFolderListener mListener;
|
||||
|
@ -441,7 +441,7 @@ public class BrowserSearch extends HomeFragment
|
||||
|
||||
if (searchCount == 0) {
|
||||
// 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
|
||||
|
@ -33,7 +33,7 @@ public class HomeListView extends ListView
|
||||
protected OnUrlOpenListener mUrlOpenListener;
|
||||
|
||||
// Top divider
|
||||
private boolean mShowTopDivider;
|
||||
private final boolean mShowTopDivider;
|
||||
|
||||
// ContextMenuInfo maker
|
||||
private HomeContextMenuInfo.Factory mContextMenuInfoFactory;
|
||||
|
@ -45,7 +45,7 @@ public class HomePager extends ViewPager {
|
||||
private final OnAddPanelListener mAddPanelListener;
|
||||
|
||||
private final HomeConfig mConfig;
|
||||
private ConfigLoaderCallbacks mConfigLoaderCallbacks;
|
||||
private final ConfigLoaderCallbacks mConfigLoaderCallbacks;
|
||||
|
||||
private String mInitialPanelId;
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class PanelGridView extends GridView
|
||||
|
||||
private final ViewConfig viewConfig;
|
||||
private final PanelViewAdapter adapter;
|
||||
private PanelViewItemHandler itemHandler;
|
||||
private final PanelViewItemHandler itemHandler;
|
||||
private OnItemOpenListener itemOpenListener;
|
||||
private HomeContextMenuInfo mContextMenuInfo;
|
||||
private HomeContextMenuInfo.Factory mContextMenuInfoFactory;
|
||||
|
@ -59,7 +59,7 @@ public class PanelInfoManager implements GeckoEventListener {
|
||||
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.
|
||||
private static final SparseArray<RequestCallback> sCallbacks = new SparseArray<RequestCallback>();
|
||||
|
@ -679,7 +679,7 @@ abstract class PanelLayout extends FrameLayout {
|
||||
}
|
||||
|
||||
private class PanelOnItemOpenListener implements OnItemOpenListener {
|
||||
private ViewState mViewState;
|
||||
private final ViewState mViewState;
|
||||
|
||||
public PanelOnItemOpenListener(ViewState viewState) {
|
||||
mViewState = viewState;
|
||||
@ -702,7 +702,7 @@ abstract class PanelLayout extends FrameLayout {
|
||||
}
|
||||
|
||||
private class PanelKeyListener implements View.OnKeyListener {
|
||||
private ViewState mViewState;
|
||||
private final ViewState mViewState;
|
||||
|
||||
public PanelKeyListener(ViewState viewState) {
|
||||
mViewState = viewState;
|
||||
|
@ -206,7 +206,7 @@ class PinSiteDialog extends DialogFragment {
|
||||
}
|
||||
|
||||
private static class SearchAdapter extends CursorAdapter {
|
||||
private LayoutInflater mInflater;
|
||||
private final LayoutInflater mInflater;
|
||||
|
||||
public SearchAdapter(Context context) {
|
||||
super(context, null, 0);
|
||||
|
@ -5,7 +5,9 @@
|
||||
|
||||
package org.mozilla.gecko.home;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.mozilla.gecko.R;
|
||||
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,
|
||||
// because that can cause flickering. Be aware that null is a valid key; it
|
||||
// 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
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
@ -105,8 +105,8 @@ public class TopSitesPanel extends HomeFragment {
|
||||
return new TopSitesPanel();
|
||||
}
|
||||
|
||||
private static boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
private static final boolean logDebug = Log.isLoggable(LOGTAG, Log.DEBUG);
|
||||
private static final boolean logVerbose = Log.isLoggable(LOGTAG, Log.VERBOSE);
|
||||
|
||||
private static void debug(final String message) {
|
||||
if (logDebug) {
|
||||
@ -406,7 +406,7 @@ public class TopSitesPanel extends HomeFragment {
|
||||
// Max number of search results.
|
||||
private static final int SEARCH_LIMIT = 30;
|
||||
private static final String TELEMETRY_HISTOGRAM_LOAD_CURSOR = "FENNEC_TOPSITES_LOADER_TIME_MS";
|
||||
private int mMaxGridEntries;
|
||||
private final int mMaxGridEntries;
|
||||
|
||||
public TopSitesLoader(Context context) {
|
||||
super(context);
|
||||
@ -701,7 +701,7 @@ public class TopSitesPanel extends HomeFragment {
|
||||
@SuppressWarnings("serial")
|
||||
static class ThumbnailsLoader extends AsyncTaskLoader<Map<String, ThumbnailInfo>> {
|
||||
private Map<String, ThumbnailInfo> mThumbnailInfos;
|
||||
private ArrayList<String> mUrls;
|
||||
private final ArrayList<String> mUrls;
|
||||
|
||||
private static final ArrayList<String> COLUMNS = new ArrayList<String>() {{
|
||||
add(TILE_IMAGE_URL_COLUMN);
|
||||
|
@ -32,7 +32,7 @@ public class TopSitesThumbnailView extends ImageView {
|
||||
private final float mStrokeWidth = getResources().getDisplayMetrics().density * 2;
|
||||
|
||||
// Paint for drawing the border.
|
||||
private static Paint sBorderPaint;
|
||||
private static final Paint sBorderPaint;
|
||||
|
||||
// Initializing the static border paint.
|
||||
static {
|
||||
|
@ -88,13 +88,13 @@ public class GeckoMenu extends ListView
|
||||
protected static final int NO_ID = 0;
|
||||
|
||||
// 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.
|
||||
private Map<GeckoMenuItem, View> mPrimaryActionItems;
|
||||
private final Map<GeckoMenuItem, View> mPrimaryActionItems;
|
||||
|
||||
// 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.
|
||||
private Callback mCallback;
|
||||
@ -109,7 +109,7 @@ public class GeckoMenu extends ListView
|
||||
private final ActionItemBarPresenter mSecondaryActionItemBar;
|
||||
|
||||
// Adapter to hold the list of menu items.
|
||||
private MenuItemsAdapter mAdapter;
|
||||
private final MenuItemsAdapter mAdapter;
|
||||
|
||||
// Show/hide icons in the list.
|
||||
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_ACTION_MODE = 1;
|
||||
|
||||
private List<GeckoMenuItem> mItems;
|
||||
private final List<GeckoMenuItem> mItems;
|
||||
|
||||
public MenuItemsAdapter() {
|
||||
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 Drawable mIcon;
|
||||
private Drawable mState;
|
||||
private final Drawable mState;
|
||||
private static Rect sIconBounds;
|
||||
|
||||
private boolean mCheckable;
|
||||
|
@ -12,7 +12,7 @@ class ByteBufferInputStream extends InputStream {
|
||||
|
||||
protected ByteBuffer mBuf;
|
||||
// Reference to a native object holding the data backing the ByteBuffer.
|
||||
private NativeReference mNativeRef;
|
||||
private final NativeReference mNativeRef;
|
||||
|
||||
protected ByteBufferInputStream(ByteBuffer buffer, NativeReference ref) {
|
||||
mBuf = buffer;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#filter substitution
|
||||
//#filter substitution
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@ -226,7 +226,7 @@ public final class GeckoLoader {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_LINKER_EXTRACT
|
||||
//#ifdef MOZ_LINKER_EXTRACT
|
||||
putenv("MOZ_LINKER_EXTRACT=1");
|
||||
// Ensure that the cache dir is world-writable
|
||||
File cacheDir = new File(linkerCache);
|
||||
@ -235,7 +235,7 @@ public final class GeckoLoader {
|
||||
cacheDir.setExecutable(true, false);
|
||||
cacheDir.setReadable(true, false);
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
@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)
|
||||
private SendTabTargetSelectedListener listener;
|
||||
|
||||
private State currentState = LOADING;
|
||||
private final State currentState = LOADING;
|
||||
|
||||
/**
|
||||
* Enum defining the states this view may occupy.
|
||||
|
@ -22,14 +22,14 @@ import android.util.Log;
|
||||
import java.util.ArrayList;
|
||||
|
||||
class AndroidImport implements Runnable {
|
||||
static final private String LOGTAG = "AndroidImport";
|
||||
private Context mContext;
|
||||
private Runnable mOnDoneRunnable;
|
||||
private ArrayList<ContentProviderOperation> mOperations;
|
||||
private ContentResolver mCr;
|
||||
private LocalBrowserDB mDB;
|
||||
private boolean mImportBookmarks;
|
||||
private boolean mImportHistory;
|
||||
private static final String LOGTAG = "AndroidImport";
|
||||
private final Context mContext;
|
||||
private final Runnable mOnDoneRunnable;
|
||||
private final ArrayList<ContentProviderOperation> mOperations;
|
||||
private final ContentResolver mCr;
|
||||
private final LocalBrowserDB mDB;
|
||||
private final boolean mImportBookmarks;
|
||||
private final boolean mImportHistory;
|
||||
|
||||
public AndroidImport(Context context, Runnable onDoneRunnable,
|
||||
boolean doBookmarks, boolean doHistory) {
|
||||
|
@ -16,9 +16,9 @@ import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
|
||||
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 Context mContext;
|
||||
private final Context mContext;
|
||||
|
||||
public AndroidImportPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
@ -11,6 +11,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import android.os.Build;
|
||||
import org.json.JSONObject;
|
||||
import org.mozilla.gecko.AppConstants;
|
||||
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.healthreport.HealthReportConstants;
|
||||
import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
|
||||
import org.mozilla.gecko.updater.UpdateServiceHelper;
|
||||
import org.mozilla.gecko.util.GeckoEventListener;
|
||||
import org.mozilla.gecko.util.HardwareUtils;
|
||||
import org.mozilla.gecko.util.ThreadUtils;
|
||||
@ -325,7 +327,7 @@ OnSharedPreferenceChangeListener
|
||||
// all) in the action bar.
|
||||
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.
|
||||
// If we try rejigging fragments, we'll crash, so don't
|
||||
// enable locale switching at all.
|
||||
@ -1028,7 +1030,7 @@ OnSharedPreferenceChangeListener
|
||||
}
|
||||
|
||||
@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());
|
||||
}};
|
||||
|
||||
@ -1056,17 +1058,17 @@ OnSharedPreferenceChangeListener
|
||||
if (PREFS_MENU_CHAR_ENCODING.equals(prefName)) {
|
||||
setCharEncodingState(((String) newValue).equals("true"));
|
||||
} 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)) {
|
||||
// The healthreport pref only lives in Android, so we do not persist
|
||||
// to Gecko, but we do broadcast intent to the health report
|
||||
// background uploader service, which will start or stop the
|
||||
// repeated background upload attempts.
|
||||
broadcastHealthReportUploadPref(this, ((Boolean) newValue).booleanValue());
|
||||
broadcastHealthReportUploadPref(this, (Boolean) newValue);
|
||||
} 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.
|
||||
newValue = ((Boolean) newValue) ? 1 : 0;
|
||||
newValue = (Boolean) newValue ? 1 : 0;
|
||||
} else if (handlers.containsKey(prefName)) {
|
||||
PrefHandler handler = handlers.get(prefName);
|
||||
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