Today to import/export contacts in terms of things, import/export Contact This panel is a dialogfragment, followed by the code found in its implementation packages/apps/contactscommon, then add some log in it, Enter into the packages/apps/contactscommon/directory, MM, Compile generated a com.android.contacts.common.apk, the program push to the system, add the log information but how also can not get out, began to doubt is wrong, not this place to achieve ( Android source still have some duplicate code, so again the whole project searched again, that import/export contact Dialogfragment Only here to define, so depressed ... There is no problem in android.mk:
Local_path: = $ (call My-dir)
Include $ (clear_vars)
Local_module_tags: = Optional
Local_src_files: = $ (call All-java-files-under, SRC)
Local_resource_dir: = $ (Addprefix $ (local_path)/, RES)
Local_java_libraries: = Telephony-common
Local_static_java_libraries: = \
com.android.phone.shared \
Com.android.vcard \
Guava \
Android-common \
ANDROID-SUPPORT-V13 \
ANDROID-SUPPORT-V4 \
Local_package_name: = Com.android.contacts.common
local_proguard_enabled: = disabled
Local_proguard_flag_files: = Proguard.flags
Include $ (build_package)
# Use the folloing include to make our test apk.
Include $ (call all-makefiles-under,$ (Local_path))
=========================================================================
Later, I searched for Com.android.contacts.common and found references in Packages/apps/dialer and Packages/apps/contacts,
Contacts's Android.mk file:
Local_path:= $ (call My-dir)
Include $ (clear_vars)
Local_module_tags: = Optional
Contacts_common_dir: =. /contactscommon
Src_dirs: = src $ (contacts_common_dir)/src
Res_dirs: = res $ (contacts_common_dir)/res
Local_src_files: = $ (Call All-java-files-under, $ (src_dirs))
Local_resource_dir: = $ (Addprefix $ (local_path)/, $ (res_dirs))
Local_aapt_flags: = \
--auto-add-overlay \
--extra-packages Com.android.contacts.common
Local_java_libraries: = Telephony-common Voip-common
Local_static_java_libraries: = \
com.android.phone.shared \
Com.android.vcard \
Android-common \
Guava \
ANDROID-SUPPORT-V13 \
ANDROID-SUPPORT-V4 \
Android-ex-variablespeed \
Local_required_modules: = Libvariablespeed
Local_package_name: = Contacts
Local_certificate: = Shared
Local_proguard_flag_files: = Proguard.flags
Include $ (build_package)
# Use the folloing include to make our test apk.
Include $ (call all-makefiles-under,$ (Local_path))
=================================================================
Among them is this paragraph:
Local_aapt_flags: = \
--auto-add-overlay \
--extra-packages Com.android.contacts.common
And in the contacts Androidmanifest.xml also registered a lot of Contactscommon in the class, so I think Contactscommon is in this way integrated into the contacts this program, compiled a contacts,push into the system , and found that the log can come out.
In the Android system, the coupling between the dialer (Packages/apps/dialer) and the Contact program (packages/apps/contacts) is very large, the contact information can be transferred in the dial-up, in the contact can enter the dial-up interface (of course , and a text messaging program is also connected to each other), so I think, in order to better make these programs boast the process of access, the introduction of this Contactscommon program (Android4.3 before there is no this thing), the equivalent of a middleman it.
Android4.4 Makefile Properties: Use of Local_aapt_flags