Unable to disable search suggestions - java.net.MalformedURLException: Protocol not found: null

VERIFIED FIXED in Firefox 16

Status

()

VERIFIED FIXED
7 years ago
5 years ago

People

(Reporter: aaronmt, Assigned: bnicholson)

Tracking

({reproducible})

16 Branch
Firefox 16
ARM
Android
reproducible
Points:
---

Firefox Tracking Flags

(firefox16 verified)

Details

Attachments

(3 attachments)

(Reporter)

Description

7 years ago
W/GeckoSuggestClient( 2432): java.net.MalformedURLException: Protocol not found: null
W/GeckoSuggestClient( 2432): 	at java.net.URL.<init>(URL.java:178)
W/GeckoSuggestClient( 2432): 	at java.net.URL.<init>(URL.java:127)
W/GeckoSuggestClient( 2432): 	at org.mozilla.gecko.SuggestClient.query(SuggestClient.java:72)
W/GeckoSuggestClient( 2432): 	at org.mozilla.gecko.AwesomeBar$4$1.doInBackground(AwesomeBar.java:193)
W/GeckoSuggestClient( 2432): 	at org.mozilla.gecko.AwesomeBar$4$1.doInBackground(AwesomeBar.java:191)
W/GeckoSuggestClient( 2432): 	at android.os.AsyncTask$2.call(AsyncTask.java:264)
W/GeckoSuggestClient( 2432): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/GeckoSuggestClient( 2432): 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/GeckoSuggestClient( 2432): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
W/GeckoSuggestClient( 2432): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
W/GeckoSuggestClient( 2432): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
W/GeckoSuggestClient( 2432): 	at java.lang.Thread.run(Thread.java:856)

STR: Disable 'Search Suggestions' in settings and then proceed to due a search

--
Tested via
Asus Transformer Prime TF201
20120606065339
http://hg.mozilla.org/integration/mozilla-inbound/rev/7d817c805af5
(Assignee)

Comment 1

7 years ago
Created attachment 632065 [details] [diff] [review]
Part 1: Don't save suggest engine to shared prefs

This disables the suggest engine from being saved to shared prefs. I had added this to allow search suggestions to work immediately at startup before Gecko is loaded, but I don't think it's worth the extra cruft to support the few seconds where this matters. Plus, the icon doesn't appear, so it looks bad.
Assignee: nobody → bnicholson
Attachment #632065 - Flags: review?(mark.finkle)
(Assignee)

Comment 2

7 years ago
Created attachment 632082 [details] [diff] [review]
Part 2: Remove static search engine data

For the same reasons, this also removes the static search engine data. This means that we must now wait for a response from Gecko every time we show the AwesomeScreen before we show suggestions, but this hasn't noticeably affected suggestions from my testing.
Attachment #632082 - Flags: review?(mark.finkle)
(Assignee)

Comment 3

7 years ago
Created attachment 632084 [details] [diff] [review]
Part 3: Replace optString() with null checks

This is what actually caused the bug here. Apparently, optString() still returns the string "null" if the JSON value is null.
Attachment #632084 - Flags: review?(mark.finkle)
(Assignee)

Comment 4

7 years ago
This is supposed to be in the 2nd patch, not the 3rd:

+                if (suggestTemplate != null)
+                    mSuggestClient = new SuggestClient(GeckoApp.mAppContext, suggestTemplate, SUGGESTION_TIMEOUT, SUGGESTION_MAX);

Just made this change locally.
Comment on attachment 632065 [details] [diff] [review]
Part 1: Don't save suggest engine to shared prefs

I agree that this is probably overkill
Attachment #632065 - Flags: review?(mark.finkle) → review+
Comment on attachment 632082 [details] [diff] [review]
Part 2: Remove static search engine data

Yeah, make sure the mSuggestClient is created in this patch
Attachment #632082 - Flags: review?(mark.finkle) → review+
Comment on attachment 632084 [details] [diff] [review]
Part 3: Replace optString() with null checks

Ah, so optString only returns an empty string if the field does not exist.
Attachment #632084 - Flags: review?(mark.finkle) → review+
(Assignee)

Updated

7 years ago
Target Milestone: --- → Firefox 16

Updated

7 years ago
status-firefox16: affected → fixed
(Reporter)

Updated

7 years ago
Status: RESOLVED → VERIFIED
status-firefox16: fixed → verified
tracking-fennec: ? → ---
You need to log in before you can comment on or make changes to this bug.