
1.添加cpp文件:
目录frameworks/services/com/jni/com_android_HelloUserService.app
#define LOG_TAG "HelloUserService"
#include "jni.h"
#include <nativehelper/JNIHelp.h>
#include "android_runtime/AndroidRuntime.h"
#include "core_jni_helpers.h"
#include <utils/misc.h>
#include <utils/Log.h>
#include <hardware/vibrator.h> //--------
#include <inttypes.h>
#include <stdio.h>
namespace android {
static jint userSetMic(JNIEnv *env, jobject clazz, int arg)
{
return arg+5;
}
static jint userSetSpeaker(JNIEnv *env, jobject clazz, int arg)
{

最低0.47元/天 解锁文章
785

被折叠的 条评论
为什么被折叠?



