Improve debugging setup for window manager package.

This moves debug flags to a dedicated class and also provides a
mechanism to either have fine grained tags or one common tag for easier
grepping the logcat. This mimicks the approach in activity manager
package.

Change-Id: Ie8c08b9a3d8b182335ee5547ee05d21b5933db6b
diff --git a/services/core/java/com/android/server/wm/BlackFrame.java b/services/core/java/com/android/server/wm/BlackFrame.java
index 7b08354..5c29a0a 100644
--- a/services/core/java/com/android/server/wm/BlackFrame.java
+++ b/services/core/java/com/android/server/wm/BlackFrame.java
@@ -16,6 +16,13 @@
 
 package com.android.server.wm;
 
+import static android.graphics.PixelFormat.OPAQUE;
+import static android.view.SurfaceControl.FX_SURFACE_DIM;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
+
 import java.io.PrintWriter;
 
 import android.graphics.Matrix;
@@ -44,21 +51,20 @@
             int w = r-l;
             int h = b-t;
 
-            if (WindowManagerService.DEBUG_SURFACE_TRACE) {
+            if (DEBUG_SURFACE_TRACE) {
                 surface = new WindowSurfaceController.SurfaceTrace(session, "BlackSurface("
                         + l + ", " + t + ")",
-                        w, h, PixelFormat.OPAQUE, SurfaceControl.FX_SURFACE_DIM | SurfaceControl.HIDDEN);
+                        w, h, OPAQUE, FX_SURFACE_DIM | SurfaceControl.HIDDEN);
             } else {
                 surface = new SurfaceControl(session, "BlackSurface",
-                        w, h, PixelFormat.OPAQUE, SurfaceControl.FX_SURFACE_DIM | SurfaceControl.HIDDEN);
+                        w, h, OPAQUE, FX_SURFACE_DIM | SurfaceControl.HIDDEN);
             }
 
             surface.setAlpha(1);
             surface.setLayerStack(layerStack);
             surface.setLayer(layer);
             surface.show();
-            if (WindowManagerService.SHOW_TRANSACTIONS ||
-                    WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
+            if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM,
                             "  BLACK " + surface + ": CREATE layer=" + layer);
         }
 
@@ -76,7 +82,7 @@
                     mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
                     mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
             if (false) {
-                Slog.i(WindowManagerService.TAG, "Black Surface @ (" + left + "," + top + "): ("
+                Slog.i(TAG_WM, "Black Surface @ (" + left + "," + top + "): ("
                         + mTmpFloats[Matrix.MTRANS_X] + ","
                         + mTmpFloats[Matrix.MTRANS_Y] + ") matrix=["
                         + mTmpFloats[Matrix.MSCALE_X] + ","
@@ -149,10 +155,8 @@
         if (mBlackSurfaces != null) {
             for (int i=0; i<mBlackSurfaces.length; i++) {
                 if (mBlackSurfaces[i] != null) {
-                    if (WindowManagerService.SHOW_TRANSACTIONS ||
-                            WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(
-                                    WindowManagerService.TAG,
-                                    "  BLACK " + mBlackSurfaces[i].surface + ": DESTROY");
+                    if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM,
+                            "  BLACK " + mBlackSurfaces[i].surface + ": DESTROY");
                     mBlackSurfaces[i].surface.destroy();
                     mBlackSurfaces[i] = null;
                 }