Vending: Fix repeated EMUI install dialog and implement splitDeferred#3543
Open
grenadin wants to merge 1 commit into
Open
Vending: Fix repeated EMUI install dialog and implement splitDeferred#3543grenadin wants to merge 1 commit into
grenadin wants to merge 1 commit into
Conversation
- Add USER_ACTION_NOT_REQUIRED to SessionParams in installPackagesInternal() for API 31+ (Android 12+) to prevent Huawei EMUI InstallDistActivity from intercepting every PackageInstaller session commit with a confirmation dialog. - Implement splitDeferred() in SplitInstallService to route deferred DFM install requests through splitInstallFlow() instead of being a no-op stub. Previously, apps like Facebook would fall back to startInstall() for each deferred module, triggering additional PackageInstaller sessions and additional InstallDistActivity dialogs on EMUI. Fixes: microg#3541
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3541
Problem
On Huawei EMUI devices (Android 12+), two related issues in
vending-appcause
InstallDistActivity(Huawei's install confirmation dialog) to appearrepeatedly during app installation via microG Companion installer proxy.
Issue 1 — Missing
USER_ACTION_NOT_REQUIREDflaginstallPackagesInternal()inInstall.ktcreatesPackageInstaller.SessionParamswithout setting
USER_ACTION_NOT_REQUIRED. On EMUI, the system intercepts everysession commit and routes it through
InstallDistActivity, showing a mandatoryconfirmation dialog — including for background DFM installs.
Issue 2 —
splitDeferred()was a no-op stubSplitInstallService.splitDeferred()only logged a warning and ACKed immediatelywithout performing any actual installation. Apps such as Facebook request background
pre-installation of DFM splits (e.g.
pytorch,papaya,executorch) viasplitDeferred(). Because nothing was installed, the app fell back tostartInstall()for the same modules — triggering additional
PackageInstallersessions and additionalInstallDistActivitydialogs per module.Context
SplitInstallServiceandsplitDeferred()were originally introduced in #2500(Implement SplitInstallService). At that time
splitDeferred()was left as a stub —it only logged "not implemented" and never called back, which is the root cause of
Issue 2 above. This PR implements it by routing through the same
splitInstallFlow()already used by
startInstall(), rather than introducing a new code path.Fix
Install.kt— AddUSER_ACTION_NOT_REQUIREDtoSessionParamsfor API 31+:SplitInstallService.kt— RoutesplitDeferred()throughsplitInstallFlow()(same as
startInstall()), then ACK withonDeferredInstall()after completioninstead of being a no-op.
Testing
Tested on Huawei MatePad Mini (EMUI 12, Android 12) with microG Companion
0.3.15.250932-hw built from this branch.
Test steps:
Before fix (logcat evidence in #3541):
InstallDistActivityappeared as topActivity before every session commitsplitDeferred() called for com.facebook.katana, but is not implemented(repeated per module)startInstall()for same DFM modules → additional dialogsAfter fix:
InstallDistActivityno longer appears as topActivity ✅splitDeferred not implementedno longer logged ✅Notes
USER_ACTION_NOT_REQUIREDrequires API 31 (Android 12+), guarded byBuild.VERSION.SDK_INT >= Build.VERSION_CODES.SsplitDeferred()ACKs withonDeferredInstall(Bundle())regardless ofinstall result so the calling app is never left waiting
SessionInstaller.ktfor its own session installer pathSplitInstallServiceskeleton introduced in Implement SplitInstallService #2500Full logcat after fix (Facebook + TikTok):
facebook_log_after_fix_redacted.txt