Can a telephony.Phone object be instantiated through the sdk?

前端 未结 6 1631
我在风中等你
我在风中等你 2020-12-04 18:43

I am trying to get a phone object so that I can call and conference two numbers from within my application.

I have tried using the static PhoneFactory.makeDefa

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 19:15

    Al least we can answer or ignore calls =) let me copy-paste my post

    OMG!!! YES, WE CAN DO THAT!!!
    I was going to kill myself after severe 24 hours of investigating and discovering... But I've found a "fresh" solution!

    // "cheat" with Java reflection to gain access
    // to TelephonyManager's ITelephony getter
    Class c = Class.forName(tm.getClass().getName());
    Method m = c.getDeclaredMethod("getITelephony");
    m.setAccessible(true);
    telephonyService = (ITelephony)m.invoke(tm);
    

    People who want to develop their call-control software visit this start point: http://www.google.com/codesearch/p?hl=en#zvQ8rp58BUs/trunk/phone/src/i4nc4mp/myLock/phone/CallPrompt.java&q=itelephony%20package:http://mylockforandroid%5C.googlecode%5C.com&d=0

    There is a project. and there are important comments (and credits).

    In short: copy AIDL file, add permissions to manifest, copy-paste source for telephony management.

    Some more info for you. AT commands you can send only if you are rooted. Than you can kill system process and send commands but you will need a reboot to allow your phone to receive and send calls.

    I'm very happy! =) Now my Shake2MuteCall will get an update !

提交回复
热议问题