Skip to content

Fabricated Overlays Backend Support.#1575

Draft
Tharow wants to merge 8 commits intoMuntashirAkon:masterfrom
Tharow-Services:overlayFun
Draft

Fabricated Overlays Backend Support.#1575
Tharow wants to merge 8 commits intoMuntashirAkon:masterfrom
Tharow-Services:overlayFun

Conversation

@Tharow
Copy link
Contributor

@Tharow Tharow commented Mar 13, 2025

TODO:

  • Flesh out FabricatedOverlayBuilder
  • Fully Documentation of FabricatedOverlayBuilder.
  • Update HiddenApi with proper version codes for new apis added
  • Way to delete Fabricated Overlays.

References: Add Fabricated Overlays to OMS

Functional Details:

Any Fabricated Overlay owned by the current shell android.R.string.config_systemShell will be removed during init of the OverlayManagerService.
Fabricated Overlays have to be owned by a package allowed to overlay it, via OverlayConfig, this is worked around by setting the owner to the android package.

FabricatedOverlayBuilder

The Internal Builder for FabricatedOverlay requires advanced knowledge to use. the builder greatly simplify the adding of resources to the overlay.

Fuctionality

  • Res to Res Overlay: Takes Res of Target and Overlays it with a res value from with-in AM
  • Invert Resources Api: copy Resources Api but instead it sets the Resources.
  • Create Known Xml Config files.

Tharow added 4 commits March 10, 2025 17:56
Signed-off-by: Theray Tharow <tharowt@tharow.net>
Very Imcomplete

Signed-off-by: Theray Tharow <tharowt@tharow.net>
Fix setOwningPackage as documentation about it lies.
make AppDetailsOverlaysFragment.java use transaction system on newer systems as it allows changing of the new fabricatedOverlays.

TODO: setup FabOverlay deletion.
TODO: flesh out OverlayManagerCompact.FabricatedOverlayBuilder
Signed-off-by: Theray Tharow <tharowt@tharow.net>
Signed-off-by: Theray Tharow <tharowt@tharow.net>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For generated classes, it's better if you only include the required fields. Note that you may not want to add final to fields since finals (constants) will be unfolded during compilation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be sure to do that before undrafting the pr.

@Tharow
Copy link
Contributor Author

Tharow commented Mar 28, 2025

@MuntashirAkon I apologize for the slow updates to this, it has been a lot of work, and the public doc's are complete lies. the doc for setOwningPackage a fine example of the problem.

The other more difficult issue is the rewrite due to overlaymanager having annoying defaults for creation when it sends it off to the idmap service. So when we need to the builder allows bypassing of all restrictions assoc'd with the overlaymanager as it directly interacts with idmap2 and some daemon nonsense on top of it. to deal with the fact that we can't leave it running nor is it running by default.

Idmap is what converts Res Numbers to res and it was directly handles how overlays are "loaded" (converted to @​idmap) then loaded by assetmanager but still.

But i should be able to post an update to it soon.

Signed-off-by: Theray Tharow <tharowt@tharow.net>
@MuntashirAkon
Copy link
Owner

Please take your time. We're not in a hurry on this. Public docs in the AOSP are frequently outdated or simply absent.

Tharow added 3 commits April 4, 2025 12:25
…fabricatedoverlays.

IdmapDaemon.java allows use of the idmap service directly which will be required at a later date.

Signed-off-by: Theray Tharow <tharowt@tharow.net>
Signed-off-by: Theray Tharow <tharowt@tharow.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants