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

前端 未结 6 1629
我在风中等你
我在风中等你 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:17

    Yes it can be instantiated. But you have to overcome a couple of hurdles:

    • In your AndroidManifest.xml set

      android:sharedUserId="android.uid.phone"

      within the tag. This is required to prevent a SecurityException from being thrown when protected Intents are sent by the methods you may invoke (like android.intent.action.SIM_STATE_CHANGED).

    • Set

      android:process="com.android.phone"

      in your tag. This is required to allow the invocation of getDefaultPhone() / makeDefaultPhone().

    • To do all this your app must be signed with the system signature key.

提交回复
热议问题