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.Fix
Install.kt— AddUSER_ACTION_NOT_REQUIREDtoSessionParamsfor API 31+:SplitInstallService.kt — Route splitDeferred() through splitInstallFlow()
(same as startInstall()), then ACK with onDeferredInstall() after completion
instead 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:
Install Aurora Store → select microG as installer method
Install Facebook (com.facebook.katana) and TikTok (com.tiktok)
Open each app and allow DFM modules to load
Before fix (logcat evidence in #3541):
InstallDistActivity appeared as topActivity before every session commit
splitDeferred() called for com.facebook.katana, but is not implemented (repeated per module)
App fell back to startInstall() for same DFM modules → additional dialogs
After fix:
InstallDistActivity no longer appears as topActivity ✅
splitDeferred not implemented no longer logged ✅
Facebook and TikTok DFM modules install silently in background ✅
Notes
USER_ACTION_NOT_REQUIRED requires API 31 (Android 12+), guarded by
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
splitDeferred() ACKs with onDeferredInstall(Bundle()) regardless of
install result so the calling app is never left waiting
This fix matches the behavior already implemented in Aurora Store's
SessionInstaller.kt for its own session installer path
Related: PR #3074 (App Installer Proxy)
Full logcat after fix (Facebook + TikTok):
facebook_log_after_fix_redacted.txt