Skip to content

Commit 59f11f6

Browse files
committed
Add Tags to classes using null for TAG
1 parent e298cb9 commit 59f11f6

34 files changed

Lines changed: 274 additions & 261 deletions

android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.smartdevicelink.util.DebugTool;
88

99
public class SdlPacket extends BaseSdlPacket implements Parcelable {
10+
private static final String TAG = "SdlPacket";
1011
private static final int EXTRA_PARCEL_DATA_LENGTH = 24;
1112

1213
public SdlPacket(int version, boolean encryption, int frameType,
@@ -61,7 +62,7 @@ public SdlPacket(Parcel p) {
6162
}
6263
}
6364
}catch (RuntimeException e){
64-
DebugTool.logError(null, "Error creating packet from parcel", e);
65+
DebugTool.logError(TAG, "Error creating packet from parcel", e);
6566
}
6667
}
6768
}

android/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
*/
6161
@Deprecated
6262
public class WiProProtocol extends AbstractProtocol {
63+
private static final String TAG = "WiProProtocol";
6364
private final static String FailurePropagating_Msg = "Failure propagating ";
6465
//If increasing MAX PROTOCOL VERSION major version, make sure to alter it in SdlPsm
6566
public static final Version MAX_PROTOCOL_VERSION = new Version("5.0.0");
@@ -365,7 +366,7 @@ protected void handleFirstDataFrame(SdlPacket packet) {
365366
try {
366367
accumulator = new ByteArrayOutputStream(totalSize);
367368
}catch(OutOfMemoryError e){
368-
DebugTool.logError(null, "OutOfMemory error", e); //Garbled bits were received
369+
DebugTool.logError(TAG, "OutOfMemory error", e); //Garbled bits were received
369370
accumulator = null;
370371
}
371372
}
@@ -405,7 +406,7 @@ protected void notifyIfFinished(SdlPacket packet) {
405406
try {
406407
handleProtocolMessageReceived(message);
407408
} catch (Exception excp) {
408-
DebugTool.logError(null, FailurePropagating_Msg + "onProtocolMessageReceived: " + excp.toString(), excp);
409+
DebugTool.logError(TAG, FailurePropagating_Msg + "onProtocolMessageReceived: " + excp.toString(), excp);
409410
} // end-catch
410411

411412
hasFirstFrame = false;
@@ -631,7 +632,7 @@ private void handleSingleFrameMessageFrame(SdlPacket packet) {
631632
try {
632633
handleProtocolMessageReceived(message);
633634
} catch (Exception ex) {
634-
DebugTool.logError(null,FailurePropagating_Msg + "onProtocolMessageReceived: " + ex.toString(), ex);
635+
DebugTool.logError(TAG,FailurePropagating_Msg + "onProtocolMessageReceived: " + ex.toString(), ex);
635636
handleProtocolError(FailurePropagating_Msg + "onProtocolMessageReceived: ", ex);
636637
} // end-catch
637638
} // end-method

android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ private static boolean writeXmlTraceMessage(String msg) {
433433
try {
434434
localTraceListener.logXmlMsg(msg, SDL_LIB_TRACE_KEY);
435435
} catch (Exception ex) {
436-
DebugTool.logError(null, "Failure calling ISTListener: " + ex.toString(), ex);
436+
DebugTool.logError(SYSTEM_LOG_TAG, "Failure calling ISTListener: " + ex.toString(), ex);
437437
return false;
438438
}
439439
}

android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
public class TraceDeviceInfo {
5151
// http://developer.android.com/guide/topics/data/data-storage.html
5252

53+
private static final String TAG = "TraceDeviceInfo";
5354
private static TelephonyManager m_telephonyManager;
5455

5556
// Constructor
@@ -74,7 +75,7 @@ static String getTelephonyHeader() {
7475
try { // getDeviceId() requires android.permission.READ_PHONE_STATE
7576
info = "<deviceid>" + m_telephonyManager.getDeviceId() + "</deviceid>";
7677
} catch (Exception e1) {
77-
DebugTool.logError(null, "Failure getting telephony device ID: " + e1.toString(), e1);
78+
DebugTool.logError(TAG, "Failure getting telephony device ID: " + e1.toString(), e1);
7879
}
7980

8081
info = "<pt>";

android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
*
5959
*/
6060
@Deprecated
61-
public class BTTransport extends SdlTransport {
61+
public class BTTransport extends SdlTransport {
62+
private static final String TAG = "BTTransport";
6263
//936DA01F9ABD4D9D80C702AF85C822A8
6364
private final static UUID SDL_V4_MOBILE_APPLICATION_SVC_CLASS = new UUID(0x936DA01F9ABD4D9DL, 0x80C702AF85C822A8L);
6465

@@ -296,7 +297,7 @@ private void disconnect(String msg, Exception ex) {
296297
_transportReader = null;
297298
}
298299
} catch (Exception e) {
299-
DebugTool.logError(null, "Failed to stop transport reader thread.", e);
300+
DebugTool.logError(TAG, "Failed to stop transport reader thread.", e);
300301
} // end-catch
301302

302303
try {
@@ -305,7 +306,7 @@ private void disconnect(String msg, Exception ex) {
305306
_bluetoothAdapterMonitor = null;
306307
}
307308
} catch (Exception e) {
308-
DebugTool.logError(null, "Failed to stop adapter monitor thread.", e);
309+
DebugTool.logError(TAG, "Failed to stop adapter monitor thread.", e);
309310
}
310311

311312
try {
@@ -314,7 +315,7 @@ private void disconnect(String msg, Exception ex) {
314315
_serverSocket = null;
315316
}
316317
} catch (Exception e) {
317-
DebugTool.logError(null, "Failed to close serverSocket", e);
318+
DebugTool.logError(TAG, "Failed to close serverSocket", e);
318319
} // end-catch
319320

320321
try {
@@ -323,7 +324,7 @@ private void disconnect(String msg, Exception ex) {
323324
_activeSocket = null;
324325
}
325326
} catch (Exception e) {
326-
DebugTool.logError(null, "Failed to close activeSocket", e);
327+
DebugTool.logError(TAG, "Failed to close activeSocket", e);
327328
} // end-catch
328329

329330

@@ -334,7 +335,7 @@ private void disconnect(String msg, Exception ex) {
334335
_output = null;
335336
}
336337
} catch (Exception e) {
337-
DebugTool.logError(null, "Failed to close output stream", e);
338+
DebugTool.logError(TAG, "Failed to close output stream", e);
338339
} // end-catch
339340

340341
if (ex == null) {
@@ -361,7 +362,7 @@ public boolean sendBytesOverTransport(SdlPacket packet) {
361362
_output.write(msgBytes, 0, msgBytes.length);
362363
sendResult = true;
363364
} catch (Exception ex) {
364-
DebugTool.logError(null, "Error writing to Bluetooth socket: " + ex.toString(), ex);
365+
DebugTool.logError(TAG, "Error writing to Bluetooth socket: " + ex.toString(), ex);
365366
handleTransportError("Error writing to Bluetooth socket:", ex);
366367
sendResult = false;
367368
} // end-catch
@@ -461,7 +462,7 @@ private void readFromTransport() {
461462
if(currentByte == -1){ //If we read a -1 and the psm didn't move forward, then there is a problem
462463
if (!isHalted) {
463464
// Only call disconnect if the thread has not been halted
464-
DebugTool.logError(null, "End of stream reached!");
465+
DebugTool.logError(TAG, "End of stream reached!");
465466
disconnect("End of stream reached.", null);
466467
}
467468
}
@@ -479,7 +480,7 @@ private void readFromTransport() {
479480
// Only call disconnect if the thread has not been halted
480481
clearInputStream();
481482
String errString = "Failure in BTTransport reader thread: " + excp.toString();
482-
DebugTool.logError(null, errString, excp);
483+
DebugTool.logError(TAG, errString, excp);
483484
disconnect(errString, excp);
484485
}
485486
return;
@@ -493,7 +494,7 @@ private void clearInputStream(){
493494
_input = null;
494495
}
495496
} catch (Exception e) {
496-
DebugTool.logError(null, "Failed to close input stream", e);
497+
DebugTool.logError(TAG, "Failed to close input stream", e);
497498
} // end-catch
498499
}
499500

android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import com.smartdevicelink.util.DebugTool;
4040

4141
public abstract class SdlTransport {
42+
private static final String TAG = "SdlTransport";
4243
private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
4344

4445
private final static String FailurePropagating_Msg = "Failure propagating ";
@@ -73,7 +74,7 @@ protected void handleReceivedPacket(SdlPacket packet) {
7374
_transportListener.onTransportPacketReceived(packet);
7475
} // end-if
7576
} catch (Exception excp) {
76-
DebugTool.logError(null, FailurePropagating_Msg + "handleBytesFromTransport: " + excp.toString(), excp);
77+
DebugTool.logError(TAG, FailurePropagating_Msg + "handleBytesFromTransport: " + excp.toString(), excp);
7778
handleTransportError(FailurePropagating_Msg, excp);
7879
} // end-catch
7980
} // end-method
@@ -113,7 +114,7 @@ protected void handleTransportConnected() {
113114
SdlTrace.logTransportEvent("Transport.connected", null, InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
114115
_transportListener.onTransportConnected();
115116
} catch (Exception excp) {
116-
DebugTool.logError(null, FailurePropagating_Msg + "onTransportConnected: " + excp.toString(), excp);
117+
DebugTool.logError(TAG, FailurePropagating_Msg + "onTransportConnected: " + excp.toString(), excp);
117118
handleTransportError(FailurePropagating_Msg + "onTransportConnected", excp);
118119
} // end-catch
119120
} // end-method
@@ -127,7 +128,7 @@ protected void handleTransportDisconnected(final String info) {
127128
SdlTrace.logTransportEvent("Transport.disconnect: " + info, null, InterfaceActivityDirection.Transmit, null, 0, SDL_LIB_TRACE_KEY);
128129
_transportListener.onTransportDisconnected(info);
129130
} catch (Exception excp) {
130-
DebugTool.logError(null, FailurePropagating_Msg + "onTransportDisconnected: " + excp.toString(), excp);
131+
DebugTool.logError(TAG, FailurePropagating_Msg + "onTransportDisconnected: " + excp.toString(), excp);
131132
} // end-catch
132133
} // end-method
133134

android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
* Class that implements TCP transport
7878
*/
7979
public class TCPTransport extends SdlTransport {
80-
80+
private static final String TAG = "TCPTransport";
8181
/**
8282
* Size of the read buffer.
8383
*/
@@ -293,23 +293,23 @@ public TransportType getTransportType() {
293293
* @param message Message to log
294294
*/
295295
protected void logInfo(String message) {
296-
DebugTool.logInfo(getClass().getName(), message);
296+
DebugTool.logInfo(TAG, message);
297297
}
298298

299299
/**
300300
* Internal method for logging error messages
301301
* @param message Message to log
302302
*/
303303
protected void logError(String message) {
304-
DebugTool.logError(getClass().getName(), message);
304+
DebugTool.logError(TAG, message);
305305
}
306306

307307
/**
308308
* Internal method for logging warning messages
309309
* @param message Message to log
310310
*/
311311
protected void logWarning(String message) {
312-
DebugTool.logWarning(getClass().getName(), message);
312+
DebugTool.logWarning(TAG, message);
313313
}
314314

315315
/**
@@ -318,7 +318,7 @@ protected void logWarning(String message) {
318318
* @param throwable Exception, that was the main reason for logged error message
319319
*/
320320
protected void logError(String message, Throwable throwable) {
321-
DebugTool.logError(getClass().getName(), message, throwable);
321+
DebugTool.logError(TAG, message, throwable);
322322
}
323323

324324
/**

android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
*/
6060

6161
public class MediaStreamingStatus {
62+
private static final String TAG = "MediaStreamingStatus";
6263
private static final Object BROADCAST_RECEIVER_LOCK = new Object();
6364

6465
private boolean broadcastReceiverValid = true;
@@ -137,7 +138,7 @@ public synchronized boolean isAudioOutputAvailable() {
137138
* @return
138139
*/
139140
boolean isSupportedAudioDevice(int audioDevice){
140-
DebugTool.logInfo(null, "Audio device connected: " + audioDevice);
141+
DebugTool.logInfo(TAG, "Audio device connected: " + audioDevice);
141142
switch (audioDevice){
142143
case AudioDeviceInfo.TYPE_BLUETOOTH_A2DP:
143144
if(isBluetoothActuallyAvailable()) {

base/src/main/java/com/livio/BSON/BsonEncoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import java.util.*;
3838

3939
public class BsonEncoder {
40-
40+
private static final String TAG = "BsonEncoder";
4141

4242
public static byte[] encodeToBytes(HashMap<String, Object> map) throws ClassCastException {
4343
if(map != null) {
@@ -47,7 +47,7 @@ public static byte[] encodeToBytes(HashMap<String, Object> map) throws ClassCast
4747

4848
return encoder.encode(bson);
4949
}
50-
DebugTool.logError(null, "Something went wrong encoding the map into BSON bytes");
50+
DebugTool.logError(TAG, "Something went wrong encoding the map into BSON bytes");
5151

5252
return null;
5353
}
@@ -63,7 +63,7 @@ public static HashMap<String, Object> decodeFromBytes(byte[] bytes) {
6363
}
6464
}
6565
}
66-
DebugTool.logError(null, "Something went wrong decoding bytes into BSON");
66+
DebugTool.logError(TAG, "Something went wrong decoding bytes into BSON");
6767
return null;
6868
}
6969

base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
@Deprecated
3939
public class ProxyMessageDispatcher<T> {
40+
private static final String TAG = "ProxyMessageDispatcher";
4041
LinkedBlockingQueue<T> _queue = null;
4142
private Thread _messageDispatchingThread = null;
4243
IDispatchingStrategy<T> _strategy = null;
@@ -78,7 +79,7 @@ private void handleMessages() {
7879
// Thread was interrupted by dispose() method, no action required
7980
return;
8081
} catch (Exception e) {
81-
DebugTool.logError(null, "Error occurred dispating message.", e);
82+
DebugTool.logError(TAG, "Error occurred dispating message.", e);
8283
_strategy.handleDispatchingError("Error occurred dispating message.", e);
8384
}
8485
}

0 commit comments

Comments
 (0)