Modified that logs do not include URLs.

When try to play streaming, URLs are logged. URLs can be contained sensitive information.
So, modified that logs do not inlcude URLs.

Bug: 123669012
Test: play HLS/RTSP streaming
Change-Id: I379e66b7be7588b09bbf6328c964666eb546ccf2
Signed-off-by: Eunyoung Moon <eunyoung.moon@lge.com>
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 2ecfa43..5e7f90a 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -1234,7 +1234,7 @@
         const AString &uri, uint32_t streamMask, int64_t timeUs, bool newUri) {
     ssize_t index = mFetcherInfos.indexOfKey(uri);
     if (index < 0) {
-        ALOGE("did not find fetcher for uri: %s", uri.c_str());
+        ALOGE("did not find fetcher for uri: %s", uriDebugString(uri).c_str());
         return false;
     }
 
@@ -2005,7 +2005,7 @@
 
             if ((mNewStreamMask & stream) && mStreams[idx].mNewUri.empty()) {
                 ALOGW("swapping stream type %d %s to empty stream",
-                        stream, mStreams[idx].mUri.c_str());
+                        stream, uriDebugString(mStreams[idx].mUri).c_str());
             }
             mStreams[idx].mUri = mStreams[idx].mNewUri;
             mStreams[idx].mNewUri.clear();
@@ -2033,7 +2033,7 @@
         CHECK(idx >= 0);
         if (mStreams[idx].mNewUri.empty()) {
             ALOGW("swapping extra stream type %d %s to empty stream",
-                    stream, mStreams[idx].mUri.c_str());
+                    stream, uriDebugString(mStreams[idx].mUri).c_str());
         }
         mStreams[idx].mUri = mStreams[idx].mNewUri;
         mStreams[idx].mNewUri.clear();
@@ -2138,7 +2138,7 @@
             ALOGV("stopping newUri = %s", newUri.c_str());
             ssize_t index = mFetcherInfos.indexOfKey(newUri);
             if (index < 0) {
-                ALOGE("did not find fetcher for newUri: %s", newUri.c_str());
+                ALOGE("did not find fetcher for newUri: %s", uriDebugString(newUri).c_str());
                 continue;
             }
             FetcherInfo &info = mFetcherInfos.editValueAt(index);
diff --git a/media/libstagefright/httplive/M3UParser.cpp b/media/libstagefright/httplive/M3UParser.cpp
index 4392799..b2361b8 100644
--- a/media/libstagefright/httplive/M3UParser.cpp
+++ b/media/libstagefright/httplive/M3UParser.cpp
@@ -1205,8 +1205,7 @@
             if (val.size() < 2
                     || val.c_str()[0] != '"'
                     || val.c_str()[val.size() - 1] != '"') {
-                ALOGE("Expected quoted string for URI, got '%s' instead.",
-                      val.c_str());
+                ALOGE("Expected quoted string for URI.");
 
                 return ERROR_MALFORMED;
             }
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp
index 562c625..d153598 100644
--- a/media/libstagefright/httplive/PlaylistFetcher.cpp
+++ b/media/libstagefright/httplive/PlaylistFetcher.cpp
@@ -365,10 +365,10 @@
         if (err == ERROR_NOT_CONNECTED) {
             return ERROR_NOT_CONNECTED;
         } else if (err < 0) {
-            ALOGE("failed to fetch cipher key from '%s'.", keyURI.c_str());
+            ALOGE("failed to fetch cipher key from '%s'.", uriDebugString(keyURI).c_str());
             return ERROR_IO;
         } else if (key->size() != 16) {
-            ALOGE("key file '%s' wasn't 16 bytes in size.", keyURI.c_str());
+            ALOGE("key file '%s' wasn't 16 bytes in size.", uriDebugString(keyURI).c_str());
             return ERROR_MALFORMED;
         }
 
@@ -1366,7 +1366,7 @@
         }
         if (bytesRead < 0) {
             status_t err = bytesRead;
-            ALOGE("failed to fetch .ts segment at url '%s'", uri.c_str());
+            ALOGE("failed to fetch .ts segment at url '%s'", uriDebugString(uri).c_str());
             notifyError(err);
             return;
         }
diff --git a/media/libstagefright/rtsp/ARTSPConnection.cpp b/media/libstagefright/rtsp/ARTSPConnection.cpp
index 20cb415..789e62a 100644
--- a/media/libstagefright/rtsp/ARTSPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTSPConnection.cpp
@@ -255,7 +255,7 @@
 
     struct hostent *ent = gethostbyname(host.c_str());
     if (ent == NULL) {
-        ALOGE("Unknown host %s", host.c_str());
+        ALOGE("Unknown host %s", uriDebugString(host).c_str());
 
         reply->setInt32("result", -ENOENT);
         reply->post();
diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp
index c581e9d..9263565 100644
--- a/media/libstagefright/rtsp/ASessionDescription.cpp
+++ b/media/libstagefright/rtsp/ASessionDescription.cpp
@@ -80,7 +80,7 @@
             return false;
         }
 
-        ALOGI("%s", line.c_str());
+        ALOGV("%s", line.c_str());
 
         switch (line.c_str()[0]) {
             case 'v':
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index 8454ca1..b4515e4 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -345,8 +345,7 @@
 
             struct hostent *ent = gethostbyname(mSessionHost.c_str());
             if (ent == NULL) {
-                ALOGE("Failed to look up address of session host '%s'",
-                     mSessionHost.c_str());
+                ALOGE("Failed to look up address of session host");
 
                 return false;
             }
@@ -531,7 +530,7 @@
                             mSessionURL.append(AStringPrintf("%u", port));
                             mSessionURL.append(path);
 
-                            ALOGI("rewritten session url: '%s'", mSessionURL.c_str());
+                            ALOGV("rewritten session url: '%s'", mSessionURL.c_str());
                         }
 
                         sp<AMessage> reply = new AMessage('conn', this);