diff options
| author | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2018-10-02 11:57:38 -0400 |
|---|---|---|
| committer | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2018-10-02 11:57:38 -0400 |
| commit | d10bda5f5d3062c6d15a9c8be4e567365a21eafb (patch) | |
| tree | ca8264f6a6cddb53e6ab99b5cb07364b31f37a11 | |
| parent | 9acc65cfe7ad8840ffe49d827457fb263c2848fb (diff) | |
| download | sdl_android-feature/clean_logs.tar.gz | |
Use DebugTool for i/d logsfeature/clean_logs
4 files changed, 21 insertions, 17 deletions
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java index 4351ddc91..f7d8edeae 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java +++ b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java @@ -12,6 +12,7 @@ import com.smartdevicelink.proxy.rpc.SetDisplayLayout; import com.smartdevicelink.proxy.rpc.enums.MetadataType; import com.smartdevicelink.proxy.rpc.enums.PredefinedLayout; import com.smartdevicelink.proxy.rpc.enums.TextAlignment; +import com.smartdevicelink.util.DebugTool; import java.lang.ref.WeakReference; import java.util.List; @@ -34,13 +35,13 @@ public class ScreenManager extends BaseSubManager { public synchronized void onComplete(boolean success) { if (softButtonManager != null && textAndGraphicManager != null) { if (softButtonManager.getState() == BaseSubManager.READY && textAndGraphicManager.getState() == BaseSubManager.READY) { - Log.i(TAG, "Starting screen manager, all sub managers are in ready state"); + DebugTool.logInfo("Starting screen manager, all sub managers are in ready state"); transitionToState(READY); } else if (softButtonManager.getState() == BaseSubManager.ERROR && textAndGraphicManager.getState() == BaseSubManager.ERROR) { Log.e(TAG, "ERROR starting screen manager, both sub managers in error state"); transitionToState(ERROR); } else if (textAndGraphicManager.getState() == BaseSubManager.SETTING_UP || softButtonManager.getState() == BaseSubManager.SETTING_UP) { - Log.i(TAG, "SETTING UP screen manager, one sub manager is still setting up"); + DebugTool.logInfo("SETTING UP screen manager, one sub manager is still setting up"); transitionToState(SETTING_UP); } else { Log.w(TAG, "LIMITED starting screen manager, one sub manager in error state and the other is ready"); diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java index 0f7e22dea..0f01c2971 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java +++ b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java @@ -27,6 +27,7 @@ import com.smartdevicelink.proxy.rpc.enums.SoftButtonType; import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType; import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener; import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener; +import com.smartdevicelink.util.DebugTool; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -301,14 +302,14 @@ class SoftButtonManager extends BaseSubManager { // Upload initial state images if (initialStatesToBeUploaded.size() > 0 && fileManager.get() != null) { - Log.v(TAG, "Uploading soft button initial state artworks"); + DebugTool.logInfo( "Uploading soft button initial state artworks"); fileManager.get().uploadArtworks(initialStatesToBeUploaded, new MultipleFileCompletionListener() { @Override public void onComplete(Map<String, String> errors) { if (errors != null && errors.size() > 0) { Log.e(TAG, "Error uploading soft button artworks"); } - Log.d(TAG, "Soft button initial artworks uploaded"); + DebugTool.logInfo( "Soft button initial artworks uploaded"); update(cachedListener); } }); @@ -317,14 +318,14 @@ class SoftButtonManager extends BaseSubManager { // Upload other state images if (otherStatesToBeUploaded.size() > 0 && fileManager.get() != null) { - Log.v(TAG, "Uploading soft button other state artworks"); + DebugTool.logInfo("Uploading soft button other state artworks"); fileManager.get().uploadArtworks(otherStatesToBeUploaded, new MultipleFileCompletionListener() { @Override public void onComplete(Map<String, String> errors) { if (errors != null && errors.size() > 0) { Log.e(TAG, "Error uploading soft button artworks"); } - Log.d(TAG, "Soft button other state artworks uploaded"); + DebugTool.logInfo("Soft button other state artworks uploaded"); // In case our soft button states have changed in the meantime update(cachedListener); } @@ -351,17 +352,17 @@ class SoftButtonManager extends BaseSubManager { return; } - Log.v(TAG, "Updating soft buttons"); + DebugTool.logInfo("Updating soft buttons"); cachedListener = null; // Check if we have update already in progress if (inProgressShowRPC != null) { - Log.d(TAG, "In progress update exists, queueing update"); + DebugTool.logInfo("In progress update exists, queueing update"); // If we already have a pending update, we're going to tell the old listener that it was superseded by a new update and then return if (queuedUpdateListener != null) { - Log.d(TAG, "Queued update already exists, superseding previous queued update"); + DebugTool.logInfo("Queued update already exists, superseding previous queued update"); queuedUpdateListener.onComplete(false); queuedUpdateListener = null; } @@ -380,23 +381,23 @@ class SoftButtonManager extends BaseSubManager { inProgressShowRPC = new Show(); inProgressShowRPC.setMainField1(getCurrentMainField1()); if (softButtonObjects == null) { - Log.d(TAG, "Soft button objects are null, sending an empty array"); + DebugTool.logInfo("Soft button objects are null, sending an empty array"); inProgressShowRPC.setSoftButtons(new ArrayList<SoftButton>()); } else if ((currentStateHasImages() && !allCurrentStateImagesAreUploaded()) || !softButtonImagesSupported()) { // The images don't yet exist on the head unit, or we cannot use images, send a text update if possible, otherwise, don't send anything yet List<SoftButton> textOnlySoftButtons = createTextSoftButtonsForCurrentState(); if (textOnlySoftButtons != null) { - Log.d(TAG, "Soft button images unavailable, sending text buttons"); + DebugTool.logInfo( "Soft button images unavailable, sending text buttons"); inProgressShowRPC.setSoftButtons(textOnlySoftButtons); } else { - Log.d(TAG, "Soft button images unavailable, text buttons unavailable"); + DebugTool.logInfo( "Soft button images unavailable, text buttons unavailable"); inProgressShowRPC = null; return; } } else { - Log.d(TAG, "Sending soft buttons with images"); + DebugTool.logInfo( "Sending soft buttons with images"); inProgressShowRPC.setSoftButtons(createSoftButtonsForCurrentState()); } @@ -404,7 +405,7 @@ class SoftButtonManager extends BaseSubManager { inProgressShowRPC.setOnRPCResponseListener(new OnRPCResponseListener() { @Override public void onResponse(int correlationId, RPCResponse response) { - Log.i(TAG, "Soft button update completed"); + DebugTool.logInfo("Soft button update completed"); handleResponse(true); } @@ -429,7 +430,7 @@ class SoftButtonManager extends BaseSubManager { if (hasQueuedUpdate) { - Log.d(TAG, "Queued update exists, sending another update"); + DebugTool.logInfo("Queued update exists, sending another update"); currentListener = queuedUpdateListener; queuedUpdateListener = null; hasQueuedUpdate = false; diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java index 4e87f6356..01c760d09 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java +++ b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java @@ -6,6 +6,7 @@ import android.util.Log; import com.smartdevicelink.proxy.rpc.OnButtonEvent; import com.smartdevicelink.proxy.rpc.OnButtonPress; import com.smartdevicelink.proxy.rpc.SoftButton; +import com.smartdevicelink.util.DebugTool; import java.util.Collections; import java.util.List; @@ -71,7 +72,7 @@ public class SoftButtonObject { Log.e(TAG, String.format("Attempted to transition to state: %s on soft button object: %s but no state with that name was found", newStateName, this.name)); return false; } - Log.i(TAG, String.format("Transitioning soft button object %s to state %s", this.name, newStateName)); + DebugTool.logInfo(String.format("Transitioning soft button object %s to state %s", this.name, newStateName)); currentStateName = newStateName; // Send a new Show RPC because the state has changed which means the actual SoftButton has changed diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java index 34fe815ca..7abca5339 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java +++ b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java @@ -29,6 +29,7 @@ import com.smartdevicelink.proxy.rpc.enums.TextFieldName; import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener; import com.smartdevicelink.proxy.rpc.enums.TextAlignment; import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener; +import com.smartdevicelink.util.DebugTool; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -129,7 +130,7 @@ class TextAndGraphicManager extends BaseSubManager { currentHMILevel = ((OnHMIStatus)notification).getHmiLevel(); if (currentHMILevel == HMILevel.HMI_FULL){ if (pendingHMIFull){ - Log.v(TAG, "Acquired HMI_FULL with pending update. Sending now"); + DebugTool.logInfo( "Acquired HMI_FULL with pending update. Sending now"); pendingHMIFull = false; sdlUpdate(pendingHMIListener); pendingHMIListener = null; |
