From 3d60ee701e33897628187a51f1987048dfe6fdf5 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 17 Apr 2012 19:23:15 -0700 Subject: [PATCH] honor setting for toast showing messages sent and received --- .../XWords4/src/org/eehouse/android/xw4/SMSService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java index 040aabeae..aed84da74 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java @@ -209,7 +209,10 @@ public class SMSService extends Service { } break; case HANDLE: - DbgUtils.showf( this, "got %dth sms", ++m_nReceived ); + ++m_nReceived; + if ( s_showToasts ) { + DbgUtils.showf( this, "got %dth msg", m_nReceived ); + } String buffer = intent.getStringExtra( BUFFER ); String phone = intent.getStringExtra( PHONE ); receiveBuffer( buffer, phone ); @@ -479,7 +482,9 @@ public class SMSService extends Service { DbgUtils.logf( "Message \"%s\" of %d bytes sent to %s.", asPublic, asPublic.length(), phone ); } - DbgUtils.showf( this, "sent %dth msg", s_nSent ); + if ( s_showToasts ) { + DbgUtils.showf( this, "sent %dth msg", s_nSent ); + } success = true; } catch ( IllegalArgumentException iae ) { DbgUtils.logf( "%s", iae.toString() );