I need to know when a certain intent (in my case ACTION_CALL
and ACTION_CALL_PRIVILEGED
which are called when the user or an app make a phone call) was sent without registering my activity to handle it.
I don't want to interfere with the normal handling of that intent, i.e. the activity that's supposed to handle it should still handle it the usual manner (in my case the OutgoingCallBroadcaster
).
I read here a suggestion to drop the ACTION_CALL_PRIVILEGED
intent and issue another one, but want to avoid it. Moreover, I don't want to use an activity for the ACTION_CALL
and issue another since it will appear in the intent chooser as an option and I want it to be transparent to the user and to always work.
Also working with the ActivityManager
object like this suggestion is not recommended for core logic as stated in the documentation of the getRecentTasks
method.
Please tell me if this is possible in Android, and if so how.
Thanks, Amitai
No. This isn't possible. If it were possible it would allow me to write an app that monitors a user's behaviour without him knowing it. ACTION_CALL is an Intent
to launch an Activity
. You can, of course, intercept this, but that is clearly not what you want to do.
There are broadcast Intent
s that are sent out during the "call" process. You can monitor these, but you'll have to register to listen for them. Since you indicated that you don't want to register any listeners you are pretty much out of luck.
Which is a good thing, because otherwise people would be able to write a "NastyWare" application.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句