Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeKeepAlive_test 函数调用后,不能启动Service2 #3

Open
hetianlong0 opened this issue Apr 9, 2020 · 2 comments
Open

NativeKeepAlive_test 函数调用后,不能启动Service2 #3

hetianlong0 opened this issue Apr 9, 2020 · 2 comments

Comments

@hetianlong0
Copy link

   你好:
       我使用了keepAlive-ioctrl分支的代码,将doDaemon函数注释掉了,单独测试了Java_com_boolbird_keepalive_NativeKeepAlive_test函数,writeService函数的sdk version号也修改正确了,但是我发现Service2服务并没有启动。是服务要一定要启动一个新进程吗?可能是哪里的问题?
@lcodecorex
Copy link
Owner

能不能启动服务跟发的命令对不对,也就是transact_code要正确。
原代码中,30是transact_code,根据不同android版本会不一样:

status_t status = write_transact(handle, 30, *data, NULL, 1, mDriverFD);

应该是:

uint32_t transact_code = 0;
switch (sdk_version) {
    case 26:
    case 27:
        transact_code = 26;
        break;
    case 28:
        transact_code = 30;
        break;
    case 29:
        transact_code = 24;
        break;
    default:
        transact_code = 34;
        break;
}

@xiaoyaomeng
Copy link

   你好:
       我使用了keepAlive-ioctrl分支的代码,将doDaemon函数注释掉了,单独测试了Java_com_boolbird_keepalive_NativeKeepAlive_test函数,writeService函数的sdk version号也修改正确了,但是我发现Service2服务并没有启动。是服务要一定要启动一个新进程吗?可能是哪里的问题?

目前你有什么进展吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants