Closed Bug 1324427 Opened 5 years ago Closed 4 years ago
Switchboard: Set user agent and proxy
Bug 1324427 - Switchboard: Set user agent and proxy; Using proxy and setting user agent from ProxySelector and BaseAction classes respectively.
59 bytes, text/x-review-board-request
I just saw that our Switchboard code does not set a user agent and does not use a proxy if one is set: https://dxr.mozilla.org/mozilla-central/source/mobile/android/thirdparty/com/keepsafe/switchboard/SwitchBoard.java#354 There's a helper method to create a HttpUrlConnection with proxy settings here: https://dxr.mozilla.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java#32 And you can set the user agent like we do here: https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/dlc/BaseAction.java#154-156
If you are new then to start, set up a build environment - you can see the instructions here: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build Fix the issue mentioned in comment 0 and then you'll need to upload a patch - see: http://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview/commits.html If you need any help, you can reply to this bug, or feel free to message me on IRC - my nick is "sebastian" and you can find me and other helpful folks in #mobile. If you need IRC setup instructions, see https://wiki.mozilla.org/IRC
I would like to work on this issue.
Okay! We assign bugs after a first patch has been uploaded. Let me know here (or in #mobile on IRC) if you need any help.
Since I am new to development,I would like to know if I could build up the environment on Ubuntu.
Yes, this should work.
Mr. Sebastian, I would like to work on this issue.
Sebastian, if I try to use the code from
Sorry, looks like I submitted my comment by mistake earlier.I'm still trying to get used to the keyboard on my new laptop. Anyway, if I try to use the code from HardwareUtils/ProxySelector/AppConstants as suggested in the description above, it will require me to add a dependency on those modules since the SwitchBoard class is in the thirdparty module. Is it OK to add the dependency?
Thanks for bringing this up! I filed bug 1328837 to move the Switchboard code into our module/package. It has been heavily modified so that it's not really the original third-party code anymore.
I've made the necessary changes and pushed for review.
Assignee: nobody → swaroop.rao
Status: NEW → ASSIGNED
Comment on attachment 8832667 [details] Bug 1324427 - Switchboard: Set user agent and proxy; Using proxy and setting user agent from ProxySelector and BaseAction classes respectively. https://reviewboard.mozilla.org/r/108832/#review110250 LGTM. Thanks! Try-Run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1acf37fc0bb8
Attachment #8832667 - Flags: review?(s.kaspari) → review+
try run has passed. I have set the checkin-needed flag.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/bcabeb8c81a2 Switchboard: Set user agent and proxy; Using proxy and setting user agent from ProxySelector and BaseAction classes respectively. r=sebastian
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.