Closed Bug 761206 Opened 12 years ago Closed 7 years ago

[meta] Support for multiple simultaneous Fennec versions

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P3)

ARM
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rnewman, Unassigned)

References

Details

(Keywords: meta, Whiteboard: [sync:scale])

Attachments

(3 files)

Depends on: 757148
Depends on: 753002
Depends on: 755181
Depends on: 756716
Depends on: 755638
Might as well put this here.  See

https://github.com/mozilla-services/android-sync/tree/nalexander/multiple-Fennecs/

for a tree that uses android:sharedUserID and android:accountType, and apply the patch before building two branded Fennecs with the attached .mozconfig files.  Device testing works well for me.
from rnewman: Please verify when you get a chance that a differently signed app cannot access your credentials. 

Built and signed my own official:

~/Mozilla/mozilla-inbound/objdir-official/dist $ apkbuilder testuu.apk -v -z gecko.ap_ -f fennec/classes.dex -u

~/Mozilla/mozilla-inbound/objdir-official/dist $ cp testuu.apk testu.apk && jarsigner -keystore ~/Mozilla/nalexander-keystore testu.apk nalexander-keystore

~/Mozilla/mozilla-inbound/objdir-official/dist $ zipalign 4 testu.apk test.apk

Installed onto device:

$ adb install test.apk
899 KB/s (16630742 bytes in 18.056s)
	pkg: /data/local/tmp/test.apk
Success

You can't even install an APK that wants to share user ID but is not signed with the same key.  This is a debug signed beta:

$ adb install ~/Mozilla/mozilla-inbound/objdir-beta/dist/fennec*apk
976 KB/s (16618265 bytes in 16.616s)
	pkg: /data/local/tmp/fennec-16.0a1.en-US.android-arm.apk
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]

tl;dr: a differently signed app can't even be installed to access the Authenticator.
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Depends on: 768467
Of note: we need to test very carefully the interaction between existing versions in each channel and versions after this feature lands.

We have to detect the difference between an upgrade (migrate prefs) and a new install which can see prefs (migrate but generate new values for client ID and timestamps...). Amongst other things.

Nick and I already discussed this, but leaving a note here for thoroughness.
Note requirement from Bug 721760 Comment 39.
Let's flip depends to blocks for reports…
For clarity: 

10:23 rnewman: I'd term these tiers "concurrent fennecs", "overlapping fennecs"
...
10:23 rnewman: overlapping fennecs with more than one possible account

Concurrent means multiple Fennecs (org.mozilla.fennec_whoami, org.mozilla.firefox) accessing different Android Account types.

Overlapping means multiple Fennecs (org.mozilla.firefox, org.mozilla.firefox_beta) accessing the same Android Account type and possibly the same Account object.
Just a note: we may be to prevent multiple SendTabActivity's registering as Share intents by using the hack in

http://stackoverflow.com/questions/11370177/handle-nfc-intents-only-when-preference-is-set

We could, for instance, have the active AccountAuthenticator turn on the Send Tab intent for its SendTabActivity only when an Account is created; that might also prevent Send Tab showing up before Sync is set up.
Blocks: 775880
Truth in advertising: I am not actively working on these tickets.
Assignee: nalexander → nobody
No longer blocks: 757121
Nick, when you get a chance could you update the state of this bug?
Flags: needinfo?(nalexander)
Whiteboard: [sync:scale]
(In reply to Richard Newman [:rnewman] from comment #12)
> Nick, when you get a chance could you update the state of this bug?

I think is still a valid ticket, even though we don't intend to address this any time in the foreseeable future.  Therefore I've set this back to NEW.

To summarize where this cluster of bugs stands: Android Sync works well with multiple Fennec versions.  Release and Beta share a single Android account type; Nightly and Aurora share a different Android account type; and developer builds share another account type.  This all works well, but each Android account type is only allowed to have a single account.

The pieces of this bug address edge cases (Bugs 786390 and 786393) in this set up, and feature work to allow an Android account type to have multiple accounts of each account type (Bugs 722607 and 777800).  There are deep ties between profiles in Fennec and the latter feature work, and since multiple profiles in Fennec are not expected to be implemented at all, we have de-prioritized this work.

And that's how I spent my summer.
Status: ASSIGNED → NEW
Flags: needinfo?(nalexander)
Product: Mozilla Services → Android Background Services
I think this bug needs a priority bump since the multiuser feature of Firefox Mobile on tablets was introduced with Android 4.2.  

Sync stops working if one account on the tablet has a beta version and another has the production version.
(In reply to Kelley Cook from comment #14)
> I think this bug needs a priority bump since the multiuser feature of
> Firefox Mobile on tablets was introduced with Android 4.2.  
> 
> Sync stops working if one account on the tablet has a beta version and
> another has the production version.

Hi Kelley,

Can you tell me more about what exactly you did?

The way it works is: you should be able to create one single account from each of the following sets of versions: {release, beta} {aurora, nightly} {custom build}.  So you should not have been able to create two Sync accounts, one for beta and one for release.  A list of your accounts and their details, or a screenshot of the relevant Account settings screens, would be helpful.
Flags: needinfo?(R.Kelley.Cook)
Clearing old flags.
Flags: needinfo?(R.Kelley.Cook)
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.