Bug 1239513 - Replace about:feedback with page hosted on input.mozilla.org. r=sebastian
MozReview-Commit-ID: K4AmE1zNtBI
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -480,17 +480,18 @@ pref("plugin.default.state", 1);
// The breakpad report server to link to in about:crashes
pref("breakpad.reportURL", "https://crash-stats.mozilla.com/report/index/");
pref("app.support.baseURL", "http://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/");
// Used to submit data to input from about:feedback
pref("app.feedback.postURL", "https://input.mozilla.org/api/v1/feedback/");
// URL for feedback page
-pref("app.feedbackURL", "about:feedback");
+// This should be kept in sync with the "feedback_link" string defined in strings.xml.in
+pref("app.feedbackURL", "https://input.mozilla.org/feedback/android/%VERSION%/%CHANNEL%/?utm_source=feedback-prompt");
pref("app.privacyURL", "https://www.mozilla.org/privacy/firefox/");
pref("app.creditsURL", "http://www.mozilla.org/credits/");
pref("app.channelURL", "http://www.mozilla.org/%LOCALE%/firefox/channel/");
#if MOZ_UPDATE_CHANNEL == aurora
pref("app.releaseNotesURL", "http://www.mozilla.com/%LOCALE%/mobile/%VERSION%/auroranotes/");
#elif MOZ_UPDATE_CHANNEL == beta
pref("app.releaseNotesURL", "http://www.mozilla.com/%LOCALE%/mobile/%VERSION%beta/releasenotes/");
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -890,27 +890,20 @@ OnSharedPreferenceChangeListener
// Format the FAQ link
final String VERSION = AppConstants.MOZ_APP_VERSION;
final String OS = AppConstants.OS_TARGET;
final String LOCALE = Locales.getLanguageTag(Locale.getDefault());
final String url = getResources().getString(R.string.faq_link, VERSION, OS, LOCALE);
((LinkPreference) pref).setUrl(url);
} else if (PREFS_FEEDBACK_LINK.equals(key)) {
- PrefsHelper.getPref("app.feedbackURL", new PrefsHelper.PrefHandlerBase() {
- @Override
- public void prefValue(String prefName, final String value) {
- ThreadUtils.postToUiThread(new Runnable() {
- @Override
- public void run() {
- ((LinkPreference) pref).setUrl(value);
- }
- });
- }
- });
+ // Format the feedback link. We can't easily use this "app.feedbackURL"
+ // Gecko preference because the URL must be formatted.
+ final String url = getResources().getString(R.string.feedback_link, AppConstants.MOZ_APP_VERSION, AppConstants.MOZ_UPDATE_CHANNEL);
+ ((LinkPreference) pref).setUrl(url);
} else if (PREFS_DYNAMIC_TOOLBAR.equals(key)) {
if (DynamicToolbar.isForceDisabled()) {
preferences.removePreference(pref);
i--;
continue;
}
}
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -82,16 +82,20 @@
<string name="launcher_shortcuts_title">&launcher_shortcuts_title;</string>
<string name="launcher_shortcuts_empty">&launcher_shortcuts_empty;</string>
<string name="choose_file">&choose_file;</string>
<string name="url_bar_default_text">&url_bar_default_text2;</string>
+ <!-- https://input.mozilla.org/feedback/android/%VERSION%/%CHANNEL%/?utm_source=feedback-settings
+ This should be kept in sync with the "app.feedbackURL" pref defined in mobile.js -->
+ <string name="feedback_link">https://input.mozilla.org/feedback/android/&formatS1;/&formatS2;/?utm_source=feedback-settings</string>
+
<!-- https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/faq -->
<string name="faq_link">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/faq</string>
<!-- https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/ -->
<string name="help_link">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/</string>
<string name="help_menu">&help_menu;</string>
<string name="quit">&quit;</string>
--- a/mobile/android/chrome/content/Feedback.js
+++ b/mobile/android/chrome/content/Feedback.js
@@ -2,31 +2,31 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var Feedback = {
get _feedbackURL() {
delete this._feedbackURL;
- return this._feedbackURL = Services.prefs.getCharPref("app.feedbackURL");
+ return this._feedbackURL = Services.urlFormatter.formatURLPref("app.feedbackURL");
},
observe: function(aMessage, aTopic, aData) {
if (aTopic !== "Feedback:Show") {
return;
}
// Don't prompt for feedback in distribution builds.
try {
Services.prefs.getCharPref("distribution.id");
return;
} catch (e) {}
- let url = this._feedbackURL + "?source=feedback-prompt";
+ let url = this._feedbackURL;
let browser = BrowserApp.selectOrAddTab(url, { parentId: BrowserApp.selectedTab.id }).browser;
browser.addEventListener("FeedbackClose", this, false, true);
browser.addEventListener("FeedbackMaybeLater", this, false, true);
browser.addEventListener("FeedbackOpenPlay", this, false, true);
},
handleEvent: function(event) {
if (!this._isAllowed(event.target)) {