Android AOSP内置GMS服务

Android源代码中加入GMS,安装Google Play、Chrome等相关应用,使AOSP系统用起来更加顺滑

一、环境准备

(1) Android系统源码编译环境(Android 9.0 Pixel 3)
(2) 开发环境(SubLime Text3)

二、GMS OPENGAPPS相关应用下载

GMS OPENGAPPS

三、GMS OPENGAPPS配置编译

参考GMS OPENGAPPSREADME文档,进行相关配置,使得OPENGAPPS参与系统的编译,并生成含有GMS服务的系统

1)在aosp/.repo/manifests/default.xml文件中追加如下内容

<remote name="opengapps" fetch="https://github.com/opengapps/"  />
<remote name="opengapps-gitlab" fetch="https://gitlab.opengapps.org/opengapps/"  />

<project path="vendor/opengapps/build" name="aosp_build" revision="master" remote="opengapps" />

<project path="vendor/opengapps/sources/all" name="all" clone-depth="1" revision="master" remote="opengapps-gitlab" />

<!-- arm64 depends on arm -->
<project path="vendor/opengapps/sources/arm" name="arm" clone-depth="1" revision="master" remote="opengapps-gitlab" />
<project path="vendor/opengapps/sources/arm64" name="arm64" clone-depth="1" revision="master" remote="opengapps-gitlab" />

<project path="vendor/opengapps/sources/x86" name="x86" clone-depth="1" revision="master" remote="opengapps-gitlab" />
<project path="vendor/opengapps/sources/x86_64" name="x86_64" clone-depth="1" revision="master" remote="opengapps-gitlab" />
git commit -a -m "add open gapps"

2)在aosp/device/google/muskie/aosp_walleye.mk文件中修改配置

 - PRODUCT_RESTRICT_VENDOR_FILES := owner
 + PRODUCT_RESTRICT_VENDOR_FILES := false

3)在device/google/crosshatch/device.mk文件中追加如下内容

GAPPS_VARIANT := mini
WITH_DEXPREOPT := true
DONT_DEXPREOPT_PREBUILTS := true
$(call inherit-product, vendor/opengapps/build/opengapps-packages.mk)

4)在frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java文件中修改内容

public class WindowManagerService extends IWindowManager.Stub
 
     @Override
     public void setShelfHeight(boolean visible, int shelfHeight) {
-        mAmInternal.enforceCallerIsRecentsOrHasPermission(android.Manifest.permission.STATUS_BAR,
-                "setShelfHeight()");
+        //mAmInternal.enforceCallerIsRecentsOrHasPermission(android.Manifest.permission.STATUS_BAR,
+        //        "setShelfHeight()");
         synchronized (mWindowMap) {
             getDefaultDisplayContentLocked().getPinnedStackController().setAdjustedForShelf(visible,
                     shelfHeight)

5)拉取OPENGAPPS文件

sudo apt install git-lfs
git lfs install
repo forall -c git lfs pull 

四、编译系统

srouce build/envsetup.sh
lunch xxx
make -j16

五、刷入设备

fastboot flashall -w
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值