pass TAG to printStack() and logex

So they'll show up when using logcat filtering
This commit is contained in:
Eric House 2016-12-09 07:34:51 -08:00
parent 25c2fd16ef
commit a1e4d4da0e
32 changed files with 122 additions and 120 deletions

View file

@ -1085,7 +1085,7 @@ public class BTService extends XWService {
try {
m_listener.join( 100 );
} catch ( InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
m_listener = null;
}
@ -1096,7 +1096,7 @@ public class BTService extends XWService {
try {
m_sender.join( 100 );
} catch ( InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
m_sender = null;
}
@ -1179,7 +1179,7 @@ public class BTService extends XWService {
private void logIOE( IOException ioe )
{
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
++s_errCount;
// if ( 0 == s_errCount % 10 ) {
postEvent( MultiEvent.BT_ERR_COUNT, s_errCount );
@ -1222,7 +1222,7 @@ public class BTService extends XWService {
try {
socket.close();
} catch( IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
} );

View file

@ -79,11 +79,11 @@ public class BiDiSockWrap {
mIface.connectStateChanged( BiDiSockWrap.this, true );
break;
} catch ( java.net.UnknownHostException uhe ) {
DbgUtils.logex( uhe );
DbgUtils.logex( TAG, uhe );
} catch ( IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
} catch ( InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
waitMillis = Math.min( waitMillis * 2, 1000 * 60 );
}
@ -102,7 +102,7 @@ public class BiDiSockWrap {
try {
send( packet.getBytes( "UTF-8" ) );
} catch ( java.io.UnsupportedEncodingException uee ) {
DbgUtils.logex( uee );
DbgUtils.logex( TAG, uee );
}
}
@ -138,7 +138,7 @@ public class BiDiSockWrap {
try {
mSocket.close();
} catch ( IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
mIface.connectStateChanged( this, false );
mQueue.add( new byte[0] );
@ -170,7 +170,7 @@ public class BiDiSockWrap {
mIface.onWriteSuccess( BiDiSockWrap.this );
}
} catch ( IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
closeSocket();
} catch ( InterruptedException ie ) {
Assert.fail();
@ -195,7 +195,7 @@ public class BiDiSockWrap {
mIface.gotPacket( BiDiSockWrap.this, packet );
}
} catch( IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
closeSocket();
}
DbgUtils.logd( TAG, "read thread exiting" );

View file

@ -2287,12 +2287,12 @@ public class BoardDelegate extends DelegateBase
try {
m_forResultWait.acquire();
} catch ( java.lang.InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
if ( DlgID.NONE != m_blockingDlgID ) {
try {
dismissDialog( m_blockingDlgID );
} catch ( java.lang.IllegalArgumentException iae ) {
DbgUtils.logex( iae );
DbgUtils.logex( TAG, iae );
}
}
}
@ -2465,7 +2465,7 @@ public class BoardDelegate extends DelegateBase
RelayService.inviteRemote( m_activity, destDevID,
null, nli );
} catch (NumberFormatException nfi) {
DbgUtils.logex( nfi );
DbgUtils.logex( TAG, nfi );
}
break;
case WIFIDIRECT:
@ -2550,7 +2550,7 @@ public class BoardDelegate extends DelegateBase
m_handler.post( runnable );
} else {
DbgUtils.logw( TAG, "post(): dropping b/c handler null" );
DbgUtils.printStack();
DbgUtils.printStack( TAG );
}
return canPost;
}
@ -2795,7 +2795,7 @@ public class BoardDelegate extends DelegateBase
{
if ( null == m_jniThread ) {
DbgUtils.logw( TAG, "not calling handle(%s)", cmd.toString() );
DbgUtils.printStack();
DbgUtils.printStack( TAG );
} else {
m_jniThread.handle( cmd, args );
}

View file

@ -414,7 +414,7 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
{
if ( null == m_jniThread ) {
DbgUtils.logw( TAG, "not calling handle(%s)", cmd.toString() );
DbgUtils.printStack();
DbgUtils.printStack( TAG );
} else {
m_jniThread.handle( cmd, args );
}

View file

@ -95,7 +95,7 @@ public class CommsTransport implements TransportProcs,
closeSocket();
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
} catch ( UnresolvedAddressException uae ) {
DbgUtils.logw( TAG, "bad address: name: %s; port: %s; exception: %s",
m_useHost, m_relayAddr.ip_relay_port,
@ -133,7 +133,7 @@ public class CommsTransport implements TransportProcs,
m_relayAddr.ip_relay_port );
m_socketChannel.connect( isa );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
failed = true;
break outer_loop;
}
@ -157,7 +157,7 @@ public class CommsTransport implements TransportProcs,
DbgUtils.logw( TAG, "exiting: %s", ioe.toString() );
DbgUtils.logw( TAG, ioe.toString() );
} catch ( java.nio.channels.NoConnectionPendingException ncp ) {
DbgUtils.logex( ncp );
DbgUtils.logex( TAG, ncp );
closeSocket();
break;
}
@ -205,7 +205,7 @@ public class CommsTransport implements TransportProcs,
break outer_loop;
} catch ( java.nio.channels.
NoConnectionPendingException ncp ) {
DbgUtils.logex( ncp );
DbgUtils.logex( TAG, ncp );
break outer_loop;
}
}
@ -342,7 +342,7 @@ public class CommsTransport implements TransportProcs,
try {
m_thread.join(100); // wait up to 1/10 second
} catch ( java.lang.InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
m_thread = null;
}

View file

@ -387,7 +387,7 @@ public class ConnStatusHandler {
// } catch ( java.lang.ClassNotFoundException cnfe ) {
// DbgUtils.logf( "loadState: %s", cnfe.toString() );
} catch ( Exception ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
}
}
@ -506,7 +506,7 @@ public class ConnStatusHandler {
XWPrefs.setPrefsString( context, R.string.key_connstat_data,
as64 );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
s_needsSave = false;
}

View file

@ -983,7 +983,7 @@ public class DBUtils {
long result = db.replaceOrThrow( DBHelper.TABLE_NAME_OBITS,
"", values );
} catch ( Exception ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
db.close();
}
@ -1916,13 +1916,13 @@ public class DBUtils {
channelSrc.transferTo( 0, channelSrc.size(), channelDest );
success = true;
} catch( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
} finally {
try {
channelSrc.close();
channelDest.close();
} catch( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
return success;
@ -2280,7 +2280,7 @@ public class DBUtils {
try {
updateStmt.execute();
} catch ( Exception ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
Assert.fail();
}
}
@ -2535,7 +2535,7 @@ public class DBUtils {
invalGroupsCache();
}
} catch( java.io.FileNotFoundException fnfe ) {
DbgUtils.logex( fnfe );
DbgUtils.logex( TAG, fnfe );
}
}

View file

@ -121,10 +121,10 @@ public class DbgUtils {
showf( context, LocUtils.getString( context, formatid ), args );
} // showf
public static void logex( Exception exception )
public static void logex( String tag, Exception exception )
{
logw( TAG, "Exception: %s", exception.toString() );
printStack( exception.getStackTrace() );
printStack( tag, exception.getStackTrace() );
}
public static void assertOnUIThread()
@ -132,20 +132,20 @@ public class DbgUtils {
Assert.assertTrue( Looper.getMainLooper().equals(Looper.myLooper()) );
}
public static void printStack( StackTraceElement[] trace )
public static void printStack( String tag, StackTraceElement[] trace )
{
if ( s_doLog && null != trace ) {
// 1: skip printStack etc.
for ( int ii = 1; ii < trace.length; ++ii ) {
DbgUtils.logd( TAG, "ste %d: %s", ii, trace[ii].toString() );
DbgUtils.logd( tag, "ste %d: %s", ii, trace[ii].toString() );
}
}
}
public static void printStack()
public static void printStack( String tag )
{
if ( s_doLog ) {
printStack( Thread.currentThread().getStackTrace() );
printStack( tag, Thread.currentThread().getStackTrace() );
}
}

View file

@ -195,7 +195,7 @@ public class DictUtils {
} catch ( java.io.FileNotFoundException fnf ) {
// DbgUtils.logex( fnf );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -264,7 +264,7 @@ public class DictUtils {
success = DBUtils.copyFileStream( fos, fis );
} catch ( java.io.FileNotFoundException fnfe ) {
DbgUtils.logex( fnfe );
DbgUtils.logex( TAG, fnfe );
}
return success;
} // copyDict
@ -365,7 +365,7 @@ public class DictUtils {
} catch ( java.io.FileNotFoundException fnf ) {
// DbgUtils.logex( fnf );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -478,9 +478,9 @@ public class DictUtils {
invalDictList();
}
} catch ( java.io.FileNotFoundException fnf ) {
DbgUtils.logex( fnf );
DbgUtils.logex( TAG, fnf );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
tmpFile.delete();
}
}
@ -565,7 +565,7 @@ public class DictUtils {
AssetManager am = context.getAssets();
return am.list("");
} catch( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
return new String[0];
}
}

View file

@ -1243,7 +1243,7 @@ public class DictsDelegate extends ListDelegateBase
}
} catch ( JSONException ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
theOne = null;
}
}
@ -1423,7 +1423,7 @@ public class DictsDelegate extends ListDelegateBase
success = true;
} catch ( JSONException ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
}

View file

@ -138,11 +138,11 @@ public class DwnldDelegate extends ListDelegateBase {
}
is.close();
} catch ( java.net.URISyntaxException use ) {
DbgUtils.logex( use );
DbgUtils.logex( TAG, use );
} catch ( java.net.MalformedURLException mue ) {
DbgUtils.logex( mue );
DbgUtils.logex( TAG, mue );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
return null;
}
@ -218,9 +218,9 @@ public class DwnldDelegate extends ListDelegateBase {
fos.close();
success = !cancelled;
} catch ( java.io.FileNotFoundException fnf ) {
DbgUtils.logex( fnf );
DbgUtils.logex( TAG, fnf );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
if ( !success ) {

View file

@ -96,7 +96,7 @@ public class GCMIntentService extends GCMBaseIntentService {
RelayService.processGameMsgs( context, connname, strs64 );
}
} catch (org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
@ -133,7 +133,7 @@ public class GCMIntentService extends GCMBaseIntentService {
DbgUtils.logw( TAG, "Device can't do GCM." );
} catch ( Exception whatever ) {
// funky devices could do anything
DbgUtils.logex( whatever );
DbgUtils.logex( TAG, whatever );
}
}
}

View file

@ -58,7 +58,7 @@ public class GameLock {
if ( DEBUG_LOCKS ) {
DbgUtils.logi( TAG, "GameLock(rowid:%d,isForWrite:%b)=>"
+ "this: %H", rowid, isForWrite, this );
DbgUtils.printStack();
DbgUtils.printStack( TAG );
}
}
@ -139,16 +139,16 @@ public class GameLock {
DbgUtils.logi( TAG, "lock() %H failed; sleeping", this );
if ( 0 == sleptTime || sleptTime + SLEEP_TIME >= ASSERT_TIME ) {
DbgUtils.logi( TAG, "lock %H seeking stack:", curOwner );
DbgUtils.printStack( curOwner.m_lockTrace );
DbgUtils.printStack( TAG, curOwner.m_lockTrace );
DbgUtils.logi( TAG, "lock %H seeking stack:", this );
DbgUtils.printStack();
DbgUtils.printStack( TAG );
}
}
try {
Thread.sleep( SLEEP_TIME ); // milliseconds
sleptTime += SLEEP_TIME;
} catch( InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
break;
}

View file

@ -225,7 +225,7 @@ public class GameUtils {
try {
lock = new GameLock( rowid, false ).lock( maxMillis );
} catch ( GameLock.GameLockedException gle ) {
DbgUtils.logex( gle );
DbgUtils.logex( TAG, gle );
}
}
@ -1254,7 +1254,7 @@ public class GameUtils {
fos.close();
result = file;
} catch ( Exception ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
}
return result;

View file

@ -2423,7 +2423,7 @@ public class GamesListDelegate extends ListDelegateBase
launchGame( rowid );
}
} catch ( GameLock.GameLockedException gle ) {
DbgUtils.logex( gle );
DbgUtils.logex( TAG, gle );
finish();
}
}

View file

@ -289,7 +289,7 @@ public class LookupAlert extends LinearLayout
try {
context.startActivity( intent );
} catch ( android.content.ActivityNotFoundException anfe ) {
DbgUtils.logex( anfe );
DbgUtils.logex( TAG, anfe );
}
}
} // lookupWord

View file

@ -178,7 +178,7 @@ public class NagTurnReceiver extends BroadcastReceiver {
al.add(value);
}
} catch ( Exception ex ) {
DbgUtils.logex(ex);
DbgUtils.logex( TAG, ex );
}
}
if ( 0 < al.size() ) {

View file

@ -350,7 +350,7 @@ public class NetLaunchInfo {
result = obj.toString();
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
// DbgUtils.logf( "makeLaunchJSON() => %s", result );
return result;
@ -441,7 +441,7 @@ public class NetLaunchInfo {
}
} catch ( JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
removeUnsupported( supported );

View file

@ -72,9 +72,9 @@ public class NetUtils {
socket.setSoTimeout( timeoutMillis );
} catch ( java.net.UnknownHostException uhe ) {
DbgUtils.logex( uhe );
DbgUtils.logex( TAG, uhe );
} catch( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
return socket;
}
@ -129,7 +129,7 @@ public class NetUtils {
DBUtils.clearObits( m_context, m_obits );
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
}
@ -199,7 +199,7 @@ public class NetUtils {
}
} catch( Exception npe ) {
DbgUtils.logex( npe );
DbgUtils.logex( TAG, npe );
}
return msgs;
} // queryRelay
@ -225,10 +225,10 @@ public class NetUtils {
result = (HttpURLConnection)new URL(url).openConnection();
} catch ( java.net.MalformedURLException mue ) {
Assert.assertNull( result );
DbgUtils.logex( mue );
DbgUtils.logex( TAG, mue );
} catch ( java.io.IOException ioe ) {
Assert.assertNull( result );
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
return result;
}
@ -276,9 +276,9 @@ public class NetUtils {
DbgUtils.logw( TAG, "runConn: responseCode: %d", responseCode );
}
} catch ( java.net.ProtocolException pe ) {
DbgUtils.logex( pe );
DbgUtils.logex( TAG, pe );
} catch( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -299,7 +299,7 @@ public class NetUtils {
}
result = TextUtils.join( "&", pairs );
} catch ( java.io.UnsupportedEncodingException uee ) {
DbgUtils.logex( uee );
DbgUtils.logex( TAG, uee );
}
return result;

View file

@ -110,7 +110,7 @@ public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
}
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
DbgUtils.logi( TAG, "doInBackground() returning" );
return names.toArray( new String[names.size()] );

View file

@ -534,7 +534,7 @@ public class RelayInviteDelegate extends InviteDelegate {
}
} catch ( org.json.JSONException je ) {
DbgUtils.logex( je );
DbgUtils.logex( TAG, je );
}
stopProgress();

View file

@ -535,7 +535,7 @@ public class RelayService extends XWService
try {
Thread.sleep( 20 );
} catch( java.lang.InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
}
}
@ -592,10 +592,10 @@ public class RelayService extends XWService
DbgUtils.logd( TAG, "connectSocket(%s:%d): m_UDPSocket"
+ " now %H", host, port, m_UDPSocket );
} catch( java.net.SocketException se ) {
DbgUtils.logex( se );
DbgUtils.logex( TAG, se );
Assert.fail();
} catch( java.net.UnknownHostException uhe ) {
DbgUtils.logex( uhe );
DbgUtils.logex( TAG, uhe );
}
} else {
Assert.assertTrue( m_UDPSocket.isConnected() );
@ -637,7 +637,7 @@ public class RelayService extends XWService
resetExitTimer();
ConnStatusHandler.showSuccessOut();
} catch ( java.net.SocketException se ) {
DbgUtils.logex( se );
DbgUtils.logex( TAG, se );
DbgUtils.logi( TAG, "Restarting threads to force"
+ " new socket" );
m_handler.post( new Runnable() {
@ -646,7 +646,7 @@ public class RelayService extends XWService
}
} );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
} catch ( NullPointerException npe ) {
DbgUtils.logw( TAG, "network problem; dropping packet" );
}
@ -671,7 +671,7 @@ public class RelayService extends XWService
m_UDPWriteThread.join();
DbgUtils.logd( TAG, "SUCCESSFULLY joined m_UDPWriteThread" );
} catch( java.lang.InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
m_UDPWriteThread = null;
m_queue.clear();
@ -681,7 +681,7 @@ public class RelayService extends XWService
try {
m_UDPReadThread.join();
} catch( java.lang.InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
m_UDPReadThread = null;
m_UDPSocket = null;
@ -783,7 +783,7 @@ public class RelayService extends XWService
}
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
if ( resetBackoff ) {
@ -860,7 +860,7 @@ public class RelayService extends XWService
postPacket( bas, XWRelayReg.XWPDEV_REG );
s_regStartTime = now;
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
}
@ -884,7 +884,7 @@ public class RelayService extends XWService
postPacket( bas, reg );
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -908,7 +908,7 @@ public class RelayService extends XWService
out.write( msg, 0, msg.length );
postPacket( bas, XWRelayReg.XWPDEV_MSG );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -924,7 +924,7 @@ public class RelayService extends XWService
out.write( msg, 0, msg.length );
postPacket( bas, XWRelayReg.XWPDEV_MSGNOCONN );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -958,7 +958,7 @@ public class RelayService extends XWService
out.write( nliData, 0, nliData.length );
postPacket( bas, XWRelayReg.XWPDEV_INVITE );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -971,7 +971,7 @@ public class RelayService extends XWService
un2vli( header.m_packetID, out );
postPacket( bas, XWRelayReg.XWPDEV_ACK );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
}
@ -1145,7 +1145,7 @@ public class RelayService extends XWService
socket.close();
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
return null;
} // doInBackground
@ -1467,7 +1467,7 @@ public class RelayService extends XWService
out.writeByte( m_cmd.ordinal() );
m_header = bas.toByteArray();
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}

View file

@ -48,7 +48,7 @@ public class SMSReceiver extends BroadcastReceiver {
byte[] body = sms.getUserData();
SMSService.handleFrom( context, body, phone );
} catch ( NullPointerException npe ) {
DbgUtils.logex( npe );
DbgUtils.logex( TAG, npe );
}
}
}

View file

@ -385,7 +385,7 @@ public class SMSService extends XWService {
send( SMS_CMD.INVITE, bas.toByteArray(), phone );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -399,7 +399,7 @@ public class SMSService extends XWService {
send( SMS_CMD.ACK, bas.toByteArray(), phone );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -414,7 +414,7 @@ public class SMSService extends XWService {
send( SMS_CMD.DEATH, bas.toByteArray(), phone );
s_sentDied.add( gameID );
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
}
@ -432,7 +432,7 @@ public class SMSService extends XWService {
nSent = bytes.length;
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
return nSent;
}
@ -533,7 +533,7 @@ public class SMSService extends XWService {
break;
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
}
@ -614,7 +614,7 @@ public class SMSService extends XWService {
success = true;
}
} catch ( java.io.IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
} catch ( ArrayIndexOutOfBoundsException oob ) {
// enum this older code doesn't know about; drop it
DbgUtils.logw( TAG, "disAssemble: dropping message with too-new enum" );
@ -679,7 +679,7 @@ public class SMSService extends XWService {
} catch ( NullPointerException npe ) {
Assert.fail(); // shouldn't be trying to do this!!!
} catch ( Exception ee ) {
DbgUtils.logex( ee );
DbgUtils.logex( TAG, ee );
}
}
} else {

View file

@ -119,7 +119,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
try {
versionCode = pm.getPackageInfo( packageName, 0 ).versionCode;
} catch ( PackageManager.NameNotFoundException nnfe ) {
DbgUtils.logex( nnfe );
DbgUtils.logex( TAG, nnfe );
versionCode = 0;
}
@ -143,7 +143,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
params.put( k_APP, appParams );
params.put( k_DEVID, XWPrefs.getDevID( context ) );
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
@ -158,7 +158,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
params.put( k_DICTS, dictParams );
params.put( k_DEVID, XWPrefs.getDevID( context ) );
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
@ -168,7 +168,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
try {
params.put( k_XLATEINFO, xlationUpdate );
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
@ -182,7 +182,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
new UpdateQueryTask( context, params, fromUI, pm,
packageName, dals ).execute();
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
}
@ -225,7 +225,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
params.put( k_MD5SUM, sum );
params.put( k_INDEX, index );
} catch( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
return params;
}
@ -365,11 +365,11 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
}
}
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
DbgUtils.logw( TAG, "sent: \"%s\"", params.toString() );
DbgUtils.logw( TAG, "received: \"%s\"", jstr );
} catch ( PackageManager.NameNotFoundException nnfe ) {
DbgUtils.logex( nnfe );
DbgUtils.logex( TAG, nnfe );
}
if ( !gotOne && m_fromUI ) {

View file

@ -59,6 +59,7 @@ import java.util.List;
import java.util.Random;
public class Utils {
private static final String TAG = Utils.class.getSimpleName();
public static final int TURN_COLOR = 0x7F00FF00;
private static final String DB_PATH = "XW_GAMES";
@ -140,7 +141,7 @@ public class Utils {
try {
Toast.makeText( context, msg, Toast.LENGTH_SHORT).show();
} catch ( java.lang.RuntimeException re ) {
DbgUtils.logex( re );
DbgUtils.logex( TAG, re );
}
}
@ -431,7 +432,7 @@ public class Utils {
.versionCode;
s_appVersion = new Integer( version );
} catch ( Exception e ) {
DbgUtils.logex( e );
DbgUtils.logex( TAG, e );
}
}
return null == s_appVersion? 0 : s_appVersion;

View file

@ -317,7 +317,7 @@ public class WiDirService extends XWService {
try {
activity.unregisterReceiver( sReceiver );
} catch ( IllegalArgumentException iae ) {
DbgUtils.logex( iae );
DbgUtils.logex( TAG, iae );
}
DbgUtils.logd( TAG, "activityPaused() done" );
@ -844,7 +844,7 @@ public class WiDirService extends XWService {
}
packet.put( KEY_MAP, array );
} catch ( JSONException ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
}
}
@ -861,7 +861,7 @@ public class WiDirService extends XWService {
sUserMap.put( mac, name );
}
} catch ( JSONException ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
}
updateListeners();
@ -972,7 +972,7 @@ public class WiDirService extends XWService {
try {
sServerSock.close();
} catch ( IOException ioe ) {
DbgUtils.logex( ioe );
DbgUtils.logex( TAG, ioe );
}
sServerSock = null;
}

View file

@ -36,7 +36,8 @@ import java.util.HashSet;
import java.util.Random;
public class CurGameInfo {
private static final String TAG = CurGameInfo.class.getSimpleName();
public static final int MAX_NUM_PLAYERS = 4;
private static final String BOARD_SIZE = "BOARD_SIZE";
@ -164,7 +165,7 @@ public class CurGameInfo {
;
jsonData = obj.toString();
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
return jsonData;
@ -182,7 +183,7 @@ public class CurGameInfo {
int tmp = obj.optInt( PHONIES, phoniesAction.ordinal() );
phoniesAction = XWPhoniesChoice.values()[tmp];
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
}

View file

@ -426,7 +426,7 @@ public class GameSummary {
}
m_extras = asObj.toString();
} catch( org.json.JSONException ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
DbgUtils.logi( TAG, "putStringExtra(%s,%s) => %s", key, value, m_extras );
}
@ -442,7 +442,7 @@ public class GameSummary {
result = null;
}
} catch( org.json.JSONException ex ) {
DbgUtils.logex( ex );
DbgUtils.logex( TAG, ex );
}
}
DbgUtils.logi( TAG, "getStringExtra(%s) => %s", key, result );

View file

@ -250,7 +250,7 @@ public class JNIThread extends Thread {
join();
// Assert.assertFalse( isAlive() );
} catch ( java.lang.InterruptedException ie ) {
DbgUtils.logex( ie );
DbgUtils.logex( TAG, ie );
}
m_lock.unlock();
}
@ -715,7 +715,7 @@ public class JNIThread extends Thread {
if ( m_stopped && ! JNICmd.CMD_NONE.equals(cmd) ) {
DbgUtils.logw( TAG, "adding %s to stopped thread!!!",
cmd.toString() );
DbgUtils.printStack();
DbgUtils.printStack( TAG );
}
}

View file

@ -148,7 +148,7 @@ public class JNIUtilsImpl implements JNIUtils {
}
digest = md.digest();
} catch ( java.security.NoSuchAlgorithmException nsae ) {
DbgUtils.logex( nsae );
DbgUtils.logex( TAG, nsae );
}
return Utils.digestToString( digest );
}

View file

@ -414,7 +414,7 @@ public class LocUtils {
.put( k_LOCALE, locale )
.put( k_XLATEVERS, version );
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
return result;
@ -464,7 +464,7 @@ public class LocUtils {
s_xlationsBlessed = null;
loadXlations( context );
} catch ( org.json.JSONException jse ) {
DbgUtils.logex( jse );
DbgUtils.logex( TAG, jse );
}
}
return nAdded;