summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2015-08-26 10:33:35 -0400
committerJoey Grover <joeygrover@gmail.com>2015-08-26 10:33:35 -0400
commit95a2e431fc503ed169078527b520fa73a0e03611 (patch)
treef022bea61c9c612583e57feceeb78fd6a08870bb
parent0b4e434b492bdd60fdf88d0b265f85e2744bfc13 (diff)
parent962d73296d8f030d12f439feb026bbb81bfa9ba9 (diff)
downloadsdl_android-95a2e431fc503ed169078527b520fa73a0e03611.tar.gz
Merge branch 'feature/debug-cleanup' of https://github.com/smartdevicelink/sdl_android into develop
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/proxy/SdlProxyBase.java57
1 files changed, 1 insertions, 56 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/proxy/SdlProxyBase.java b/sdl_android_lib/src/com/smartdevicelink/proxy/SdlProxyBase.java
index b7ea2957b..db0d052da 100644
--- a/sdl_android_lib/src/com/smartdevicelink/proxy/SdlProxyBase.java
+++ b/sdl_android_lib/src/com/smartdevicelink/proxy/SdlProxyBase.java
@@ -6,10 +6,7 @@ import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.DataOutputStream;
-import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -27,7 +24,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
-import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.telephony.TelephonyManager;
@@ -746,47 +742,6 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
//If the service or context has become unavailable unexpectedly, catch the exception and move on -- no broadcast log will occur.
}
}
-
- private void writeToFile(Object writeME, String fileName) {
- Intent sendIntent = createBroadcastIntent();
- try {
- updateBroadcastIntent(sendIntent,"FUNCTION_NAME", "writeToFile");
- updateBroadcastIntent(sendIntent, "SHOW_ON_UI", false);
-
- String sFileName = fileName + "_" + iFileCount + ".txt";
- String outFile = Environment.getExternalStorageDirectory().getPath() + "/" + sFileName;
- File out = new File(outFile);
- FileWriter writer = new FileWriter(out);
- writer.flush();
- writer.write(writeME.toString());
- writer.close();
- updateBroadcastIntent(sendIntent, "COMMENT1", outFile);
- } catch (FileNotFoundException e) {
- updateBroadcastIntent(sendIntent, "COMMENT2", "writeToFile FileNotFoundException " + e);
- Log.i("sdlp", "FileNotFoundException: " + e);
- e.printStackTrace();
- } catch (IOException e) {
- updateBroadcastIntent(sendIntent, "COMMENT2", "writeToFile IOException " + e);
- Log.i("sdlp", "IOException: " + e);
- e.printStackTrace();
- }
- finally
- {
- sendBroadcastIntent(sendIntent);
- }
- }
-
- private void LogHeader(String sType, final String myObject, String sFuncName)
- {
- Intent sendIntent = createBroadcastIntent();
-
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", sFuncName);
-
- updateBroadcastIntent(sendIntent, "COMMENT1", sType + "\r\n");
- updateBroadcastIntent(sendIntent, "DATA", myObject);
- sendBroadcastIntent(sendIntent);
- }
-
private HttpURLConnection getURLConnection(Headers myHeader, String sURLString, int Timeout, int iContentLen)
{
@@ -875,8 +830,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
if (iTimeout == null)
iTimeout = 2000;
- Headers myHeader = msg.getHeader();
- String sFunctionName = "SYSTEM_REQUEST";
+ Headers myHeader = msg.getHeader();
updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "sendOnSystemRequestToUrl");
updateBroadcastIntent(sendIntent, "COMMENT5", "\r\nCloud URL: " + sURLString);
@@ -898,7 +852,6 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
jsonObjectToSendToServer = new JSONObject();
jsonObjectToSendToServer.put("data", jsonArrayOfSdlPPackets);
bLegacy = true;
- sFunctionName = "SYSTEM_REQUEST_LEGACY";
updateBroadcastIntent(sendIntent, "COMMENT6", "\r\nLegacy SystemRequest: true");
valid_json = jsonObjectToSendToServer.toString().replace("\\", "");
}
@@ -910,9 +863,6 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
sendBroadcastIntent(sendIntent3);
valid_json = sBodyString.replace("\\", "");
}
-
- writeToFile(valid_json, "requestToCloud");
- LogHeader("Cloud Request", valid_json, sFunctionName);
urlConnection = getURLConnection(myHeader, sURLString, iTimeout, valid_json.getBytes("UTF-8").length);
@@ -957,11 +907,6 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
response.append('\r');
}
rd.close();
- Log.i(TAG, "response: " + response.toString());
-
- writeToFile(response.toString(), "responseFromCloud");
-
- LogHeader("Cloud Response", response.toString(), sFunctionName);
Vector<String> cloudDataReceived = new Vector<String>();