gms包集成步骤:
(1) 需要下载对应gms,国内需要通过VPN下载。下载后解压,文件目录:partner_gms。下载时,最好核对一下匹配的android版本。
(2)依照路径打开gms.mk/gms_go.mk,如:partner_gms\products\gms.mk。确认需要将GMS集成的代码位置,例如:
# GMS home folder location
# Note: we cannot use $(my-dir) in this makefile
ANDROID_PARTNER_GMS_HOME := vendor/partner_gms
注:也就是集成路径默认在vendor下面,当然路径与路径命名也可以做修改。
(3)编译环境添加gms方法: 在
device/mediatek/common/device.mk 与
device/mediatek/system/common/device.mk (因我这是android 10.0版本所以还得在此文件)内添加,
# GMS interface
ifdef BUILD_GMS
ifeq ($(strip $(BUILD_GMS)), yes)
ifeq ($(strip $(BUILD_AGO_GMS)), yes)
$(call inherit-product-if-exists, vendor/partner_gms/products/gms_go.mk)
else
$(call inherit-product-if-exists