As to your first approach, the error message means simply that you're
trying to call it in some other thread than the main thread.

While you COULD set up a Looper for the thread you're using, it's
probably NOT what you want to do.

As for the second -- I don't have any info for you, sorry.

On Apr 2, 3:27 pm, jitendra kumar <[email protected]> wrote:
> Dear Bob,
>
> *What does it mean to block an incoming call?*
> This means I want to block incoming call for unknown number. Phone/Dialr app
> should not launch in case of unknown number. In that case mute the ringer is
> not a solution at all.
>
> According to my finding , there are two way of blocking incoming call:
>
> 1) using Phone Object
> 2) using AT command to modem
>
> --- for first approach i am not able to get Phone object. We need to find
> out how can we get Phone object using below function call:
>
> mPhone = PhoneFactory.getDefaultPhone();
>
> I am able to build the project including above function call but while
> executing the application i am getting below exception:
>
> 04-02 09:00:14.852: ERROR/AndroidRuntime(231): java.lang.RuntimeException:
> Unable to start activity
> ComponentInfo{com.android.CMdroid/com.android.CMdroid.CMdroid}:
> java.lang.RuntimeException: PhoneFactory.getDefaultPhone must be called from
> Looper thread.
>  Why Exception???
>
> public static void makeDefaultPhone(Context context)
>
> Looks like when native phone application create default phone using above
> API, at same time PhoneFactory class store thread ID of Phone applicaton .
>
>    public static void makeDefaultPhone(Context context) {
>         synchronized(Phone.class) {
>             if (!sMadeDefaults) {
>                * sLooper = Looper.myLooper();*
>                 sContext = context;
>
>                 if (sLooper == null) {
>                     throw new RuntimeException(
>                         "PhoneFactory.makeDefaultPhone must be called from
> Looper thread");
>                 }
> When other application call getDefaultPhone() to get Phone object, in that
> case getDefaultPhone checks for phone thread ID which is store in variable
> called * sLooper*.
>
> public static Phone getDefaultPhone() {
>         if (sLooper != Looper.myLooper()) {
>             throw new RuntimeException(
>                 "PhoneFactory.getDefaultPhone must be called from Looper
> thread");
>         }
>
> This is the reason why we are getting exception when we call:
>
>  mPhone = PhoneFactory.getDefaultPhone();
>
> --- For 2nd approach we need to know how to send call disconnect command to
> modem using AT command.
>
> *The ATResponseParser class parses part of the AT command syntax used*
> *to**communicate with the mobile radio hardware in a mobile handset.
> This
> ** is, in fact, a* * command syntax very much like the AT command syntax
> used by modems, a ** standard* * described in the 3GPP document number TS
> 27.007 and related** specifications.*
>
> We need to find out how / what command pass to modem to disconnect the call.
>
> Regards,
> Jitendra Kumar
>
>
>
> On Mon, Mar 22, 2010 at 8:44 PM, Bob Kerns <[email protected]> wrote:
> > What does it mean to block an incoming call?
>
> > My guess is it just not ring.
>
> > In that case, it may simply mute the ringer, and register a
> > PhoneStateListener with the TelephonyManager. If it likes the number
> > in onCallStatechanged, it turns on the ringer.
>
> > I haven't tried it, and I haven't tried the app, either. I just read
> > the documentation.
>
> > On Mar 22, 4:17 am, jitendra kumar <[email protected]> wrote:
> > > Thanks Bibek for the information.
>
> > > *If we can't block incoming call using android SDK,  in that case how
> > > GBlocker application works???*
>
> > > *GBlocker Application Link:*
> >http://bubiloop.com/android-communication-gblocker
>
> > > Regards,
> > > Jitendra Kumar
>
> > > On Wed, Mar 10, 2010 at 11:54 PM, Kumar Bibek <[email protected]>
> > wrote:
> > > > Not possible.
>
> > > > Thanks and Regards,
> > > > Kumar Bibek
>
> > > > On Mar 10, 2:40 pm, jitendra kumar <[email protected]> wrote:
> > > > > Hi All,
>
> > > > > I want to develop one call control application on android. As we know
> > > > > android sdk does not provide any API which block incoming call due to
> > > > > security reasion.
>
> > > > > Is there any possiablity to block incoming call using android open
> > source
> > > > api;s?
>
> > > > > Please help me.
>
> > > > > Thanks,
> > > > > Jitendra Kumar
>
> > > > --
> > > > 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]<android-developers%2Bunsubs
> > > >  [email protected]><android-developers%2Bunsubs
> > [email protected]>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > 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]<android-developers%2Bunsubs 
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe from this group, send email to android-developers+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.

-- 
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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to