Closed Bug 762068 Opened 9 years ago Closed 9 years ago

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

Categories

(Firefox for Android Graveyard :: General, defect)

16 Branch
ARM
Android
defect
Not set
normal

Tracking

(firefox16 verified)

VERIFIED FIXED
Firefox 16
Tracking Status
firefox16 --- verified

People

(Reporter: aaronmt, Assigned: bnicholson)

References

Details

(Keywords: reproducible)

Attachments

(3 files)

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
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)
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)
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)
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+
Target Milestone: --- → Firefox 16
Status: RESOLVED → VERIFIED
tracking-fennec: ? → ---
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.