Bug 1235902 - (Part 2) Update feedback settings item to read URL from gecko prefs. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 31 Dec 2015 16:20:27 -0500
changeset 320157 deaf711a7bc8a8cb604666b0e4e7a91edc90018e
parent 320156 f2c54cd55ed5ee6baecfe6b195292ad682167f5f
child 320158 37795691ec97a85fdb85f2d78d9c13875c0ccbe8
push id9143
push userahunt@mozilla.com
push dateFri, 08 Jan 2016 21:30:53 +0000
reviewersmfinkle
bugs1235902
milestone46.0a1
Bug 1235902 - (Part 2) Update feedback settings item to read URL from gecko prefs. r=mfinkle
mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
mobile/android/base/resources/xml/preferences_vendor.xml
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -128,28 +128,25 @@ OnSharedPreferenceChangeListener
     private static final String PREFS_HEALTHREPORT_LINK = NON_PREF_PREFIX + "healthreport.link";
     private static final String PREFS_DEVTOOLS_REMOTE_USB_ENABLED = "devtools.remote.usb.enabled";
     private static final String PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED = "devtools.remote.wifi.enabled";
     private static final String PREFS_DEVTOOLS_REMOTE_LINK = NON_PREF_PREFIX + "remote_debugging.link";
     private static final String PREFS_TRACKING_PROTECTION = "privacy.trackingprotection.state";
     private static final String PREFS_TRACKING_PROTECTION_PB = "privacy.trackingprotection.pbmode.enabled";
     public static final String PREFS_VOICE_INPUT_ENABLED = NON_PREF_PREFIX + "voice_input_enabled";
     public static final String PREFS_QRCODE_ENABLED = NON_PREF_PREFIX + "qrcode_enabled";
-    private static final String PREFS_ADVANCED = NON_PREF_PREFIX + "advanced.enabled";
-    private static final String PREFS_ACCESSIBILITY = NON_PREF_PREFIX + "accessibility.enabled";
-    private static final String PREFS_CUSTOMIZE_HOME = NON_PREF_PREFIX + "customize_home";
     private static final String PREFS_TRACKING_PROTECTION_PRIVATE_BROWSING = "privacy.trackingprotection.pbmode.enabled";
     private static final String PREFS_TRACKING_PROTECTION_LEARN_MORE = NON_PREF_PREFIX + "trackingprotection.learn_more";
     private static final String PREFS_CLEAR_PRIVATE_DATA = NON_PREF_PREFIX + "privacy.clear";
     private static final String PREFS_CLEAR_PRIVATE_DATA_EXIT = NON_PREF_PREFIX + "history.clear_on_exit";
     private static final String PREFS_SCREEN_ADVANCED = NON_PREF_PREFIX + "advanced_screen";
-    private static final String PREFS_CATEGORY_HOMEPAGE = NON_PREF_PREFIX + "category_homepage";
     public static final String PREFS_HOMEPAGE = NON_PREF_PREFIX + "homepage";
     public static final String PREFS_HISTORY_SAVED_SEARCH = NON_PREF_PREFIX + "search.search_history.enabled";
     private static final String PREFS_FAQ_LINK = NON_PREF_PREFIX + "faq.link";
+    private static final String PREFS_FEEDBACK_LINK = NON_PREF_PREFIX + "feedback.link";
 
     private static final String ACTION_STUMBLER_UPLOAD_PREF = AppConstants.ANDROID_PACKAGE_NAME + ".STUMBLER_PREF";
 
 
     // This isn't a Gecko pref, even if it looks like one.
     private static final String PREFS_BROWSER_LOCALE = "locale";
 
     public static final String PREFS_RESTORE_SESSION = NON_PREF_PREFIX + "restoreSession3";
@@ -847,16 +844,28 @@ OnSharedPreferenceChangeListener
                 } else if (PREFS_FAQ_LINK.equals(key)) {
                     // 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);
+                                }
+                            });
+                        }
+                    });
                 }
 
                 // Some Preference UI elements are not actually preferences,
                 // but they require a key to work correctly. For example,
                 // "Clear private data" requires a key for its state to be
                 // saved when the orientation changes. It uses the
                 // "android.not_a_preference.privacy.clear" key - which doesn't
                 // exist in Gecko - to satisfy this requirement.
--- a/mobile/android/base/resources/xml/preferences_vendor.xml
+++ b/mobile/android/base/resources/xml/preferences_vendor.xml
@@ -14,12 +14,11 @@
                                                   url="about:" />
 
     <org.mozilla.gecko.preferences.LinkPreference android:key="android.not_a_preference.faq.link"
                                                   android:title="@string/pref_vendor_faqs"
                                                   android:persistent="false"/>
 
     <org.mozilla.gecko.preferences.LinkPreference android:key="android.not_a_preference.feedback.link"
                                                   android:title="@string/pref_vendor_feedback"
-                                                  android:persistent="false"
-                                                  url="about:feedback" />
+                                                  android:persistent="false"/>
 
 </PreferenceScreen>