It is suggested that we move all setMobileBetaMode, isBetaGroupMember, and beta/stable constants from MobileContext into new class, something like MobileUserOptions, or MobileUserMode and keep all logic (reading/writing user options/cookies etc) there. It will be easier to maintain/rewrite this feature, plus if we decide to handle anons, the only place where changes will be required are Special::MobileOptions (for render and submit logic) and that new class. See related T144085 and T143189.
= Acceptance criteria
[] All setMobileBetaMode, isBetaGroupMember, and beta/stable constants are moved to a new file.
[] Any tests are moved as well
[] Tests are added as appropriate
= Developer notes
Note isBetaGroupMember is a public API - there are 2 known usages outside MobileFrontend - UniversalLanguageSelector and Minerva - https://github.com/search?q=org%3Awikimedia+isBetaGroupMember&type=Code
We might want to hold off doing this in lieu of a discussed and agreed refactoring plan for MobileContext (see epic)
… and whenever we do modify the public API we will need to follow [[ https://www.mediawiki.org/wiki/Deprecation_policy | the official MediaWiki deprecation policy ]].