How to use android.intent.action.call_ Privileged and android.intent.action.new_ OUTGOING_ CALL?
I can't find the following documents:
android.intent.action.CALL_PRIVILEGED
I see it used to handle calls in csipsimple
I want to better understand how to use it. For example, what is the relationship between android.intent.action.call_ Privileged and android.intent.action.new_ OUTGOING_ CALL?
I added:
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
In the androidmanifest of my project. When the call is started from the native dialer, my activity is called, but if I execute getintent(). Getaction() in onresume, the result is null
edit
I let it handle onnewintent and oncreate. Onresume to receive an intention without action (I guess the default onnewintent handler sends it)
The problem is to check whether the operation is call_ Privileged, I have to hard code the string "Android. Intent. Action. Call_privileged" because the operation call_ Privileged is hidden
I tried just for action_ Call registers the activity, but it does not work
resolvent:
When you make a call from the phone book in the following way, the operation intent android.intent.action.call will be called_ Privileged: phonebook – > contact information – > long-term click on the phone number – > select make a call from the drop-down menu. The following code should be placed in manifest:
<activity>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
There are some changes for HTC:
<activity>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/phone_v2" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity>
When this code is added to the manifest and you try to call as described above, you can get the application chooser and intercept the call in this way and continue to call through the selected application
As for its android.intent.action.new used in broadcastreceivers_ OUTGOING_ Call, when you want to be notified about outgoing calls. For example, if you want to, you should put the following COD in the manifest:
<receiver android:name=".CallReceiver">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
And create:
public class CallReceiver extends BroadcastReceiver{
private static final String TAG = "Call_Receiver";
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
//Notification there
....
}
}
With this feature, you can always be notified when making a call
The main difference between these projects is that the first interception intention and the second can only get the result of something