Per the platform team, we shouldn't enable debug logging automatically
in debug builds because it increases log-spam. Just disable the flag
and enable it manually when needed.
Add some ifs to make sure all our debug logging is properly removed.
BUG=
27380154
Change-Id: I8338f226c07affdb65970c7cb14f1e6aae036934
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- Log.d(TAG, "onActivityResult() code=" + resultCode);
+ if (DEBUG) Log.d(TAG, "onActivityResult() code=" + resultCode);
// Only relay back results when not canceled; otherwise stick around to
// let the user pick another app/backend.
@Override
void onTaskFinished(Uri... uris) {
- Log.d(TAG, "onFinished() " + Arrays.toString(uris));
+ if (DEBUG) Log.d(TAG, "onFinished() " + Arrays.toString(uris));
final Intent intent = new Intent();
if (uris.length == 1) {
@Override
void onTaskFinished(Uri... uris) {
- Log.d(TAG, "onFinished() " + Arrays.toString(uris));
+ if (DEBUG) Log.d(TAG, "onFinished() " + Arrays.toString(uris));
final Intent intent = new Intent();
if (uris.length == 1) {
logInvalidScopedAccessRequest(context, SCOPED_DIRECTORY_ACCESS_ERROR);
return null;
}
- Log.d(TAG, "doc id for " + file + ": " + docId);
+ if (DEBUG) Log.d(TAG, "doc id for " + file + ": " + docId);
final Uri uri = DocumentsContract.buildTreeDocumentUri(EXTERNAL_STORAGE_AUTH, docId);
if (uri == null) {
package com.android.documentsui;
+import static com.android.documentsui.Shared.DEBUG;
import static com.android.documentsui.model.DocumentInfo.getCursorString;
import android.content.ContentProvider;
if (predicate.apply(authority)) {
db.delete(TABLE_STATE, StateColumns.AUTHORITY + "=?", new String[] {
authority });
- Log.d(TAG, "Purged state for " + authority);
+ if (DEBUG) Log.d(TAG, "Purged state for " + authority);
}
}
} finally {
package com.android.documentsui;
+import static com.android.documentsui.Shared.DEBUG;
+
import android.annotation.Nullable;
import android.os.Bundle;
import android.provider.DocumentsContract.Root;
*/
void update(RootInfo root) {
if (mMenu == null) {
- Log.d(TAG, "update called before Search MenuItem installed.");
+ if (DEBUG) Log.d(TAG, "update called before Search MenuItem installed.");
return;
}
void showMenu(boolean visible) {
if (mMenu == null) {
- Log.d(TAG, "showMenu called before Search MenuItem installed.");
+ if (DEBUG) Log.d(TAG, "showMenu called before Search MenuItem installed.");
return;
}
public static final String TAG = "Documents";
- public static final boolean DEBUG = true;
+ public static final boolean DEBUG = false;
/** Intent action name to pick a copy destination. */
public static final String ACTION_PICK_COPY_DESTINATION =