Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30535bce authored by Steve McKay's avatar Steve McKay
Browse files

Don't log verbose stuff by default.

Bug: 32633923

Verbose logging can be enabled using: adb shell setprop log.tag.Documents VERBOSE

Change-Id: I03a5d4dae54a023d8b1b000bc7ea8e34ffe1035f
parent 035939ff
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.documentsui;

import static com.android.documentsui.base.Shared.DEBUG;
import static com.android.documentsui.base.Shared.VERBOSE;

import android.annotation.MainThread;
import android.annotation.Nullable;
@@ -42,7 +42,7 @@ public final class DirectoryReloadLock {
    public void block() {
        Shared.checkMainLoop();
        mPauseCount++;
        if (DEBUG) Log.v(TAG, "Block count increments to " + mPauseCount + ".");
        if (VERBOSE) Log.v(TAG, "Block count increments to " + mPauseCount + ".");
    }

    /**
@@ -54,7 +54,7 @@ public final class DirectoryReloadLock {
        Shared.checkMainLoop();
        assert(mPauseCount > 0);
        mPauseCount--;
        if (DEBUG) Log.v(TAG, "Block count decrements to " + mPauseCount + ".");
        if (VERBOSE) Log.v(TAG, "Block count decrements to " + mPauseCount + ".");
        if (mPauseCount == 0 && mCallback != null) {
            mCallback.run();
            mCallback = null;
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.documentsui;

import static com.android.documentsui.base.Shared.DEBUG;
import static com.android.documentsui.base.Shared.VERBOSE;

import android.annotation.Nullable;
import android.graphics.drawable.Drawable;
@@ -99,7 +99,7 @@ public class NavigationViewManager {
        if (mState.stack.size() <= 1) {
            mBreadcrumb.show(false);
            String title = mEnv.getCurrentRoot().title;
            if (DEBUG) Log.v(TAG, "New toolbar title is: " + title);
            if (VERBOSE) Log.v(TAG, "New toolbar title is: " + title);
            mToolbar.setTitle(title);
        } else {
            mBreadcrumb.show(true);
@@ -107,7 +107,7 @@ public class NavigationViewManager {
            mBreadcrumb.postUpdate();
        }

        if (DEBUG) Log.v(TAG, "Final toolbar title is: " + mToolbar.getTitle());
        if (VERBOSE) Log.v(TAG, "Final toolbar title is: " + mToolbar.getTitle());
    }

    // Hamburger if drawer is present, else sad nullness.
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ package com.android.documentsui.base;
import static com.android.documentsui.base.DocumentInfo.getCursorInt;
import static com.android.documentsui.base.DocumentInfo.getCursorLong;
import static com.android.documentsui.base.DocumentInfo.getCursorString;
import static com.android.documentsui.base.Shared.DEBUG;
import static com.android.documentsui.base.Shared.VERBOSE;
import static com.android.documentsui.base.Shared.compareToIgnoreCaseNullable;

import android.annotation.IntDef;
@@ -233,7 +233,7 @@ public class RootInfo implements Durable, Parcelable, Comparable<RootInfo> {
            derivedType = TYPE_OTHER;
        }

        if (DEBUG) Log.v(TAG, "Deriving fields: " + this);
        if (VERBOSE) Log.v(TAG, "Derived fields: " + this);
    }

    public Uri getUri() {
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public final class Shared {
    public static final String TAG = "Documents";

    public static final boolean DEBUG = true;
    public static final boolean VERBOSE = DEBUG && Log.isLoggable(TAG, Log.VERBOSE);

    public static final boolean ENABLE_OMC_API_FEATURES = true;

+4 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.documentsui.dirlist;
import static com.android.documentsui.base.DocumentInfo.getCursorInt;
import static com.android.documentsui.base.DocumentInfo.getCursorString;
import static com.android.documentsui.base.Shared.DEBUG;
import static com.android.documentsui.base.Shared.VERBOSE;
import static com.android.documentsui.base.State.MODE_GRID;
import static com.android.documentsui.base.State.MODE_LIST;

@@ -526,14 +527,15 @@ public class DirectoryFragment extends Fragment
     */
    private void scaleLayout(float scale) {
        assert(Build.IS_DEBUGGABLE);
        if (DEBUG) Log.v(TAG, "Handling scale event: " + scale + ", existing scale: " + mLiveScale);
        if (VERBOSE) Log.v(
                TAG, "Handling scale event: " + scale + ", existing scale: " + mLiveScale);

        if (mMode == MODE_GRID) {
            float minScale = getFraction(R.fraction.grid_scale_min);
            float maxScale = getFraction(R.fraction.grid_scale_max);
            float nextScale = mLiveScale * scale;

            if (DEBUG) Log.v(TAG,
            if (VERBOSE) Log.v(TAG,
                    "Next scale " + nextScale + ", Min/max scale " + minScale + "/" + maxScale);

            if (nextScale > minScale && nextScale < maxScale) {
Loading