kopia lustrzana https://github.com/ge0rg/aprsdroid
abort tracking if tcp connection fails
rodzic
bff3bd84ee
commit
597e811229
|
|
@ -209,5 +209,12 @@ class AprsService extends Service with LocationListener {
|
|||
def postSubmit(post : String) {
|
||||
handler.post { addPost(StorageDatabase.Post.TYPE_INCMG, "incoming", post) }
|
||||
}
|
||||
|
||||
def postAbort(post : String) {
|
||||
handler.post {
|
||||
addPost(StorageDatabase.Post.TYPE_ERROR, "Error", post)
|
||||
stopSelf()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,11 @@ class TcpUploader(service : AprsService, hostname : String, login : String, filt
|
|||
|
||||
override def run() {
|
||||
Log.d(TAG, "TcpSocketThread.run()")
|
||||
catchLog("init_socket", init_socket)
|
||||
try {
|
||||
init_socket()
|
||||
} catch {
|
||||
case e : Exception => service.postAbort(e.getMessage())
|
||||
}
|
||||
while (running) {
|
||||
try {
|
||||
Log.d(TAG, "waiting for data...")
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue