What is the most elegant way of striping AOSP of its pre-installed packages?

0

I am trying to gradually stripe AOSP out of its default apps. But I wonder if the method I am going to apply is correct and is the most effective.

After looking through ways of doing that I have come to the following method:(example app - "package_name")

1. Pick particular app and find out its "LOCAL_PACKAGE_NAME"
2. Use "envsetup.sh" provided command "mgrep package_name"
3. Look at the output to determine where package_name is mentioned
4. Remove lines of code containing package_name from makefiles

I have also stumbled upon this solution:

Instead of modifying bunch of .mk files in AOSP in many folders, you can add a new module, a stub, and disable modules in its Android.mk using LOCAL_OVERRIDES_PACKAGES. If a module still appear in target, you'll probably need to add to LOCAL_OVERRIDES_PACKAGES another modules which added undesired packages via LOCAL_REQUIRED_MODULES.

But sadly I am not aware yet how one builds a new "module, a stub" so I can't apply this method as of now.

Are there any steps I can take to make sure a particular app is removed from my build completely without harming anything. What do you think is the most elegant solution to this specific task if there is one? What(literature/docs/website)would be useful for me to get familiar with making "scratch-surface" changes to AOSP code like the abovementioned case?

If that matters what I am trying to remove at the moment: Calculator; Calendar; Camera; Clock; Contacts; Files; Gallery; Messaging; Music; Phone; Search; WebView

Thanks in advance for your responses!

jeancroissand

Posted 2019-08-01T21:30:09.113

Reputation: 13

By "AOSP" do you mean the Android Open Source Project? If so, please read the tag wikis for the tags you've used on this question for guidance on where this ought to be asked. – music2myear – 2019-08-02T03:37:14.977

No answers