overriding with prebuilt packages

3,375 views
Skip to first unread message

Tiago Vieira

unread,
Nov 18, 2010, 10:51:34 AM11/18/10
to Android Building
Hi

I'm building Android platform for a specific device. I'm following the same model to add prebuilt packages as it is in the website and as I saw in the Android.mk of the GMS package.

So, I have a Keyboard I want to override the LatinIME package. Its Android.mk is like:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := com.mycompany.mykeyboard
LOCAL_MODULE_TAGS := optional
LOCAL_OVERRIDES_PACKAGES := LatinIME
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := shared
include $(BUILD_PREBUILT)

When I use that for prebuilt package, some works, some others no. For GMS for example, which replaces QuickSearchBox to GoogleQuickSearchBox, that works fine. I also added the same rules to replace Contacts with MyCompanyContacts (prebuilt). But, for the LatinIME, it is going through. LatinIME is already tagged to optional but I can't see another way unless removing it from generic.mk. I don't want to remove from generic.mk as we have some variants that we don't want to have our customized keyboard.

Do you think it might have something wrong with the LOCAL_OVERRIDES_PACKAGES when using for prebuilt apps?

Thanks,
Tiago


Ying Wang

unread,
Nov 18, 2010, 1:24:26 PM11/18/10
to android-...@googlegroups.com
Did you do a clean build?
The build system won't remove the LatinIME from your system/app/ that's built before your change.





--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

Ying Wang

unread,
Nov 18, 2010, 1:41:21 PM11/18/10
to android-...@googlegroups.com
To avoid lengthy clean rebuild, you can just remove LatinIME from the out/target/product/*/system/app, as well as the .img and .zip file in out/target/product/*/, then rebuild it.

Tiago Vieira

unread,
Nov 21, 2010, 8:18:20 AM11/21/10
to android-...@googlegroups.com
Hi Ying Wang

Thanks for your reply. To avoid lengthy clean rebuild I usually do a 'installclean'. As I always build using 'dist' for my scripts that check the result files, it seems that 'installclean' is perfectly fine when I want to change only the product configurations. 

I found the problem and it might be a bug in the build system.

Instead of using single names for my apks like MyKeyboard.apk or MyTutorial.apk, I use to rename them to its respective package name, like, com.company.mykeyboard.apk. So then my Android.mk configuration would have the MODULE_NAME := com.company.keyboard and LOCAL_SRC_FILES pointing to $(LOCAL_MODULE).apk as the example below. The the dots in the module name seem to be the problem. 

After I renamed them to a single name (without dots), the final OVERRIDE_PACKAGES variable (within main.mk) shows all packages to be overridden and that fixed the problem.

Thanks anyway for your help.

Regards,
Tiago Vieira
Reply all
Reply to author
Forward
0 new messages