Closed Bug 1048525 Opened 10 years ago Closed 10 years ago

Use SuggestClient from MC.

Categories

(Firefox for Android Graveyard :: Search Activity, defect, P1)

All
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: eedens, Assigned: eedens)

References

Details

Attachments

(1 file, 6 obsolete files)

We should remove the temporarily-bundled version of SuggestClient in favor of the SuggestClient in org.mozilla.gecko.home.
Priority: -- → P1
Attached patch bug-1048525-fix.patch (obsolete) — Splinter Review
Assignee: nobody → eric.edens
Status: NEW → ASSIGNED
Attachment #8471166 - Flags: review?(margaret.leibovic)
Comment on attachment 8471166 [details] [diff] [review] bug-1048525-fix.patch Review of attachment 8471166 [details] [diff] [review]: ----------------------------------------------------------------- Nice.
Attachment #8471166 - Flags: review?(margaret.leibovic) → review+
Backed out at eedens's request, because of crash when Gecko isn't running. https://hg.mozilla.org/integration/fx-team/rev/07f040c1f11c
Revert in Github: https://github.com/mozilla/fennec-search/commit/6c7d5ba014cb9811e0f1b83758e2ca91d8487dfb The root issue was the static init in SuggestClient [1]. This init works when gecko is running, but fails with a NPE otherwise. [1] https://lxr.mozilla.org/mozilla-central/source/mobile/android/base/home/SuggestClient.java#31
bnicholson, what do you think we should do about this? I think we should just have a fallback user agent string. I feel like the user agent isn't too important in this case, because it's not like we're getting web content. Right now we're just sending an empty string with search activity requests... I wonder if that's an adequate solution.
Flags: needinfo?(bnicholson)
Alternatively, we can inject the UA through the constructor. Then, for the search activity, we can use any UA -- blank, the webview's, something else ...
Assuming we plan to eventually replace WebView with GeckoView, I would just bypass GeckoInterface for now with a comment: // This should go through GeckoInterface to get the UA, but the search activity // doesn't use a GeckoView yet. Until it does, get the UA directly. String USER_AGENT = HardwareUtils.isTablet() ? AppConstants.USER_AGENT_FENNEC_TABLET : AppConstants.USER_AGENT_FENNEC_MOBILE;
Flags: needinfo?(bnicholson)
Attached patch bug-1048525-fix.v2.patch (obsolete) — Splinter Review
Attachment #8471166 - Attachment is obsolete: true
Attachment #8471800 - Flags: review?(margaret.leibovic)
Comment on attachment 8471800 [details] [diff] [review] bug-1048525-fix.v2.patch Review of attachment 8471800 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/base/home/SuggestClient.java @@ +32,5 @@ > private static final String LOGTAG = "GeckoSuggestClient"; > + > + // This should go through GeckoInterface to get the UA, but the search activity > + // doesn't use a GeckoView yet. Until it does, get the UA directly. > + String USER_AGENT = HardwareUtils.isTablet() ? AppConstants.USER_AGENT_FENNEC_TABLET : This should be 'private static final'.
Attached patch bug-1048525-fix.v3.patch (obsolete) — Splinter Review
bnicholson, good catch! Your code snippet was so nice I just copied and pasted it. :)
Attachment #8471800 - Attachment is obsolete: true
Attachment #8471800 - Flags: review?(margaret.leibovic)
Attachment #8471812 - Flags: review?(margaret.leibovic)
Attachment #8471812 - Flags: review?(bnicholson)
Attached patch bug-1048525-fix.v4.patch (obsolete) — Splinter Review
Fixed code tabbing.
Attachment #8471812 - Attachment is obsolete: true
Attachment #8471812 - Flags: review?(margaret.leibovic)
Attachment #8471812 - Flags: review?(bnicholson)
Attachment #8471814 - Flags: review?(margaret.leibovic)
Attachment #8471814 - Flags: review?(bnicholson)
Comment on attachment 8471814 [details] [diff] [review] bug-1048525-fix.v4.patch Review of attachment 8471814 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me, though we should probably move SuggestClient out of the home package since it's more general-purpose.
Attachment #8471814 - Flags: review?(bnicholson) → review+
Attachment #8471814 - Flags: review?(margaret.leibovic) → review+
(In reply to Brian Nicholson (:bnicholson) from comment #14) > Comment on attachment 8471814 [details] [diff] [review] > bug-1048525-fix.v4.patch > > Review of attachment 8471814 [details] [diff] [review]: > ----------------------------------------------------------------- > > Looks good to me, though we should probably move SuggestClient out of the > home package since it's more general-purpose. Yeah, I've had the same thought. Do you think we should just move it to /base? Or /util maybe?
(In reply to :Margaret Leibovic from comment #15) > Yeah, I've had the same thought. Do you think we should just move it to > /base? Or /util maybe? I'd vote /base since since it seems more like its own component than a helper util, but I don't have strong opinions either way.
Attached patch bug-1048525-fix.v5.patch (obsolete) — Splinter Review
Changed location of SuggestClient to /base. I'll post a try build when the tree is open. PR: https://github.com/mozilla/fennec-search/pull/57/files
Attachment #8471814 - Attachment is obsolete: true
Attachment #8472649 - Flags: review?(margaret.leibovic)
Attachment #8472649 - Flags: review?(bnicholson)
Comment on attachment 8472649 [details] [diff] [review] bug-1048525-fix.v5.patch Review of attachment 8472649 [details] [diff] [review]: ----------------------------------------------------------------- Looks like you ended up copying the old SuggestClient without your changes!
Attachment #8472649 - Flags: review?(bnicholson) → review-
Attachment #8472649 - Flags: review?(margaret.leibovic)
Attached patch bug-1048525-fix.v6.patch (obsolete) — Splinter Review
> Looks like you ended up copying the old SuggestClient without your changes! Oh hell. Thanks for catching that! Here's a fresh patch that includes the changes. Try: https://tbpl.mozilla.org/?tree=Try&rev=35790a387068 PR: https://github.com/mozilla/fennec-search/pull/57/files
Attachment #8472649 - Attachment is obsolete: true
Attachment #8473079 - Flags: review?(margaret.leibovic)
Attachment #8473079 - Flags: review?(bnicholson)
Comment on attachment 8473079 [details] [diff] [review] bug-1048525-fix.v6.patch Review of attachment 8473079 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8473079 - Flags: review?(bnicholson) → review+
Comment on attachment 8473079 [details] [diff] [review] bug-1048525-fix.v6.patch Review of attachment 8473079 [details] [diff] [review]: ----------------------------------------------------------------- The try run looks green, so I can this for you.
Attachment #8473079 - Flags: review?(margaret.leibovic) → review+
Rebased for landing
Attachment #8473079 - Attachment is obsolete: true
Attachment #8473382 - Flags: review?(margaret.leibovic)
Attachment #8473382 - Flags: review?(margaret.leibovic) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: