Closed GoogleCodeExporter closed 8 years ago
I've yet another patch for state management :) With the following patch, the
service is more "reactive" to external state changes - ie, we don't trust what
we *think* the state is, we use what the connection state actually is. The
actual connection state may change behind our back - eg, as a network error is
handled, or as a scheduled retry finally connects.
This patch also makes things more thread-safe - the worker thread is now
responsible for handling incoming chat messages - previously onMessageReceived
was called on the main thread leading to the possibility of the worker thread
handling state changes *while* a message was being sent.
It is fairly large, but my testing shows it works perfectly ;) A limitation
though is that changes to connection preferences will likely not be picked up
after a connection is established - we probably just need a property-change
listener, but I thought I'd leave that out of this...
FWIW, this bug also fixes the new bug re the "GTalkSMS stopped" toast message
not being removed (as this message is now only ever generated by the main
thread, not the worker thread...
Original comment by skippy.hammond@gmail.com
on 5 Jan 2011 at 7:59
Attachments:
Bugger - just saw the app crash with that patch when a call was received - I'll
check it out...
Original comment by skippy.hammond@gmail.com
on 5 Jan 2011 at 9:54
That's not your patch, on market someone has the same error on the 1.6:
java.lang.IllegalArgumentException: URI:
content://com.android.contacts/phone_lookup/, calling user:
com.googlecode.gtalksms, calling package:com.googlecode.gtalksms
at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:144)
at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
at
android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.jav
a:330)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
at android.content.ContentResolver.query(ContentResolver.java:250)
at
com.googlecode.gtalksms.data.contacts.ContactsManager.getContactName(ContactsMan
ager.java:32)
at
com.googlecode.gtalksms.receivers.PhoneCallListener.onCallStateChanged(PhoneCall
Listener.java:30)
at
android.telephony.PhoneStateListener$2.handleMessage(PhoneStateListener.java:319
)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.os.HandlerThread.run(HandlerThread.java:60)
Original comment by Florent....@gmail.com
on 5 Jan 2011 at 9:57
Original comment by Florent....@gmail.com
on 5 Jan 2011 at 9:19
Original comment by Florent....@gmail.com
on 5 Jan 2011 at 9:36
Original comment by fschm...@gmail.com
on 25 Aug 2011 at 7:51
Original issue reported on code.google.com by
skippy.hammond@gmail.com
on 4 Jan 2011 at 8:08