Move filepicker and activity-result code out of GeckoApp so it survives activity destruction

RESOLVED FIXED in Firefox 15

Status

()

Firefox for Android
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: kats, Assigned: kats)

Tracking

Trunk
Firefox 16
All
Android
Points:
---

Firefox Tracking Flags

(firefox15 fixed)

Details

Attachments

(3 attachments, 3 obsolete attachments)

Created attachment 641559 [details] [diff] [review]
Part 1 - Move GeckoApp inner classes out into their own files

I started doing this but now my brain is rotting so I don't know if what I'm doing is helping at all. Putting my patches here for now.
Created attachment 641560 [details] [diff] [review]
Part 2 - Create an ActivityHandlerHelper class
Created attachment 641561 [details] [diff] [review]
Part 3 - Move ActivityHandlerHelper and PromptService to be owned by GeckoAppShell so it survives activity destruction
Blocks: 769269
Summary: Move filepicker and activity-result code out of GeckoApp → Move filepicker and activity-result code out of GeckoApp so it survives activity destruction
Created attachment 641909 [details] [diff] [review]
(1/3) Move GeckoApp inner classes out into their own files
Attachment #641559 - Attachment is obsolete: true
Attachment #641909 - Flags: review?(mark.finkle)
Created attachment 641910 [details] [diff] [review]
(2/3) Create an ActivityHandlerHelper class
Attachment #641560 - Attachment is obsolete: true
Attachment #641910 - Flags: review?(mark.finkle)
Created attachment 641911 [details] [diff] [review]
(3/3) Move ActivityHandlerHelper over to GeckoAppShell so it survives activity destruction
Attachment #641561 - Attachment is obsolete: true
Attachment #641911 - Flags: review?(mark.finkle)
In part 1, when I moved the classes out, there were some minor changes to the code. I'm listing them here for ease of reviewing:

- AwesomebarResultHandler does GeckoApp.mAppContext.loadRequest(...) instead of loadRequest(...)
- Some of the extracted classes take a SynchronousQueue<String> in the constructor and store it locally since they don't have access to the one in GeckoApp directly anymore
- I moved GeckoApp.mImageFilePath to be CameraImageResultHandler.sImageName and updated usage of it accordingly.

In part 2 when I moved the functions out I modified:

- The showFilePicker functions take an "Activity parentActivity" parameter since I needed something on which to call startActivityForResult.
- A lot of the extracted functions now take a Context parameter since there are a couple of functions that need to be called on it (getString in getFilePickerTitle, getPackageManager in addIntentActivitiesToList).
- Renamed AddFilePickingActivities to addFilePickingActivities (case fixup)
Assignee: nobody → bugmail.mozilla
Comment on attachment 641909 [details] [diff] [review]
(1/3) Move GeckoApp inner classes out into their own files

Looks a good, clean port. Nice work.
Attachment #641909 - Flags: review?(mark.finkle) → review+
Attachment #641910 - Flags: review?(mark.finkle) → review+
Attachment #641911 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/f50d3885980b
https://hg.mozilla.org/integration/mozilla-inbound/rev/e9ba73beb18c
https://hg.mozilla.org/integration/mozilla-inbound/rev/030cc6de7258
https://hg.mozilla.org/mozilla-central/rev/f50d3885980b
https://hg.mozilla.org/mozilla-central/rev/e9ba73beb18c
https://hg.mozilla.org/mozilla-central/rev/030cc6de7258
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 16
Landed in http://hg.mozilla.org/releases/mozilla-beta/rev/b2487714085b
status-firefox15: --- → fixed
You need to log in before you can comment on or make changes to this bug.