gpt4 book ai didi

android - ITelephony .java 无法正确生成

转载 作者:行者123 更新时间:2023-11-29 14:52:36 26 4
gpt4 key购买 nike

我按照正确的程序在我的 eclipse 项目中生成了 ITelephony.java 类。

但它似乎没有正确生成,因为我在文件中收到了很多红色警告。我在 ubuntu 12.04 64 位下运行。奇怪的是,它确实适用于我在 windows 下运行的工作 PC。问题是我真的需要在我的笔记本电脑上工作才能在家工作。

我在两台设备上都使用 Juno 版本的 eclipse。

什么会导致这个问题?

任何答案/想法都会很棒,因为我真的不知道如何解决它。

编辑 1:抱歉忘记说明我遇到的错误。所有相同的类型,例如“@Override public android.os.IBinder asBinder(){归还这个;}”

我得到:“ITelephony.Stub 类型的方法 asBinder() 必须覆盖父类(super class)方法”和“实现 androidod.IIterface.asBinder”。

这是完整生成的文件:

/*
* This file is auto-generated. DO NOT MODIFY.
* Original file: /home/lenore/workspace/Launcher/src/com/android/internal/telephony/ITelephony.aidl
*/
package com.android.internal.telephony;
public interface ITelephony extends android.os.IInterface
{
/** Local-side IPC implementation stub class. */
public static abstract class Stub extends android.os.Binder implements com.android.internal.telephony.ITelephony
{
private static final java.lang.String DESCRIPTOR = "com.android.internal.telephony.ITelephony";
/** Construct the stub at attach it to the interface. */
public Stub()
{
this.attachInterface(this, DESCRIPTOR);
}
/**
* Cast an IBinder object into an com.android.internal.telephony.ITelephony interface,
* generating a proxy if needed.
*/
public static com.android.internal.telephony.ITelephony asInterface(android.os.IBinder obj)
{
if ((obj==null)) {
return null;
}
android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
if (((iin!=null)&&(iin instanceof com.android.internal.telephony.ITelephony))) {
return ((com.android.internal.telephony.ITelephony)iin);
}
return new com.android.internal.telephony.ITelephony.Stub.Proxy(obj);
}
@Override public android.os.IBinder asBinder()
{
return this;
}
@Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
{
switch (code)
{
case INTERFACE_TRANSACTION:
{
reply.writeString(DESCRIPTOR);
return true;
}
case TRANSACTION_endCall:
{
data.enforceInterface(DESCRIPTOR);
boolean _result = this.endCall();
reply.writeNoException();
reply.writeInt(((_result)?(1):(0)));
return true;
}
case TRANSACTION_dial:
{
data.enforceInterface(DESCRIPTOR);
java.lang.String _arg0;
_arg0 = data.readString();
this.dial(_arg0);
reply.writeNoException();
return true;
}
case TRANSACTION_answerRingingCall:
{
data.enforceInterface(DESCRIPTOR);
this.answerRingingCall();
reply.writeNoException();
return true;
}
}
return super.onTransact(code, data, reply, flags);
}
private static class Proxy implements com.android.internal.telephony.ITelephony
{
private android.os.IBinder mRemote;
Proxy(android.os.IBinder remote)
{
mRemote = remote;
}
@Override public android.os.IBinder asBinder()
{
return mRemote;
}
public java.lang.String getInterfaceDescriptor()
{
return DESCRIPTOR;
}
@Override public boolean endCall() throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
boolean _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
mRemote.transact(Stub.TRANSACTION_endCall, _data, _reply, 0);
_reply.readException();
_result = (0!=_reply.readInt());
}
finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
@Override public void dial(java.lang.String number) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(number);
mRemote.transact(Stub.TRANSACTION_dial, _data, _reply, 0);
_reply.readException();
}
finally {
_reply.recycle();
_data.recycle();
}
}
@Override public void answerRingingCall() throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
mRemote.transact(Stub.TRANSACTION_answerRingingCall, _data, _reply, 0);
_reply.readException();
}
finally {
_reply.recycle();
_data.recycle();
}
}
}
static final int TRANSACTION_endCall = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
static final int TRANSACTION_dial = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
static final int TRANSACTION_answerRingingCall = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
}
public boolean endCall() throws android.os.RemoteException;
public void dial(java.lang.String number) throws android.os.RemoteException;
public void answerRingingCall() throws android.os.RemoteException;
}

最佳答案

我只需要将 java 编译器级别设置为 1.6 而不是 1.5...Facepalm

关于android - ITelephony .java 无法正确生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13855993/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com