Closed
Bug 1171213
Opened 9 years ago
Closed 9 years ago
Don't use Context.MODE_MULTI_PROCESS in Allocator (deprecated in Android M)
Categories
(Firefox for Android Graveyard :: Web Apps (PWAs), defect)
Tracking
(firefox44 fixed)
RESOLVED
FIXED
Firefox 44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: amoghbl1, Assigned: sebastian)
References
Details
Attachments
(3 files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mfinkle
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0
Build ID: 20150518070114
Steps to reproduce:
Build on the current mozilla-central repo with the new sdk Android SDK MNC
Actual results:
Build failure
Seems to be used at two places, mobile/android/base/webapp/Allocator.java and mobile/android/stumbler/java/org/mozilla/mozstumbler/service/Prefs.java .
As per the new docs:
"This constant is deprecated. MODE_MULTI_PROCESS does not work reliably in some versions of Android, and furthermore does not provide any mechanism for reconciling concurrent modifications across processes. Applications should not attempt to use it. Instead, they should use an explicit cross-process data management approach such as ContentProvider."
Updated•9 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•9 years ago
|
Component: General → Web Apps
OS: Unspecified → Android
Hardware: Unspecified → All
Summary: MODE_MULTI_PROCESS in Context has been deprecated with Android M SDK (MNC) → Don't use Context.MODE_MULTI_PROCESS in Allocator (deprecated in Android M)
Assignee | ||
Updated•9 years ago
|
Blocks: build-android-m
Assignee | ||
Comment 2•9 years ago
|
||
Garvan: Do you have a good idea how to get rid of the deprecated Context.MODE_MULTI_PROCESS flag? I assume it is used to flip the settings in the fennec process but read them from the stumbler process? Google's depcreation comment mentions ContentProviders as an alternative but this seems to be over-engineered for some simple preferences. Maybe keeping the preference in one process and adding IPC to read the values from another process is the way to go?
Flags: needinfo?(gkeeley)
Thanks for the ping, IIRC that was there as a remnant of an older process model for stumbler (Mozilla Stumbler the app actually) that is no longer used. Will look now.
Flags: needinfo?(gkeeley)
An older app design of the stumbler required this, it is no longer needed.
There is a robocop test that toggles the pref to start stumbling, which in turn toggles the internal pref. Not sure which rc* it is but they are all green.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8ae4f0b6aad6
And of course, I am manually testing it.
Attachment #8646972 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8646972 [details] [diff] [review]
bug1171213.diff
Review of attachment 8646972 [details] [diff] [review]:
-----------------------------------------------------------------
Awesome! Thank you!
Now only org.mozilla.gecko.webapp.Allocator is left here. But this is not part of Stumbler. :)
Attachment #8646972 -
Flags: review?(s.kaspari) → review+
Assignee | ||
Comment 6•9 years ago
|
||
leave-open: Allocator will probably be fixed in a different patch some other day.
Keywords: leave-open
Assignee | ||
Comment 9•9 years ago
|
||
NI: Anyone of you know how we could work around that last Context.MODE_MULTI_PROCESS usage?
https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/webapp/Allocator.java?offset=100#50
The docs say:
"This constant was deprecated in API level 23. MODE_MULTI_PROCESS does not work reliably in some versions of Android, and furthermore does not provide any mechanism for reconciling concurrent modifications across processes. Applications should not attempt to use it. Instead, they should use an explicit cross-process data management approach such as ContentProvider."
But I don't think we want to use a ContentProvider here..
Flags: needinfo?(nalexander)
Flags: needinfo?(mark.finkle)
Comment 10•9 years ago
|
||
To radiate information here:
Allocator is used in a cross-process manner. This pattern is actually a good candidate for a ContentProvider, possibly backed by SharedPrefs accessed by the single ContentProvider process.
We could use local broadcasts to a service; or we could expose an AIDL interface to the same service. At the end of the day, I think the ContentProvider is easiest.
However, it's my belief that this functionality will be killed. mfinkle, can you comment here?
sebastian: Can we just live with the deprecation warning?
Flags: needinfo?(nalexander) → needinfo?(s.kaspari)
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #10)
> sebastian: Can we just live with the deprecation warning?
Yeah, we can suppress the warning for now. Only concern here is: "MODE_MULTI_PROCESS does not work reliably in some versions of Android". But we have been living with that for quite some time now anyways..
Flags: needinfo?(s.kaspari)
Comment 12•9 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #10)
> We could use local broadcasts to a service; or we could expose an AIDL
> interface to the same service. At the end of the day, I think the
> ContentProvider is easiest.
>
> However, it's my belief that this functionality will be killed. mfinkle,
> can you comment here?
Yes. This functionality is being considered for removal. Discussions have started, but I wouldn't expect a removal until Fx45 at the earliest.
(In reply to Sebastian Kaspari (:sebastian) from comment #11)
> (In reply to Nick Alexander :nalexander from comment #10)
> > sebastian: Can we just live with the deprecation warning?
>
> Yeah, we can suppress the warning for now. Only concern here is:
> "MODE_MULTI_PROCESS does not work reliably in some versions of Android". But
> we have been living with that for quite some time now anyways..
Agreed. We have been using this for many releases now. If we can suppress the warning, that's the way forward until we reach a timeline for removal.
Flags: needinfo?(mark.finkle)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → s.kaspari
Status: NEW → ASSIGNED
Assignee | ||
Comment 13•9 years ago
|
||
I'm confused. I thought this is already fixed. I did a bunch of local and try build without this showing up. Anyways I'll create a patch.
Assignee | ||
Comment 14•9 years ago
|
||
Attachment #8669832 -
Flags: review?(mark.finkle)
Updated•9 years ago
|
Attachment #8669832 -
Flags: review?(mark.finkle) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: leave-open
Assignee | ||
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Updated•9 years ago
|
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•