学习总纲:
Android10 硬件抽象层(HAL)概要介绍和学习计划
编译环境:
- android 版本 - android-10.0.0_r41
- 架构 - aosp_x86_64-eng
- 内核分支:android-goldfish-4.14-gchips
参考教材:
罗升阳:https://blog.youkuaiyun.com/luoshengyang/article/details/6575988
修改如下:
在frameworks/base/services/ core /jni目录下创建 com_android_server_HelloService.cpp :
#define LOG_TAG "HelloService"
#include <nativehelper/JNIHelp.h>
#include "jni.h"
#include <utils/Log.h>
#include <utils/misc.h>
#include <utils/String8.h>
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/timerfd.h>
#include <sys/types.h>
#include <sys/socket.h>
#