Last Comment Bug 761206 - [meta] Support for multiple simultaneous Fennec versions
: [meta] Support for multiple simultaneous Fennec versions
Status: NEW
[sync:scale]
: meta
Product: Android Background Services
Classification: Client Software
Component: Android Sync (show other bugs)
: unspecified
: ARM Android
: -- normal
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on: 722607 777800 786390 786393 755181 761682 764867 769506 772645 777973
Blocks: 753002 755638 755794 756716 757148 768467 775880
  Show dependency treegraph
 
Reported: 2012-06-04 10:00 PDT by Richard Newman [:rnewman]
Modified: 2013-08-18 07:39 PDT (History)
8 users (show)
nalexander: needinfo? (R.Kelley.Cook)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch against m-i to support Android Sync with multiple Fennecs (5.31 KB, patch)
2012-06-14 17:18 PDT, Nick Alexander :nalexander (leave until January 2017)
no flags Details | Diff | Splinter Review
Build you an org.mozilla.firefox_beta! (1.12 KB, text/plain)
2012-06-14 17:19 PDT, Nick Alexander :nalexander (leave until January 2017)
no flags Details
Build you an org.mozilla.firefox! (1.13 KB, text/plain)
2012-06-14 17:19 PDT, Nick Alexander :nalexander (leave until January 2017)
no flags Details

Comment 1 Nick Alexander :nalexander (leave until January 2017) 2012-06-14 17:18:10 PDT
Created attachment 633324 [details] [diff] [review]
patch against m-i to support Android Sync with multiple Fennecs
Comment 2 Nick Alexander :nalexander (leave until January 2017) 2012-06-14 17:19:07 PDT
Created attachment 633325 [details]
Build you an org.mozilla.firefox_beta!
Comment 3 Nick Alexander :nalexander (leave until January 2017) 2012-06-14 17:19:40 PDT
Created attachment 633326 [details]
Build you an org.mozilla.firefox!
Comment 4 Nick Alexander :nalexander (leave until January 2017) 2012-06-14 17:19:50 PDT
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.
Comment 5 Nick Alexander :nalexander (leave until January 2017) 2012-06-15 12:25:08 PDT
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.
Comment 6 Richard Newman [:rnewman] 2012-07-05 13:38:20 PDT
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.
Comment 7 Richard Newman [:rnewman] 2012-07-06 16:52:11 PDT
Note requirement from Bug 721760 Comment 39.
Comment 8 Richard Newman [:rnewman] 2012-07-06 16:53:22 PDT
Let's flip depends to blocks for reports…
Comment 9 Nick Alexander :nalexander (leave until January 2017) 2012-07-10 14:06:27 PDT
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.
Comment 10 Nick Alexander :nalexander (leave until January 2017) 2012-07-18 16:22:34 PDT
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.
Comment 11 Nick Alexander :nalexander (leave until January 2017) 2012-08-31 09:58:42 PDT
Truth in advertising: I am not actively working on these tickets.
Comment 12 Richard Newman [:rnewman] 2013-01-07 14:32:22 PST
Nick, when you get a chance could you update the state of this bug?
Comment 13 Nick Alexander :nalexander (leave until January 2017) 2013-01-15 15:34:14 PST
(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.
Comment 14 Kelley Cook 2013-08-18 01:25:54 PDT
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.
Comment 15 Nick Alexander :nalexander (leave until January 2017) 2013-08-18 07:39:14 PDT
(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.

Note You need to log in before you can comment on or make changes to this bug.