資源簡(jiǎn)介
在android手機(jī)上實(shí)現(xiàn)自動(dòng)接聽(tīng)電話,2.3以下依靠的是對(duì)ITelephony的反射調(diào)用來(lái)實(shí)現(xiàn),2.3-4.0是通過(guò)對(duì)耳機(jī)的模擬操作來(lái)實(shí)現(xiàn),4.1以上有了一些變動(dòng),在這個(gè)demo中我沒(méi)有對(duì)2.3進(jìn)行處理,請(qǐng)朋友們自己去搜下2.3的處理方式

代碼片段和文件信息
/*
?*?This?file?is?auto-generated.??DO?NOT?MODIFY.
?*?Original?file:?E:\\MyAndroid\\MyWorkSpace\\EventBusTest\\src\\com\\android\\internal\\telephony\\ITelephony.aidl
?*/
package?com.android.internal.telephony;
/**
?*?Interface?used?to?interact?with?the?phone.??Mostly?this?is?used?by?the
?*?TelephonyManager?class.??A?few?places?are?still?using?this?directly.
?*?Please?clean?them?up?if?possible?and?use?TelephonyManager?insteadl.
?*
?*?{@hide}
?*/
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_dial:
{
data.enforceInterface(DEscriptOR);
java.lang.String?_arg0;
_arg0?=?data.readString();
this.dial(_arg0);
reply.writeNoException();
return?true;
}
case?TRANSACTION_call:
{
data.enforceInterface(DEscriptOR);
java.lang.String?_arg0;
_arg0?=?data.readString();
this.call(_arg0);
reply.writeNoException();
return?true;
}
case?TRANSACTION_showCallScreen:
{
data.enforceInterface(DEscriptOR);
boolean?_result?=?this.showCallScreen();
reply.writeNoException();
reply.writeInt(((_result)?(1):(0)));
return?true;
}
case?TRANSACTION_showCallScreenWithDialpad:
{
data.enforceInterface(DEscriptOR);
boolean?_arg0;
_arg0?=?(0!=data.readInt());
boolean?_result?=?this.showCallScreenWithDialpad(_arg0);
reply.writeNoException();
reply.writeInt(((_result)?(1):(0)));
return?true;
}
case?TRANSACTION_endCall:
{
data.enforceInterface(DEscriptOR);
boolean?_result?=?this.endCall();
reply.writeNoException();
reply.writeInt(((_result)?(1):(0)));
return?true;
}
case?TRANSACTION_answerRingingCall:
{
data.enforceInterface(DEscriptOR);
this.answerRingingCall();
reply.writeNoException();
return?true;
}
case?TRANSACTION_silenceRinger:
{
data.enforceInterface(DEscriptOR);
this.silenceRinger();
reply.writeNoException();
return?true;
}
case?TRANSACTION_isOffhook:
{
data.enforceInterf
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件????????475??2014-12-10?11:05??EventBusTest\.classpath
?????文件????????848??2014-12-10?11:05??EventBusTest\.project
?????文件?????????57??2014-12-16?13:31??EventBusTest\.settings\org.eclipse.core.resources.prefs
?????文件????????177??2014-12-10?11:05??EventBusTest\.settings\org.eclipse.jdt.core.prefs
?????文件???????1208??2014-12-16?14:33??EventBusTest\AndroidManifest.xm
?????文件???????6803??2014-12-16?14:33??EventBusTest\bin\aidl\com\android\internal\telephony\ITelephony.aidl
?????文件???????1208??2014-12-16?14:33??EventBusTest\bin\AndroidManifest.xm
?????文件????????252??2010-12-21?19:33??EventBusTest\bin\classes\com\android\internal\telephony\.svn\all-wcprops
?????文件????????419??2010-12-21?19:33??EventBusTest\bin\classes\com\android\internal\telephony\.svn\entries
?????文件??????????2??2010-12-21?19:32??EventBusTest\bin\classes\com\android\internal\telephony\.svn\format
?????文件???????6938??2010-12-21?19:33??EventBusTest\bin\classes\com\android\internal\telephony\.svn\text-ba
?????文件??????12187??2014-12-16?14:33??EventBusTest\bin\classes\com\android\internal\telephony\ITelephony$Stub$Proxy.class
?????文件???????8246??2014-12-16?14:33??EventBusTest\bin\classes\com\android\internal\telephony\ITelephony$Stub.class
?????文件???????6803??2014-12-16?13:25??EventBusTest\bin\classes\com\android\internal\telephony\ITelephony.aidl
?????文件???????1776??2014-12-16?14:33??EventBusTest\bin\classes\com\android\internal\telephony\ITelephony.class
?????文件????????357??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\BuildConfig.class
?????文件???????2835??2014-12-16?14:40??EventBusTest\bin\classes\com\example\eventbustest\MainActivity$PhoneCallListener.class
?????文件???????3958??2014-12-16?14:40??EventBusTest\bin\classes\com\example\eventbustest\MainActivity.class
?????文件????????358??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$attr.class
?????文件????????479??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$dimen.class
?????文件????????425??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$drawable.class
?????文件????????596??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$id.class
?????文件????????421??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$layout.class
?????文件????????406??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$menu.class
?????文件????????490??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$string.class
?????文件????????449??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R$st
?????文件????????733??2014-12-16?14:33??EventBusTest\bin\classes\com\example\eventbustest\R.class
?????文件????1044812??2014-12-16?14:40??EventBusTest\bin\classes.dex
?????文件?????339694??2014-12-16?14:33??EventBusTest\bin\dexedLibs\android-support-v4-d6b1020f187472ce24223fe12fe3451c.jar
?????文件?????391761??2014-12-16?14:40??EventBusTest\bin\EventBusTest.apk
............此處省略96個(gè)文件信息
評(píng)論
共有 條評(píng)論