Hi all,

I'm just doing an application that controls who to call and how many
rings let the call do. For example, to not wake up someone in the
morning we only do 3 tones...

I'm using the standard BroadcastReceiver method to stop the call from
going out.

I explain here for the people who want to do it, also.

[ Manifiest ]
1.- You need enough permissions:
        <uses-permission
android:name="android.permission.PROCESS_OUTGOING_CALLS" />
        <uses-permission android:name="android.permission.CALL_PHONE" />

To make calls and process outgoing calls.

2.- You need a broadcast receiver that catches the broadcast intent:

                <receiver android:name=".receiver.PhoneOutgoingCallReceiver"
                        android:enabled="true" >
                        <intent-filter android:priority="0">
                                <action 
android:name="android.intent.action.NEW_OUTGOING_CALL" />
                        </intent-filter>
                </receiver>

[ Code ]

3.- You controls who can call in the:

@Override
        public void onReceive(Context context, Intent intent) {

}

4.- If you don't want to let any call go out you can:

@Override
        public void onReceive(Context context, Intent intent) {
        setResultData(null);
}

5.- Use the to get the call information.

        Bundle extras = intent.getExtras();

                                for(Iterator<String> 
it=extras.keySet().iterator(); it.hasNext();)
                                {
                                        String key = it.next();
                                        Log.d(LOG_TAG, key);
                                        Log.d(LOG_TAG, "Value: " + 
extras.getString(key));
                                }

BUT!

With this I can only censure calls, can't control how many time the
ring sounds.

the question is:


How can I delay a little bit the call cancellation?

I want to make it sound, for example, 3 seconds and then hang up.

Thank you all!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to