[Q] How to force stop BluetoothServerSocket from waiting incoming connection? - Android Software Development

I'm developing app with accepts incoming Bluetooth connections. But i have problem when i try to interrupt accepting state started with accept(). Normally it should be done by calling sth. like myServerSocket.stop() as it is described in docs. But in fact it never stops and giving "ERROR/BluetoothSppPort(2211): invalid port state for disconnection" in LogCat.
The result of this - i can connect to phone when it shouldn't accept any Bluetooth connections. Also consecutive turn-on turn-off cycles produces dozens hung in "wait" Threads.
Now i see only one dirty half-solution to interrupt Accept state - disabling and re-enabling bluetooth instead of stop(). But it doesn't protect from tons unused threads.
Another way - is staring accept with timeout but i'm not sure how to do it correctly to make app receive connections all time without interruptions.
Does any one encountered same problem? Can You advice some?

Related

Power on / power off using TAPI : odd errors occurring

I'm using the standard TAPI commands for powering the device on and off (lineSetEquipmentState()). This works fine most of the time. However, it can often get into a state where neither functions work with the function reporting the 'operation failed' TAPI code. The only way of fixing this is to warm start the device.
The problem seems to stem from a timing issue as if I turn the module on then off quickly using the line function I will often receive these errors. Once I receive one failure it is almost impossible to recover. Unfortunately this problem is quite unpredictable.
Secondly, some SIMs have given us problems on power up. The only way I found to get round this is to call lineGetEquipmentState() directly after the lineSetEquipmentState() function. While this (hack) works I have no idea why.
This problem is affecting both XDA and XDAII, but is more pronounced on the XDAII. It would be nice to know what is causing the problem and what can be done to counter-act it. Anyone have any ideas?

Phone freezing

Hi,
I have a big problem with my Tytn (sorry if this is already been posted). Quite often the phone freezes, making it impossible to turn on again. The only thing that works is a soft-reset. What is worse, is that when the phone is in this state, although the green light is regularly flashing, it is unable to get phone calls even if the caller gets the normal ringing signal. No trace is left of the call, neither in calls list! This is a really serious issue: please, let me know if you have an idea of how to solve the problem.
Thanks!
I am having the same issue. I haven't been able to isolate it. I was havign to0 restart 1-2 times a day. Same systems press the power button nothing. Lights blinking everything looks ok. but nothing on the screen. and i miss calls. really pain in the ass. I loaded mobile secretary and it hasn;t locked in a day or two which is odd.
I also sometimes have to rpess the power button two times for it to wake
me too
It's happening to me too. I will lose service and the phone doesn't go out and poll automatically when service should be good. It may show 1, 2, 3 bars then when I try to make a call it hangs, and then get an x and a Y!, then searches for service. I have the GSM only hack installed and the activesync workaround and it still does this. It is not useable as a phone.
do a search in this forum.
one relevant thread here:
http://forum.xda-developers.com/showthread.php?t=285974
With all due respect, there is no solution where the link leads to.
I am having the GSM problem also. Just from time to time I am noticing an exclamation mark near the 'antennae' icon in the top bar. When I tap it, I read 'Service unavailable' in the balloon. From that point I may either soft-reset, or switch GSM flight mode on and off, which brings the PIN code keyboard and the phone works again.
I really don't think it is related to power saving, as it happened a few times in the car with TyTN on external power.
mnez said:
With all due respect, there is no solution where the link leads to.
I am having the GSM problem also. Just from time to time I am noticing an exclamation mark near the 'antennae' icon in the top bar. When I tap it, I read 'Service unavailable' in the balloon. From that point I may either soft-reset, or switch GSM flight mode on and off, which brings the PIN code keyboard and the phone works again.
I really don't think it is related to power saving, as it happened a few times in the car with TyTN on external power.
Click to expand...
Click to collapse
I think warmkiwi's link may be relevant to jimwormold's original post, which may not be related to your and angled1's problem of failing to poll correctly after dropping it's signal.
Mike
yes, it was. sorry, i should have quoted the original author (jimwormold)
well, sorry for being so picky on you :|
Now when we have defragmented the conversation I wonder if the GSM problem is reported more widely? and what is supposed to do in order to isolate the problem and fix it...?
jimwormold said:
Quite often the phone freezes, making it impossible to turn on again. The only thing that works is a soft-reset. What is worse, is that when the phone is in this state, although the green light is regularly flashing, it is unable to get phone calls
Click to expand...
Click to collapse
Sorry to do a "me too" posting, but I experience the exact same symptoms. There is no obvious pattern to when this happens, but it is a major problem, as there is no way (other than trying to switch it on) to distinguish whether the phone is working or not at any given moment.
I am running the latest (South African) ROM on my Vario II.
Philip said:
Sorry to do a "me too" posting, but I experience the exact same symptoms. There is no obvious pattern to when this happens, but it is a major problem, as there is no way (other than trying to switch it on) to distinguish whether the phone is working or not at any given moment.
I am running the latest (South African) ROM on my Vario II.
Click to expand...
Click to collapse
Given this thread now appears to have two distinct issues running together I better be clear that I am referring to the lock-up/freezing issue not the dropped GSM signal issue!!
To be honest there are quite a few possible causes for the freezing issue(s). I would suggest searches and the wiki on such things as (and you may or may not have tried some already):
1. Use of a Task Manager to properly shut running programmes otherwise they contiue to run in the background
2. Proper shutting down of Active Sync in addition to any task manager you may have, as it can re-start itself automatically (particularly overnight. Look for the "Fake Server Trick")
3. Always shut down Wifi when not in use (vital particularly overnight but also good practice to avoid lock ups)
4 For overnight and possibly other quiet times you can consider having your device automatically perform a soft reset to clear any running programmes that may block alarms/receipt of mail etc. Look for such things as xbar or SK schema
Mike
mikechannon said:
Given this thread now appears to have two distinct issues running together I better be clear that I am referring to the lock-up/freezing issue not the dropped GSM signal issue!!
1. Use of a Task Manager to properly shut running programmes otherwise they contiue to run in the background
2. Proper shutting down of Active Sync in addition to any task manager you may have, as it can re-start itself automatically (particularly overnight. Look for the "Fake Server Trick")
Click to expand...
Click to collapse
Yes indeed, although I think that both: a Phone App problem, and a GSM signal problem, are indeed the same, maybe only differently percepted and described by users affected.
I need ActiveSync to be running in order for DirectPush to work. If it conflicts with the phone, it makes the device unusable concerning push email functionality.
mnez said:
Yes indeed, although I think that both: a Phone App problem, and a GSM signal problem, are indeed the same, maybe only differently percepted and described by users affected.
I need ActiveSync to be running in order to DirectPush work. If it conflicts with the phone, it makes the device unusable concerning push email functionality.
Click to expand...
Click to collapse
I agree they may be cause and effect for some folks. Although I don't believe we can say that all the freezing and lock-ups are due to dropped GSM signal and freezing when failing to re-establish it. The items I list either taken together or individually have been found by others to work in some cases.
I appreciate that if you require Active Sync running then this is not a solution for you. I think the issue of crashing on loss of signal requires more analysis and I'm not aware of much discussion of it - though I could be wrong!!
Mike
I was fiddling with the phone yesterday and today, and I have a hypothesis that my problem is related to PIN entry screen that won't pop up but is silently awaiting a PIN underneath.
I was trying to ucheck the "Require PIN when phone is used" box in Settings but with no luck, my PIN is then refused with "Unknown SIM Error" message. Maybe it wants a PUK but I don't have it on hand to try.
My plan now is to:
- uninstall all Phone-related applications (PhonePlus, Dark_Blue Buttons, EZDial),
- request PUK from my office and try to uncheck the box,
- try prepaid SIM card which has no PIN
To observe symptoms I need two-three days, so I will rather not be posting until solid data is collected.
ps Mike, it is a pleasure to be on a board with people like you.
mnez said:
I was fiddling with the phone yesterday and today, and I have a hypothesis that my problem is related to PIN entry screen that won't pop up but is silently awaiting a PIN underneath.
I was trying to ucheck the "Require PIN when phone is used" box in Settings but with no luck, my PIN is then refused with "Unknown SIM Error" message. Maybe it wants a PUK but I don't have it on hand to try.
My plan now is to:
- uninstall all Phone-related applications (PhonePlus, Dark_Blue Buttons, EZDial),
- request PUK from my office and try to uncheck the box,
- try prepaid SIM card which has no PIN
To observe symptoms I need two-three days, so I will rather not be posting until solid data is collected.
ps Mike, it is a pleasure to be on a board with people like you.
Click to expand...
Click to collapse
Very kind of you to say so
Look forward to seeing your findings.
Mike
new phone
I'm on day 2 of my replacement phone from Cingular and the problem with losing gsm signal is non existent. The problem was hardware and fixed by calling and getting a warranty replacement phone. I'll let you know if the problem returns. Oh, and I have not been using the gsm only hack. I'm trying to see if the phone will work as designed first.
angled1 said:
I'm on day 2 of my replacement phone from Cingular and the problem with losing gsm signal is non existent. The problem was hardware and fixed by calling and getting a warranty replacement phone. I'll let you know if the problem returns. Oh, and I have not been using the gsm only hack. I'm trying to see if the phone will work as designed first.
Click to expand...
Click to collapse
Good news - hope it continues to work well.
Mike
I am reporting from the test field that my problem persists, despite uninstalling all phone-related extenders.
I have noticed that freezing is paired with disabling Bluetooth. So after switching the phone off (flight mode on) and back on (flight mode off), I also have to turn on Bluetooth.
EDIT: I was grounded for last few days at home and freezing problem was not occuring. I am now thinking that it may be related to switching band between GPRS and UMTS. My next step will be disabling UMTS for good. It saves a whole lotta battery, by the way. I am for the third day mostly on standby, with a few calls made, and I am still on 70%! (no 3G in the area)
I have contacted my vendor and asked about replacement policy, they are "checking this with the importer". It's a beauty of living in not-so-western country. Poland is the name.
mnez said:
EDIT: I was grounded for last few days at home and freezing problem was not occuring. I am now thinking that it may be related to switching band between GPRS and UMTS. My next step will be disabling UMTS for good. It saves a whole lotta battery, by the way. I am for the third day mostly on standby, with a few calls made, and I am still on 70%! (no 3G in the area)
Click to expand...
Click to collapse
I'm having exactly the same problem, very annoying because the staus LEDs keep blinking as normal. I too think the problem is UMST-GPRS switching related, as I also have problems when phoning while I drive with my car from a UMTS enabled into a GPRS only zone. The voice call is interupted and I get a loud noise, sounding like a scrambled voice, on both sides of the connection. At home my UMTS signal is very weak, so I think it happens when I move around the house to a place where the TyTN switches to GPRS.
I've put my TyTN to "GSM network" only now to see if this helps, but I use UMTS frequently so this is no long term solution for me.
pbw
same problem here, only gsm wil not help, new sim cards wont help either even other provider wont help
check: http://forum.xda-developers.com/showthread.php?t=287669
treid several different roms nothing will help
good luck
Hi,
mine was siffering of freezing issue, I sent a mail to HTC support, they don't know about it but the guy said me that I must to hard reset my device. Then no more freezes, I will keep testing it.
Regards,
Taguapire.
BTW: I changed my old and almost destroyed SIM card by a new one.

Jade won't run schedule receive/send email when sleep

I just got my Jade last week and found out this issue of it not being able to run the schedule email receive/send for every 15 mins (doesn't work on 10 or 30 either... did not try the others) when in sleep mode. However, it seems to work fine when I put it to charge.
Another issue is the sms notification (saw that in another thread but no solution thus far). It doesn't seems to vibrate or play the notification sound when new sms arrives after sleeping for a long while. However, when I wake it up (pushing the on/off button), it will immediately vibrate and plays the notification sound. I suspect it could be due to me charging the phone overnight. It looks like it is happening when the phone is fully charged.
Not sure anyone there facing the same problem?
ROM: 1.40.707.2 (21259)
Although I think the Jade is the best HTC phone I've owned (and I've owned many), it does have one big issue with its behaviour in suspend mode. I posted a thread on the problems with Microsoft Direct Push here earlier - http://forum.xda-developers.com/showthread.php?t=457516
Other symptoms you might see are text message (SMS) notifications not always coming through until you resume from suspend and other 3rd party software failing to respond to events in suspend mode.
I've got an ongoing case open with HTC support on this issue - despite providing detailed information, including ActiveSync logs from the device itself they are still in the denial phase. I would urge anyone else with any of these "suspend" mode issues to report them to HTC support - maybe if they start getting a few reports of the same issue they'll investigate it properly and fix it in a subsequent firmware update (assuming they're ever going to release a bug-fix firmware update for the 3G).
SMS
In fact it's set like that, i don't know why but you should get the advenced config tool somewhere in this forum and you can enable these settings in Messaging.

*DO NOT USE BT*ROM Memory Leak Filling Up Internal Memory causing fatal SMS failure

This exact issues cause me not to receive anymore SMS text and 0 free memory.
http://community.sprint.com/baw/message/128509#128509
I am experiencing the same issue posted over at androidforums.com. Today I had to take my phone back due to 0 amount of memory left on the device and no SMS or voicemails being received on the device. This along with the sleep issue is unacceptable and I have no clue how Sprint and HTC released devices with such obvious flaws. I was fiving Sprint and HTC another chance after my 6 month disaster of the HTC Touch Pro. Over that time I exchanged it 5 time due to the keyboard failing.
Here is the EXACT same issue I am experiencing: CLICK ME! or read below.
ROM Memory Leak Filling Up Internal Memory
Issue:
Over time, Internal Memory free space dwindles and no amount of clearing apps frees the space. This will also cause the above issue of SMS & Voicemail messages not being received once a critical amount of free space is reached.
During the past few weeks my my Hero has been exhibiting signs of a ROM memory leak. It led to not being able to receive SMS messages even after hard resetting the phone. See these threads for that issue:
HTC Working on critical SMS/Voicemail issue
Intermittent Text Message Receiving - Deals more with intermittent issue, but has some fatal sms isuues in it too.
MMS/SMS stopped working after out of space error?!?
It appears a leak is being caused when rebooting (or turning off bluetooth) the phone when the phone is in a "connecting" status with bluetooth device. Basically the phone stays in a "connecting" status when it fails to connect, even though the notification in the notification bar says it is connected and your bluetooth device says it is connected. In actuality it is not and all calls and audio will be routed to your phone not bluetooth device. If you restart or turn off bluetooth while your phone with a "connecting" status active I have found when you reboot it will eat away at your ROM memory(not RAM). You may not ever notice the bluetooth connection failure if you don't get a call while when it should be active. The "connecting" status does not clear unless you unless it manages to connect after a while which is rare (either does it within a few seconds or not at all) . I made a video of this behavior because not a lot of people have been experiencing or at least catching on to it with their usage patterns.
Edit: It appears that the leak actually occurs even if you turn bluetooth off while the phone is in connecting status so a reset is not necessary for the leak to occur. This basically renders bluetooth use unusable as there is no way I can think of to avoid a leak if it gets stuck with the "connecting" status.
Sorry for the video orientation.
YouTube - HTC Sprint Hero ROM memory leak, possible SMS failure Part 1
YouTube - HTC Sprint Hero ROM memory leak, possible SMS failure Part 2
I just returned my first hero today and set up everything all over again. i use bluetooth a lot on the phone, about 4 hrs a day, and would stop getting sms messages. the problem was fixed with a soft reset until recently, which they then told me to get a new one. i guess i will try to deal without using bluetooth for a while and see if any new info comes up or if i get the problem again.
this same thing happened to me too, wish I would have seen this earlier. I was having some BT issues so everything would connect and then disconnect.. so I had to get a new phone too
Can't wait for a patch!
The bluetooth issue isn't settling with me well. I used to use bluetooth daily, now I can't. Htc needs go adress this problem soon....

SMS receiving issues

Hello everyone!
I've got some weird issues with my Samsung Focus. Throughout the day, my phone doesn't receive any messages. It can be for periods of 10 hours. If I shut off my phone for a minute, then turn it on, I'll either get a message then another a minute later..etc.. Or I'll get a flood of messages at one time. The messages were all sent from the past, and come in the proper order, but not at the right times (they have a delay). I didn't have this issue until I started looking around at my diagnostic application so I believe I accidently changed a setting in it. I've already talked to at&t but the store here won't do much with it because the water indicator is red. I have my phone in developer unlocked state (I sideload apps and apps that I make). The reset data functions don't seem to change the diagnostic settings back, so I'm thinking I'll have to flash it with an original rom, but I'm not an expert by any means, but I'll understand whatever instructions or tests that are given.
Any help on this would be greatly appreciated. I haven't had a phone that never had text messaging issues so this is a bit annoying for me when people think you're ignoring them.
Trikun3 said:
Hello everyone!
I've got some weird issues with my Samsung Focus. Throughout the day, my phone doesn't receive any messages. It can be for periods of 10 hours. If I shut off my phone for a minute, then turn it on, I'll either get a message then another a minute later..etc.. Or I'll get a flood of messages at one time. The messages were all sent from the past, and come in the proper order, but not at the right times (they have a delay). I didn't have this issue until I started looking around at my diagnostic application so I believe I accidently changed a setting in it. I've already talked to at&t but the store here won't do much with it because the water indicator is red. I have my phone in developer unlocked state (I sideload apps and apps that I make). The reset data functions don't seem to change the diagnostic settings back, so I'm thinking I'll have to flash it with an original rom, but I'm not an expert by any means, but I'll understand whatever instructions or tests that are given.
Any help on this would be greatly appreciated. I haven't had a phone that never had text messaging issues so this is a bit annoying for me when people think you're ignoring them.
Click to expand...
Click to collapse
try this fix. it has fixed my issue with txt not coming in.
*#197328640#
1 Debug
8 Phone Control
7 Network Control
1 GCF
3 Setting Cancellation
End
Soft Reset phone (Reboot)
You can test by texting yourself (your mobile number)

Categories

Resources