Repository navigation
Send remote preference updates to the instance system_server subscribed on - #1109
Open
dev-nagisa wants to merge 1 commit into
Open
dev-nagisa wants to merge 1 commit into
dev-nagisa wants to merge 1 commit into
Conversation
…ed on getModulesForSystemServer builds a LoadedModule of its own when the cache has not loaded the module yet, and system_server subscribes its remote preference callback on that object's service. The rebuild then made a second InjectedModuleService, because oldModule is still null at that point, and ModuleAppService notifies the cache's instance — so the subscriber heard nothing until the next reboot. Keep the service the pre-cache path handed out and adopt it in the rebuild, so both sides hold the same object. Fixes JingMatrix#1083
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 #1083.
getModulesForSystemServercan run before the first rebuild has loaded a module, and takes its own branch: it builds aLoadedModulewith a freshInjectedModuleService. system_server subscribes its remote preference callback on that instance. The rebuild then makes a second one —oldModuleis still null there — andupdateRemotePreferences/deleteRemotePreferencesnotify the cache's instance, so system_server keeps the values it read at boot andonRemotePreferencesChangednever fires.The instance handed out on that path is now kept per package and adopted by the rebuild, so system_server and the cache hold the same object.
ConfigCache: newpreloadedServicesmap.getModulesForSystemServerhands out the mapped instance (computeIfAbsent), the rebuild takes it withremovebefore falling back toInjectedModuleService(pkgName).state.moduleson the pre-cache path, no injection, IPC or API changes.Not verified with a local build —
:daemonwants NDK 30 and this machine cannot install it into the SDK, so the CI run on this PR is the first compile. The change is Kotlin only, and formatting follows the module's ktfmt Meta style.The diagnosis and the shape of the fix come from @varma322 in #1083.