Skip to content

Commit cb7b657

Browse files
committed
Move android and base classes to new logWarning
1 parent 8446a5b commit cb7b657

32 files changed

Lines changed: 118 additions & 118 deletions

android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ private void constructor(BaseTransportConfig transportConfig,RouterServiceValida
127127
//rsvp = new RouterServiceValidator(((MultiplexTransportConfig)transportConfig).getContext());
128128
//vlad.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
129129
if(rsvp.validate()){
130-
DebugTool.logWarning("SDL Router service is valid; attempting to connect");
130+
DebugTool.logWarning(TAG, "SDL Router service is valid; attempting to connect");
131131
((MultiplexTransportConfig)transportConfig).setService(rsvp.getService());//Let thes the transport broker know which service to connect to
132132
}else{
133-
DebugTool.logWarning("SDL Router service isn't trusted. Enabling legacy bluetooth connection.");
133+
DebugTool.logWarning(TAG, "SDL Router service isn't trusted. Enabling legacy bluetooth connection.");
134134
if(cachedMultiConfig == null){
135135
cachedMultiConfig = (MultiplexTransportConfig) transportConfig;
136136
cachedMultiConfig.setService(null);
@@ -573,7 +573,7 @@ public void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID){
573573

574574
public void forceHardwareConnectEvent(TransportType type){
575575
if(_transport == null){
576-
DebugTool.logWarning("Unable to force connect, transport was null!");
576+
DebugTool.logWarning(TAG, "Unable to force connect, transport was null!");
577577
return;
578578
}
579579
if(isLegacyModeEnabled()){//We know we should no longer be in legacy mode for future connections, so lets clear out that flag
@@ -594,7 +594,7 @@ public void forceHardwareConnectEvent(TransportType type){
594594
}
595595
}else if(tempCompName!=null){
596596
//We have a conflicting service request
597-
DebugTool.logWarning("Conflicting services. Disconnecting from current and connecting to new");
597+
DebugTool.logWarning(TAG, "Conflicting services. Disconnecting from current and connecting to new");
598598
//Log.w(TAG, "Old service " + config.getService().toShortString());
599599
//Log.w(TAG, "New Serivce " + tempCompName.toString());
600600
multi.disconnect();
@@ -626,9 +626,9 @@ public void forceHardwareConnectEvent(TransportType type){
626626
//_transport.disconnect();
627627
return;
628628
}
629-
DebugTool.logWarning("Using own transport, but not connected. Attempting to join multiplexing");
629+
DebugTool.logWarning(TAG, "Using own transport, but not connected. Attempting to join multiplexing");
630630
}else{
631-
DebugTool.logWarning("Currently in legacy mode connected to own transport service. Nothing will take place on trnasport cycle");
631+
DebugTool.logWarning(TAG, "Currently in legacy mode connected to own transport service. Nothing will take place on trnasport cycle");
632632
}
633633
}
634634

android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static byte[] getCodecSpecificData(MediaFormat format) {
6464
if (name.equals("video/avc")) {
6565
return getAVCCodecSpecificData(format);
6666
} else {
67-
DebugTool.logWarning("Retrieving codec-specific data for " + name + " is not supported");
67+
DebugTool.logWarning(TAG, "Retrieving codec-specific data for " + name + " is not supported");
6868
return null;
6969
}
7070
}
@@ -82,7 +82,7 @@ private static byte[] getAVCCodecSpecificData(MediaFormat format) {
8282
// For H.264, "csd-0" contains SPS and "csd-1" contains PPS. Refer to the documentation
8383
// of MediaCodec.
8484
if (!(format.containsKey("csd-0") && format.containsKey("csd-1"))) {
85-
DebugTool.logWarning("H264 codec specific data not found");
85+
DebugTool.logWarning(TAG, "H264 codec specific data not found");
8686
return null;
8787
}
8888

@@ -97,7 +97,7 @@ private static byte[] getAVCCodecSpecificData(MediaFormat format) {
9797
pps.get(output, spsLen, ppsLen);
9898
} catch (Exception e) {
9999
// should not happen
100-
DebugTool.logWarning("Error while copying H264 codec specific data: " + e);
100+
DebugTool.logWarning(TAG, "Error while copying H264 codec specific data: " + e);
101101
return null;
102102
}
103103

android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void drainEncoder(boolean endOfStream) {
198198
MediaFormat format = mEncoder.getOutputFormat();
199199
mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
200200
} else {
201-
DebugTool.logWarning("Output format change notified more than once, ignoring.");
201+
DebugTool.logWarning(TAG, "Output format change notified more than once, ignoring.");
202202
}
203203
} else if (encoderStatus < 0) {
204204
} else {

android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public void run() {
315315
try {
316316
drainEncoder(false);
317317
} catch (Exception e) {
318-
DebugTool.logWarning("Error attempting to drain encoder");
318+
DebugTool.logWarning(TAG, "Error attempting to drain encoder");
319319
} finally {
320320
mVideoEncoder.release();
321321
}
@@ -349,7 +349,7 @@ void drainEncoder(boolean endOfStream) {
349349
MediaFormat format = mVideoEncoder.getOutputFormat();
350350
mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
351351
} else {
352-
DebugTool.logWarning("Output format change notified more than once, ignoring.");
352+
DebugTool.logWarning(TAG, "Output format change notified more than once, ignoring.");
353353
}
354354
}
355355
} else {

android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void checkState() {
169169
transitionToState(BaseSubManager.SETTING_UP);
170170
// No need to notify developer here!
171171
} else {
172-
DebugTool.logWarning("LIMITED starting sdl manager, some sub managers are in error or limited state and the others finished setting up");
172+
DebugTool.logWarning(TAG, "LIMITED starting sdl manager, some sub managers are in error or limited state and the others finished setting up");
173173
transitionToState(BaseSubManager.LIMITED);
174174
handleQueuedNotifications();
175175
notifyDevListener(null);

android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void onOutputBufferAvailable(@NonNull MediaCodec mediaCodec, int i, @NonN
8989
SampleBuffer targetSampleBuffer = AudioDecoder.super.onOutputBufferAvailable(outputBuffer);
9090
AudioDecoder.this.listener.onAudioDataAvailable(targetSampleBuffer);
9191
} else {
92-
DebugTool.logWarning("output buffer empty. Chance that silence was detected");
92+
DebugTool.logWarning(TAG, "output buffer empty. Chance that silence was detected");
9393
}
9494

9595
mediaCodec.releaseOutputBuffer(i, false);

android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private static class DecoderRunnable implements Runnable {
107107
public void run() {
108108
final AudioDecoderCompat reference = weakReference.get();
109109
if (reference == null) {
110-
DebugTool.logWarning("AudioDecoderCompat reference was null");
110+
DebugTool.logWarning(TAG, "AudioDecoderCompat reference was null");
111111
return;
112112
}
113113
final ByteBuffer[] inputBuffersArray = reference.decoder.getInputBuffers();

android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ public void onComplete(boolean success) {
256256
public void startAudioStream(boolean encrypted, final CompletionListener completionListener) {
257257
// audio stream cannot be started without a connected internal interface
258258
if (!internalInterface.isConnected()) {
259-
DebugTool.logWarning("startAudioStream called without being connected.");
259+
DebugTool.logWarning(TAG, "startAudioStream called without being connected.");
260260
finish(completionListener, false);
261261
return;
262262
}
263263

264264
// streaming state must be NONE (starting the service is ready. starting stream is started)
265265
if (streamingStateMachine.getState() != StreamingStateMachine.NONE) {
266-
DebugTool.logWarning("startAudioStream called but streamingStateMachine is not in state NONE (current: " + streamingStateMachine.getState() + ")");
266+
DebugTool.logWarning(TAG, "startAudioStream called but streamingStateMachine is not in state NONE (current: " + streamingStateMachine.getState() + ")");
267267
finish(completionListener, false);
268268
return;
269269
}
@@ -333,14 +333,14 @@ private void finish(CompletionListener listener, boolean isSuccess) {
333333
*/
334334
public void stopAudioStream(final CompletionListener completionListener) {
335335
if (!internalInterface.isConnected()) {
336-
DebugTool.logWarning("stopAudioStream called without being connected");
336+
DebugTool.logWarning(TAG, "stopAudioStream called without being connected");
337337
finish(completionListener, false);
338338
return;
339339
}
340340

341341
// streaming state must be STARTED (starting the service is ready. starting stream is started)
342342
if (streamingStateMachine.getState() != StreamingStateMachine.STARTED) {
343-
DebugTool.logWarning("stopAudioStream called but streamingStateMachine is not STARTED (current: " + streamingStateMachine.getState() + ")");
343+
DebugTool.logWarning(TAG, "stopAudioStream called but streamingStateMachine is not STARTED (current: " + streamingStateMachine.getState() + ")");
344344
finish(completionListener, false);
345345
return;
346346
}
@@ -444,7 +444,7 @@ public void onDecoderError(Exception e) {
444444
public void pushBuffer(ByteBuffer data, CompletionListener completionListener) {
445445
// streaming state must be STARTED (starting the service is ready. starting stream is started)
446446
if (streamingStateMachine.getState() != StreamingStateMachine.STARTED) {
447-
DebugTool.logWarning("AudioStreamManager is not ready!");
447+
DebugTool.logWarning(TAG, "AudioStreamManager is not ready!");
448448
return;
449449
}
450450

android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ void onProtocolSessionEndedNACKed(SessionType sessionType) {
209209
@Override
210210
void startVideoService(boolean isEncrypted, VideoStreamingParameters parameters) {
211211
if (session == null) {
212-
DebugTool.logWarning("SdlSession is not created yet.");
212+
DebugTool.logWarning(TAG, "SdlSession is not created yet.");
213213
return;
214214
}
215215
if (!session.getIsConnected()) {
216-
DebugTool.logWarning("Connection is not available.");
216+
DebugTool.logWarning(TAG, "Connection is not available.");
217217
return;
218218
}
219219

@@ -234,15 +234,15 @@ void startVideoService(boolean isEncrypted, VideoStreamingParameters parameters)
234234
*/
235235
private VideoStreamingParameters tryStartVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
236236
if (session == null) {
237-
DebugTool.logWarning("SdlSession is not created yet.");
237+
DebugTool.logWarning(TAG, "SdlSession is not created yet.");
238238
return null;
239239
}
240240
if (getProtocolVersion() != null && getProtocolVersion().getMajor() >= 5 && !systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)) {
241-
DebugTool.logWarning("Module doesn't support video streaming.");
241+
DebugTool.logWarning(TAG, "Module doesn't support video streaming.");
242242
return null;
243243
}
244244
if (parameters == null) {
245-
DebugTool.logWarning("Video parameters were not supplied.");
245+
DebugTool.logWarning(TAG, "Video parameters were not supplied.");
246246
return null;
247247
}
248248

@@ -309,11 +309,11 @@ public void onServiceError(SdlSession session, SessionType type, String reason)
309309
@Override
310310
boolean endVideoStream() {
311311
if (session == null) {
312-
DebugTool.logWarning("SdlSession is not created yet.");
312+
DebugTool.logWarning(TAG, "SdlSession is not created yet.");
313313
return false;
314314
}
315315
if (!session.getIsConnected()) {
316-
DebugTool.logWarning("Connection is not available.");
316+
DebugTool.logWarning(TAG, "Connection is not available.");
317317
return false;
318318
}
319319

@@ -335,11 +335,11 @@ boolean endVideoStream() {
335335
@Override
336336
void startAudioService(boolean isEncrypted) {
337337
if (session == null) {
338-
DebugTool.logWarning("SdlSession is not created yet.");
338+
DebugTool.logWarning(TAG, "SdlSession is not created yet.");
339339
return;
340340
}
341341
if (!session.getIsConnected()) {
342-
DebugTool.logWarning("Connection is not available.");
342+
DebugTool.logWarning(TAG, "Connection is not available.");
343343
return;
344344
}
345345
session.startService(SessionType.PCM, session.getSessionId(), isEncrypted);
@@ -353,11 +353,11 @@ void startAudioService(boolean isEncrypted) {
353353
@Override
354354
boolean endAudioStream() {
355355
if (session == null) {
356-
DebugTool.logWarning("SdlSession is not created yet.");
356+
DebugTool.logWarning(TAG, "SdlSession is not created yet.");
357357
return false;
358358
}
359359
if (!session.getIsConnected()) {
360-
DebugTool.logWarning("Connection is not available.");
360+
DebugTool.logWarning(TAG, "Connection is not available.");
361361
return false;
362362
}
363363

0 commit comments

Comments
 (0)