如何解决android活页夹包裹有多个参数的问题
我遇到活页夹和包裹多个参数的问题。 我正在使用最新的linux android ndk 21d。 用c ++编码
我与交易代码一起使用的功能在Java中具有此标志
int somefunction(byte[] input,byte[] reply,int method) {
v0_1 = this.process(input);
if(v0_1 != null) {
if(v0_1.length == 1 && v0_1[0] == v4) {
goto label_27;
}
System.arraycopy(((byte[])v0_1),reply,v0_1[0] + 2);
v0 = 0;
}
}
我使用的方法如下。
sp<IServiceManager> sm = defaultServiceManager();
sp<IBinder> someservice = sm->getService(String16("someservice"));
Parcel data;
Parcel reply;
data.writeInterfaceToken(String16("someinterface"));
char buffer1[256];
int method = 1;
memset(buffer1,'\0',sizeof(buffer1));
char outbuffer[256];
memset(outbuffer,sizeof(outbuffer));
data.writeInt32(sizeof(buffer1));
data.write(buffer1,sizeof(buffer1));
data.writeInt32(sizeof(outbuffer));
data.write(outbuffer,sizeof(outbuffer));
data.writeInt32(method);
int status = someservice->transact("transaction code",data,&reply,0);
函数执行正常,但出现以下错误。
01-01 19:58:57.208 7465 7465 E AndroidRuntime: FATAL EXCEPTION: main
01-01 19:58:57.208 7465 7465 E AndroidRuntime: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
我不确定我在想什么,有谁能帮忙?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。