diff options
32 files changed, 908 insertions, 759 deletions
diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index a4b42763b1ce..e6b649e70bdf 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -16,6 +16,9 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.app.Service; @@ -219,7 +222,7 @@ final class AccessibilityController { */ private static final class DisplayMagnifier { - private static final String LOG_TAG = "DisplayMagnifier"; + private static final String LOG_TAG = TAG_WITH_CLASS_NAME ? "DisplayMagnifier" : TAG_WM; private static final boolean DEBUG_WINDOW_TRANSITIONS = false; private static final boolean DEBUG_ROTATION = false; @@ -925,7 +928,8 @@ final class AccessibilityController { * user can see on the screen. */ private static final class WindowsForAccessibilityObserver { - private static final String LOG_TAG = "WindowsForAccessibilityObserver"; + private static final String LOG_TAG = TAG_WITH_CLASS_NAME ? + "WindowsForAccessibilityObserver" : TAG_WM; private static final boolean DEBUG = false; diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java index d3941258de5a..a3c841b8ac21 100644 --- a/services/core/java/com/android/server/wm/AppTransition.java +++ b/services/core/java/com/android/server/wm/AppTransition.java @@ -39,6 +39,8 @@ import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpe import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation; import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation; import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.annotation.Nullable; import android.content.Context; @@ -46,7 +48,6 @@ import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Rect; import android.os.Debug; -import android.os.Handler; import android.os.IBinder; import android.os.IRemoteCallback; import android.os.RemoteException; @@ -82,10 +83,10 @@ import java.util.concurrent.Executors; // mOpeningApps and mClosingApps are the lists of tokens that will be // made visible or hidden at the next transition. public class AppTransition implements Dump { - private static final String TAG = "AppTransition"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "AppTransition" : TAG_WM; private static final boolean DEBUG_APP_TRANSITIONS = - WindowManagerService.DEBUG_APP_TRANSITIONS; - private static final boolean DEBUG_ANIM = WindowManagerService.DEBUG_ANIM; + WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; + private static final boolean DEBUG_ANIM = WindowManagerDebugConfig.DEBUG_ANIM; private static final int CLIP_REVEAL_TRANSLATION_Y_DP = 8; /** Not set up for a transition. */ diff --git a/services/core/java/com/android/server/wm/AppWindowAnimator.java b/services/core/java/com/android/server/wm/AppWindowAnimator.java index 4861acc14121..ab47f07262bd 100644 --- a/services/core/java/com/android/server/wm/AppWindowAnimator.java +++ b/services/core/java/com/android/server/wm/AppWindowAnimator.java @@ -16,9 +16,12 @@ package com.android.server.wm; -import static com.android.server.wm.WindowManagerService.DEBUG_ANIM; -import static com.android.server.wm.WindowManagerService.DEBUG_LAYERS; -import static com.android.server.wm.WindowManagerService.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.TYPE_LAYER_OFFSET; import android.graphics.Matrix; @@ -35,7 +38,7 @@ import java.io.PrintWriter; import java.util.ArrayList; public class AppWindowAnimator { - static final String TAG = "AppWindowAnimator"; + static final String TAG = TAG_WITH_CLASS_NAME ? "AppWindowAnimator" : TAG_WM; private static final int PROLONG_ANIMATION_DISABLED = 0; static final int PROLONG_ANIMATION_AT_END = 1; @@ -410,8 +413,7 @@ public class AppWindowAnimator { final int NW = mAllAppWinAnimators.size(); for (int i=0; i<NW; i++) { WindowStateAnimator winAnimator = mAllAppWinAnimators.get(i); - if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, - "performing show on: " + winAnimator); + if (DEBUG_VISIBILITY) Slog.v(TAG, "performing show on: " + winAnimator); winAnimator.performShowLocked(); isAnimating |= winAnimator.isAnimating(); } diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index 23ad1a81bdf1..fd5c7047c4fd 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -17,9 +17,12 @@ package com.android.server.wm; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; -import static com.android.server.wm.WindowManagerService.DEBUG_ANIM; -import static com.android.server.wm.WindowManagerService.DEBUG_APP_TRANSITIONS; -import static com.android.server.wm.WindowManagerService.TAG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import com.android.server.input.InputApplicationHandle; import com.android.server.wm.WindowManagerService.H; @@ -44,6 +47,8 @@ class AppTokenList extends ArrayList<AppWindowToken> { * really activity) that is displaying windows. */ class AppWindowToken extends WindowToken { + private static final String TAG = TAG_WITH_CLASS_NAME ? "AppWindowToken" : TAG_WM; + // Non-null only for application tokens. final IApplicationToken appToken; @@ -152,7 +157,7 @@ class AppWindowToken extends WindowToken { continue; } try { - if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, + if (DEBUG_VISIBILITY) Slog.v(TAG, "Setting visibility of " + win + ": " + (!clientHidden)); win.mClient.dispatchAppVisibility(!clientHidden); } catch (RemoteException e) { @@ -170,7 +175,7 @@ class AppWindowToken extends WindowToken { int numDrawn = 0; boolean nowGone = true; - if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, + if (DEBUG_VISIBILITY) Slog.v(TAG, "Update reported visibility: " + this); final int N = allAppWindows.size(); for (int i=0; i<N; i++) { @@ -181,12 +186,12 @@ class AppWindowToken extends WindowToken { || win.mDestroying) { continue; } - if (WindowManagerService.DEBUG_VISIBILITY) { - Slog.v(WindowManagerService.TAG, "Win " + win + ": isDrawn=" + if (DEBUG_VISIBILITY) { + Slog.v(TAG, "Win " + win + ": isDrawn=" + win.isDrawnLw() + ", isAnimating=" + win.mWinAnimator.isAnimating()); if (!win.isDrawnLw()) { - Slog.v(WindowManagerService.TAG, "Not displayed: s=" + + Slog.v(TAG, "Not displayed: s=" + win.mWinAnimator.mSurfaceController + " pv=" + win.mPolicyVisibility + " mDrawState=" + win.mWinAnimator.mDrawState @@ -220,7 +225,7 @@ class AppWindowToken extends WindowToken { nowVisible = reportedVisible; } } - if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "VIS " + this + ": interesting=" + if (DEBUG_VISIBILITY) Slog.v(TAG, "VIS " + this + ": interesting=" + numInteresting + " visible=" + numVisible); if (nowDrawn != reportedDrawn) { if (nowDrawn) { @@ -231,8 +236,8 @@ class AppWindowToken extends WindowToken { reportedDrawn = nowDrawn; } if (nowVisible != reportedVisible) { - if (WindowManagerService.DEBUG_VISIBILITY) Slog.v( - WindowManagerService.TAG, "Visibility changed in " + this + if (DEBUG_VISIBILITY) Slog.v( + TAG, "Visibility changed in " + this + ": vis=" + nowVisible); reportedVisible = nowVisible; Message m = service.mH.obtainMessage( @@ -295,7 +300,7 @@ class AppWindowToken extends WindowToken { final Task task = mTask; if (task != null) { if (!task.removeAppToken(this)) { - Slog.e(WindowManagerService.TAG, "removeAppFromTaskLocked: token=" + this + Slog.e(TAG, "removeAppFromTaskLocked: token=" + this + " not found."); } task.mStack.mExitingAppTokens.remove(this); @@ -330,7 +335,7 @@ class AppWindowToken extends WindowToken { return; } - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG_WM, "Restoring saved surfaces: " + this + ", allDrawn=" + allDrawn); mAnimatingWithSavedSurface = true; @@ -357,8 +362,8 @@ class AppWindowToken extends WindowToken { // and never beyond allAppWindows bounds. winNdx = Math.min(winNdx - 1, allAppWindows.size() - 1)) { WindowState win = allAppWindows.get(winNdx); - if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) { - Slog.w(WindowManagerService.TAG, "removeAllWindows: removing win=" + win); + if (DEBUG_WINDOW_MOVEMENT) { + Slog.w(TAG, "removeAllWindows: removing win=" + win); } service.removeWindowLocked(win); @@ -377,8 +382,8 @@ class AppWindowToken extends WindowToken { winNdx = Math.min(winNdx - 1, allAppWindows.size() - 1)) { WindowState win = allAppWindows.get(winNdx); if (win.mAppDied) { - if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) { - Slog.w(WindowManagerService.TAG, "removeAllDeadWindows: " + win); + if (DEBUG_WINDOW_MOVEMENT) { + Slog.w(TAG, "removeAllDeadWindows: " + win); } // Set mDestroying, we don't want any animation or delayed removal here. win.mDestroying = true; diff --git a/services/core/java/com/android/server/wm/BlackFrame.java b/services/core/java/com/android/server/wm/BlackFrame.java index 7b08354799a1..5c29a0aabd37 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 @@ public class BlackFrame { 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 @@ public class BlackFrame { 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 @@ public class BlackFrame { 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; } diff --git a/services/core/java/com/android/server/wm/CircularDisplayMask.java b/services/core/java/com/android/server/wm/CircularDisplayMask.java index 33cec6402743..ae4154131079 100644 --- a/services/core/java/com/android/server/wm/CircularDisplayMask.java +++ b/services/core/java/com/android/server/wm/CircularDisplayMask.java @@ -17,6 +17,9 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.graphics.Canvas; import android.graphics.Color; @@ -26,15 +29,15 @@ import android.graphics.Point; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; +import android.util.Slog; import android.view.Display; import android.view.Surface; import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; import android.view.SurfaceSession; -import android.util.Slog; class CircularDisplayMask { - private static final String TAG = "CircularDisplayMask"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "CircularDisplayMask" : TAG_WM; // size of the chin private int mScreenOffset = 0; @@ -64,7 +67,7 @@ class CircularDisplayMask { SurfaceControl ctrl = null; try { - if (WindowManagerService.DEBUG_SURFACE_TRACE) { + if (DEBUG_SURFACE_TRACE) { ctrl = new WindowSurfaceController.SurfaceTrace(session, "CircularDisplayMask", mScreenSize.x, mScreenSize.y, PixelFormat.TRANSLUCENT, SurfaceControl.HIDDEN); diff --git a/services/core/java/com/android/server/wm/DimLayer.java b/services/core/java/com/android/server/wm/DimLayer.java index 4b3620f07fbc..6657a7b03489 100644 --- a/services/core/java/com/android/server/wm/DimLayer.java +++ b/services/core/java/com/android/server/wm/DimLayer.java @@ -16,6 +16,12 @@ package com.android.server.wm; +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_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.SystemClock; @@ -26,7 +32,7 @@ import android.view.SurfaceControl; import java.io.PrintWriter; public class DimLayer { - private static final String TAG = "DimLayer"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "DimLayer" : TAG_WM; private static final boolean DEBUG = false; public static final float RESIZING_HINT_ALPHA = 0.5f; @@ -81,7 +87,7 @@ public class DimLayer { if (DEBUG) Slog.v(TAG, "Ctor: displayId=" + displayId); SurfaceControl.openTransaction(); try { - if (WindowManagerService.DEBUG_SURFACE_TRACE) { + if (DEBUG_SURFACE_TRACE) { mDimSurface = new WindowSurfaceController.SurfaceTrace(service.mFxSession, "DimSurface", 16, 16, PixelFormat.OPAQUE, @@ -91,12 +97,11 @@ public class DimLayer { 16, 16, PixelFormat.OPAQUE, SurfaceControl.FX_SURFACE_DIM | SurfaceControl.HIDDEN); } - if (WindowManagerService.SHOW_TRANSACTIONS || - WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(TAG, - " DIM " + mDimSurface + ": CREATE"); + if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG, + " DIM " + mDimSurface + ": CREATE"); mDimSurface.setLayerStack(displayId); } catch (Exception e) { - Slog.e(WindowManagerService.TAG, "Exception creating Dim surface", e); + Slog.e(TAG_WM, "Exception creating Dim surface", e); } finally { SurfaceControl.closeTransaction(); } diff --git a/services/core/java/com/android/server/wm/DimLayerController.java b/services/core/java/com/android/server/wm/DimLayerController.java index bd30bd585bdb..6d1cec4a9f10 100644 --- a/services/core/java/com/android/server/wm/DimLayerController.java +++ b/services/core/java/com/android/server/wm/DimLayerController.java @@ -1,6 +1,8 @@ package com.android.server.wm; -import static com.android.server.wm.WindowManagerService.DEBUG_DIM_LAYER; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DIM_LAYER; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.LAYER_OFFSET_DIM; import android.graphics.Rect; @@ -16,7 +18,7 @@ import java.io.PrintWriter; * as well as other use cases (such as dimming above a dead window). */ class DimLayerController { - private static final String TAG = "DimLayerController"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "DimLayerController" : TAG_WM; /** Amount of time in milliseconds to animate the dim surface from one value to another, * when no window animation is driving it. */ diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 898a9a414903..9b64481a56b7 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -19,8 +19,8 @@ package com.android.server.wm; import static android.app.ActivityManager.StackId.DOCKED_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; -import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY; -import static com.android.server.wm.WindowManagerService.TAG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowState.RESIZE_HANDLE_WIDTH_IN_DP; import android.app.ActivityManager.StackId; @@ -180,7 +180,7 @@ class DisplayContent { TaskStack getHomeStack() { if (mHomeStack == null && mDisplayId == Display.DEFAULT_DISPLAY) { - Slog.e(TAG, "getHomeStack: Returning null from this=" + this); + Slog.e(TAG_WM, "getHomeStack: Returning null from this=" + this); } return mHomeStack; } @@ -239,12 +239,12 @@ class DisplayContent { void moveStack(TaskStack stack, boolean toTop) { if (StackId.isAlwaysOnTop(stack.mStackId) && !toTop) { // This stack is always-on-top silly... - Slog.w(TAG, "Ignoring move of always-on-top stack=" + stack + " to bottom"); + Slog.w(TAG_WM, "Ignoring move of always-on-top stack=" + stack + " to bottom"); return; } if (!mStacks.remove(stack)) { - Slog.wtf(TAG, "moving stack that was not added: " + stack, new Throwable()); + Slog.wtf(TAG_WM, "moving stack that was not added: " + stack, new Throwable()); } int addIndex = toTop ? mStacks.size() : 0; @@ -422,7 +422,7 @@ class DisplayContent { for (int i = 0; i < windows.size(); i++) { final WindowState win = windows.get(i); if (win.isHiddenFromUserLocked()) { - if (DEBUG_VISIBILITY) Slog.w(TAG, "user changing, hiding " + win + if (DEBUG_VISIBILITY) Slog.w(TAG_WM, "user changing, hiding " + win + ", attrs=" + win.mAttrs.type + ", belonging to " + win.mOwnerUid); win.hideLw(false); } diff --git a/services/core/java/com/android/server/wm/DisplaySettings.java b/services/core/java/com/android/server/wm/DisplaySettings.java index 80526f28ea20..7f7968610151 100644 --- a/services/core/java/com/android/server/wm/DisplaySettings.java +++ b/services/core/java/com/android/server/wm/DisplaySettings.java @@ -16,16 +16,17 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.graphics.Rect; import android.os.Environment; import android.util.AtomicFile; import android.util.Slog; import android.util.Xml; + import com.android.internal.util.FastXmlSerializer; import com.android.internal.util.XmlUtils; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; -import org.xmlpull.v1.XmlSerializer; import java.io.File; import java.io.FileInputStream; @@ -35,11 +36,15 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.HashMap; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; +import org.xmlpull.v1.XmlSerializer; + /** * Current persistent settings about a display */ public class DisplaySettings { - private static final String TAG = WindowManagerService.TAG; + private static final String TAG = TAG_WITH_CLASS_NAME ? "DisplaySettings" : TAG_WM; private final AtomicFile mFile; private final HashMap<String, Entry> mEntries = new HashMap<String, Entry>(); diff --git a/services/core/java/com/android/server/wm/DockedStackDividerController.java b/services/core/java/com/android/server/wm/DockedStackDividerController.java index 32c9b2a654da..8f3d3e30ad1a 100644 --- a/services/core/java/com/android/server/wm/DockedStackDividerController.java +++ b/services/core/java/com/android/server/wm/DockedStackDividerController.java @@ -27,13 +27,15 @@ import static android.view.WindowManager.DOCKED_BOTTOM; import static android.view.WindowManager.DOCKED_LEFT; import static android.view.WindowManager.DOCKED_RIGHT; import static android.view.WindowManager.DOCKED_TOP; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; /** * Keeps information about the docked stack divider. */ public class DockedStackDividerController { - private static final String TAG = "DockedStackDividerController"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "DockedStackDividerController" : TAG_WM; private final DisplayContent mDisplayContent; private final int mDividerWindowWidth; diff --git a/services/core/java/com/android/server/wm/DragState.java b/services/core/java/com/android/server/wm/DragState.java index 0ef0e582a842..da894818519a 100644 --- a/services/core/java/com/android/server/wm/DragState.java +++ b/services/core/java/com/android/server/wm/DragState.java @@ -16,22 +16,15 @@ package com.android.server.wm; -import android.graphics.Matrix; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; -import android.view.animation.AnimationSet; -import android.view.animation.DecelerateInterpolator; -import android.view.animation.Interpolator; -import android.view.animation.ScaleAnimation; -import android.view.animation.Transformation; -import android.view.animation.TranslateAnimation; -import com.android.server.input.InputApplicationHandle; -import com.android.server.input.InputWindowHandle; -import com.android.server.wm.WindowManagerService.DragInputEventReceiver; -import com.android.server.wm.WindowManagerService.H; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.content.ClipData; import android.content.ClipDescription; +import android.graphics.Matrix; import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; @@ -47,6 +40,19 @@ import android.view.InputChannel; import android.view.SurfaceControl; import android.view.View; import android.view.WindowManager; +import android.view.animation.AlphaAnimation; +import android.view.animation.Animation; +import android.view.animation.AnimationSet; +import android.view.animation.DecelerateInterpolator; +import android.view.animation.Interpolator; +import android.view.animation.ScaleAnimation; +import android.view.animation.Transformation; +import android.view.animation.TranslateAnimation; + +import com.android.server.input.InputApplicationHandle; +import com.android.server.input.InputWindowHandle; +import com.android.server.wm.WindowManagerService.DragInputEventReceiver; +import com.android.server.wm.WindowManagerService.H; import java.util.ArrayList; @@ -114,9 +120,9 @@ class DragState { */ void register(Display display) { mDisplay = display; - if (WindowManagerService.DEBUG_DRAG) Slog.d(WindowManagerService.TAG, "registering drag input channel"); + if (DEBUG_DRAG) Slog.d(TAG_WM, "registering drag input channel"); if (mClientChannel != null) { - Slog.e(WindowManagerService.TAG, "Duplicate register of drag input channel"); + Slog.e(TAG_WM, "Duplicate register of drag input channel"); } else { InputChannel[] channels = InputChannel.openInputChannelPair("drag"); mServerChannel = channels[0]; @@ -161,17 +167,17 @@ class DragState { mDragWindowHandle.frameBottom = p.y; // Pause rotations before a drag. - if (WindowManagerService.DEBUG_ORIENTATION) { - Slog.d(WindowManagerService.TAG, "Pausing rotation during drag"); + if (DEBUG_ORIENTATION) { + Slog.d(TAG_WM, "Pausing rotation during drag"); } mService.pauseRotationLocked(); } } void unregister() { - if (WindowManagerService.DEBUG_DRAG) Slog.d(WindowManagerService.TAG, "unregistering drag input channel"); + if (DEBUG_DRAG) Slog.d(TAG_WM, "unregistering drag input channel"); if (mClientChannel == null) { - Slog.e(WindowManagerService.TAG, "Unregister of nonexistent drag input channel"); + Slog.e(TAG_WM, "Unregister of nonexistent drag input channel"); } else { mService.mInputManager.unregisterInputChannel(mServerChannel); mInputEventReceiver.dispose(); @@ -185,8 +191,8 @@ class DragState { mDragApplicationHandle = null; // Resume rotations after a drag. - if (WindowManagerService.DEBUG_ORIENTATION) { - Slog.d(WindowManagerService.TAG, "Resuming rotation after drag"); + if (DEBUG_ORIENTATION) { + Slog.d(TAG_WM, "Resuming rotation after drag"); } mService.resumeRotationLocked(); } @@ -210,8 +216,8 @@ class DragState { mNotifiedWindows.clear(); mDragInProgress = true; - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")"); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")"); } final WindowList windows = mService.getWindowListLocked(mDisplay); @@ -238,8 +244,8 @@ class DragState { if ((mFlags & View.DRAG_FLAG_GLOBAL) == 0) { final IBinder winBinder = newWin.mClient.asBinder(); if (winBinder != mLocalWin) { - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "Not dispatching local DRAG_STARTED to " + newWin); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "Not dispatching local DRAG_STARTED to " + newWin); } return; } @@ -253,7 +259,7 @@ class DragState { // track each window that we've notified that the drag is starting mNotifiedWindows.add(newWin); } catch (RemoteException e) { - Slog.w(WindowManagerService.TAG, "Unable to drag-start window " + newWin); + Slog.w(TAG_WM, "Unable to drag-start window " + newWin); } finally { // if the callee was local, the dispatch has already recycled the event if (Process.myPid() != newWin.mSession.mPid) { @@ -275,8 +281,8 @@ class DragState { return; } } - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "need to send DRAG_STARTED to new window " + newWin); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "need to send DRAG_STARTED to new window " + newWin); } sendDragStartedLw(newWin, mCurrentX, mCurrentY, mDataDescription); } @@ -285,8 +291,8 @@ class DragState { private void broadcastDragEndedLw() { final int myPid = Process.myPid(); - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "broadcasting DRAG_ENDED"); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "broadcasting DRAG_ENDED"); } for (WindowState ws : mNotifiedWindows) { float x = 0; @@ -301,7 +307,7 @@ class DragState { try { ws.mClient.dispatchDragEvent(evt); } catch (RemoteException e) { - Slog.w(WindowManagerService.TAG, "Unable to drag-end window " + ws); + Slog.w(TAG_WM, "Unable to drag-end window " + ws); } // if the current window is in the same process, // the dispatch has already recycled the event @@ -356,24 +362,24 @@ class DragState { final int myPid = Process.myPid(); // Move the surface to the given touch - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i( - WindowManagerService.TAG, ">>> OPEN TRANSACTION notifyMoveLw"); + if (SHOW_LIGHT_TRANSACTIONS) Slog.i( + TAG_WM, ">>> OPEN TRANSACTION notifyMoveLw"); SurfaceControl.openTransaction(); try { mSurfaceControl.setPosition(x - mThumbOffsetX, y - mThumbOffsetY); - if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, " DRAG " + if (SHOW_TRANSACTIONS) Slog.i(TAG_WM, " DRAG " + mSurfaceControl + ": pos=(" + (int)(x - mThumbOffsetX) + "," + (int)(y - mThumbOffsetY) + ")"); } finally { SurfaceControl.closeTransaction(); - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i( - WindowManagerService.TAG, "<<< CLOSE TRANSACTION notifyMoveLw"); + if (SHOW_LIGHT_TRANSACTIONS) Slog.i( + TAG_WM, "<<< CLOSE TRANSACTION notifyMoveLw"); } // Tell the affected window WindowState touchedWin = getTouchedWinAtPointLw(x, y); if (touchedWin == null) { - if (WindowManagerService.DEBUG_DRAG) Slog.d(WindowManagerService.TAG, "No touched win at x=" + x + " y=" + y); + if (DEBUG_DRAG) Slog.d(TAG_WM, "No touched win at x=" + x + " y=" + y); return; } if ((mFlags & View.DRAG_FLAG_GLOBAL) == 0) { @@ -387,8 +393,8 @@ class DragState { try { // have we dragged over a new window? if ((touchedWin != mTargetWindow) && (mTargetWindow != null)) { - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "sending DRAG_EXITED to " + mTargetWindow); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "sending DRAG_EXITED to " + mTargetWindow); } // force DRAG_EXITED_EVENT if appropriate DragEvent evt = obtainDragEvent(mTargetWindow, DragEvent.ACTION_DRAG_EXITED, @@ -399,8 +405,8 @@ class DragState { } } if (touchedWin != null) { - if (false && WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "sending DRAG_LOCATION to " + touchedWin); + if (false && DEBUG_DRAG) { + Slog.d(TAG_WM, "sending DRAG_LOCATION to " + touchedWin); } DragEvent evt = obtainDragEvent(touchedWin, DragEvent.ACTION_DRAG_LOCATION, x, y, null, null, null, null, false); @@ -410,7 +416,7 @@ class DragState { } } } catch (RemoteException e) { - Slog.w(WindowManagerService.TAG, "can't send drag notification to windows"); + Slog.w(TAG_WM, "can't send drag notification to windows"); } mTargetWindow = touchedWin; } @@ -437,8 +443,8 @@ class DragState { return true; } - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "sending DROP to " + touchedWin); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "sending DROP to " + touchedWin); } final int myPid = Process.myPid(); final IBinder token = touchedWin.mClient.asBinder(); @@ -452,7 +458,7 @@ class DragState { Message msg = mService.mH.obtainMessage(H.DRAG_END_TIMEOUT, token); mService.mH.sendMessageDelayed(msg, 5000); } catch (RemoteException e) { - Slog.w(WindowManagerService.TAG, "can't send drop notification to win " + touchedWin); + Slog.w(TAG_WM, "can't send drop notification to win " + touchedWin); return true; } finally { if (myPid != touchedWin.mSession.mPid) { @@ -566,4 +572,4 @@ class DragState { set.start(); // Will start on the first call to getTransformation. return set; } -}
\ No newline at end of file +} diff --git a/services/core/java/com/android/server/wm/EmulatorDisplayOverlay.java b/services/core/java/com/android/server/wm/EmulatorDisplayOverlay.java index 0a372d817e1c..3186d3dc8e5b 100644 --- a/services/core/java/com/android/server/wm/EmulatorDisplayOverlay.java +++ b/services/core/java/com/android/server/wm/EmulatorDisplayOverlay.java @@ -17,6 +17,10 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; @@ -32,7 +36,7 @@ import android.view.SurfaceControl; import android.view.SurfaceSession; class EmulatorDisplayOverlay { - private static final String TAG = "EmulatorDisplayOverlay"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "EmulatorDisplayOverlay" : TAG_WM; // Display dimensions private Point mScreenSize; @@ -53,7 +57,7 @@ class EmulatorDisplayOverlay { SurfaceControl ctrl = null; try { - if (WindowManagerService.DEBUG_SURFACE_TRACE) { + if (DEBUG_SURFACE_TRACE) { ctrl = new WindowSurfaceController.SurfaceTrace(session, "EmulatorDisplayOverlay", mScreenSize.x, mScreenSize.y, PixelFormat.TRANSLUCENT, SurfaceControl.HIDDEN); diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java index 55111361a1a6..e42658e5a2f7 100644 --- a/services/core/java/com/android/server/wm/InputMonitor.java +++ b/services/core/java/com/android/server/wm/InputMonitor.java @@ -16,9 +16,11 @@ package com.android.server.wm; -import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; -import static com.android.server.wm.WindowManagerService.DEBUG_FOCUS_LIGHT; -import static com.android.server.wm.WindowManagerService.DEBUG_INPUT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.app.ActivityManagerNative; import android.graphics.Rect; @@ -79,7 +81,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { synchronized (mService.mWindowMap) { WindowState windowState = (WindowState) inputWindowHandle.windowState; if (windowState != null) { - Slog.i(WindowManagerService.TAG, "WINDOW DIED " + windowState); + Slog.i(TAG_WM, "WINDOW DIED " + windowState); mService.removeWindowLocked(windowState); } } @@ -108,7 +110,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { } if (windowState != null) { - Slog.i(WindowManagerService.TAG, "Input event dispatching timed out " + Slog.i(TAG_WM, "Input event dispatching timed out " + "sending to " + windowState.mAttrs.getTitle() + ". Reason: " + reason); // Figure out whether this window is layered above system windows. @@ -118,11 +120,11 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); aboveSystem = windowState.mBaseLayer > systemAlertLayer; } else if (appWindowToken != null) { - Slog.i(WindowManagerService.TAG, "Input event dispatching timed out " + Slog.i(TAG_WM, "Input event dispatching timed out " + "sending to application " + appWindowToken.stringName + ". Reason: " + reason); } else { - Slog.i(WindowManagerService.TAG, "Input event dispatching timed out " + Slog.i(TAG_WM, "Input event dispatching timed out " + ". Reason: " + reason); } @@ -212,7 +214,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { } if (DEBUG_INPUT) { - Slog.d(WindowManagerService.TAG, "addInputWindowHandle: " + Slog.d(TAG_WM, "addInputWindowHandle: " + child + ", " + inputWindowHandle); } addInputWindowHandleLw(inputWindowHandle); @@ -235,7 +237,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { } mUpdateInputWindowsNeeded = false; - if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED updateInputWindowsLw"); + if (false) Slog.d(TAG_WM, ">>>>>> ENTERED updateInputWindowsLw"); // Populate the input window list with information about all of the windows that // could potentially receive input. @@ -247,28 +249,28 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { // If there's a drag in flight, provide a pseudowindow to catch drag input final boolean inDrag = (mService.mDragState != null); if (inDrag) { - if (WindowManagerService.DEBUG_DRAG) { - Log.d(WindowManagerService.TAG, "Inserting drag window"); + if (DEBUG_DRAG) { + Log.d(TAG_WM, "Inserting drag window"); } final InputWindowHandle dragWindowHandle = mService.mDragState.mDragWindowHandle; if (dragWindowHandle != null) { addInputWindowHandleLw(dragWindowHandle); } else { - Slog.w(WindowManagerService.TAG, "Drag is in progress but there is no " + Slog.w(TAG_WM, "Drag is in progress but there is no " + "drag window handle."); } } final boolean inPositioning = (mService.mTaskPositioner != null); if (inPositioning) { - if (WindowManagerService.DEBUG_TASK_POSITIONING) { - Log.d(WindowManagerService.TAG, "Inserting window handle for repositioning"); + if (DEBUG_TASK_POSITIONING) { + Log.d(TAG_WM, "Inserting window handle for repositioning"); } final InputWindowHandle dragWindowHandle = mService.mTaskPositioner.mDragWindowHandle; if (dragWindowHandle != null) { addInputWindowHandleLw(dragWindowHandle); } else { - Slog.e(WindowManagerService.TAG, + Slog.e(TAG_WM, "Repositioning is in progress but there is no drag window handle."); } } @@ -328,7 +330,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { // Clear the list in preparation for the next round. clearInputWindowHandlesLw(); - if (false) Slog.d(WindowManagerService.TAG, "<<<<<<< EXITED updateInputWindowsLw"); + if (false) Slog.d(TAG_WM, "<<<<<<< EXITED updateInputWindowsLw"); } /* Notifies that the input device configuration has changed. */ @@ -416,7 +418,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { */ public void setInputFocusLw(WindowState newWindow, boolean updateInputWindows) { if (DEBUG_FOCUS_LIGHT || DEBUG_INPUT) { - Slog.d(WindowManagerService.TAG, "Input focus has changed to " + newWindow); + Slog.d(TAG_WM, "Input focus has changed to " + newWindow); } if (newWindow != mInputFocus) { @@ -452,7 +454,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { public void pauseDispatchingLw(WindowToken window) { if (! window.paused) { if (DEBUG_INPUT) { - Slog.v(WindowManagerService.TAG, "Pausing WindowToken " + window); + Slog.v(TAG_WM, "Pausing WindowToken " + window); } window.paused = true; @@ -463,7 +465,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { public void resumeDispatchingLw(WindowToken window) { if (window.paused) { if (DEBUG_INPUT) { - Slog.v(WindowManagerService.TAG, "Resuming WindowToken " + window); + Slog.v(TAG_WM, "Resuming WindowToken " + window); } window.paused = false; @@ -474,7 +476,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { public void freezeInputDispatchingLw() { if (! mInputDispatchFrozen) { if (DEBUG_INPUT) { - Slog.v(WindowManagerService.TAG, "Freezing input dispatching"); + Slog.v(TAG_WM, "Freezing input dispatching"); } mInputDispatchFrozen = true; @@ -485,7 +487,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { public void thawInputDispatchingLw() { if (mInputDispatchFrozen) { if (DEBUG_INPUT) { - Slog.v(WindowManagerService.TAG, "Thawing input dispatching"); + Slog.v(TAG_WM, "Thawing input dispatching"); } mInputDispatchFrozen = false; @@ -496,7 +498,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { public void setEventDispatchingLw(boolean enabled) { if (mInputDispatchEnabled != enabled) { if (DEBUG_INPUT) { - Slog.v(WindowManagerService.TAG, "Setting event dispatching to " + enabled); + Slog.v(TAG_WM, "Setting event dispatching to " + enabled); } mInputDispatchEnabled = enabled; diff --git a/services/core/java/com/android/server/wm/KeyguardDisableHandler.java b/services/core/java/com/android/server/wm/KeyguardDisableHandler.java index 37d811f3f2e3..377071d4c46b 100644 --- a/services/core/java/com/android/server/wm/KeyguardDisableHandler.java +++ b/services/core/java/com/android/server/wm/KeyguardDisableHandler.java @@ -16,6 +16,9 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.app.ActivityManagerNative; import android.app.admin.DevicePolicyManager; import android.content.Context; @@ -29,7 +32,7 @@ import android.util.Pair; import android.view.WindowManagerPolicy; public class KeyguardDisableHandler extends Handler { - private static final String TAG = "KeyguardDisableHandler"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "KeyguardDisableHandler" : TAG_WM; private static final int ALLOW_DISABLE_YES = 1; private static final int ALLOW_DISABLE_NO = 0; diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java index 3158c470980d..c118a214077a 100644 --- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java +++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java @@ -16,11 +16,16 @@ package com.android.server.wm; -import java.io.PrintWriter; - +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS; +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_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER; -import static com.android.server.wm.WindowSurfaceController.SurfaceTrace; import static com.android.server.wm.WindowStateAnimator.WINDOW_FREEZE_LAYER; +import static com.android.server.wm.WindowSurfaceController.SurfaceTrace; + import android.content.Context; import android.graphics.Matrix; import android.graphics.PixelFormat; @@ -28,16 +33,18 @@ import android.graphics.Rect; import android.util.Slog; import android.view.Display; import android.view.DisplayInfo; -import android.view.Surface.OutOfResourcesException; import android.view.Surface; +import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; import android.view.SurfaceSession; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.Transformation; +import java.io.PrintWriter; + class ScreenRotationAnimation { - static final String TAG = "ScreenRotationAnimation"; + static final String TAG = TAG_WITH_CLASS_NAME ? "ScreenRotationAnimation" : TAG_WM; static final boolean DEBUG_STATE = false; static final boolean DEBUG_TRANSFORMS = false; static final boolean TWO_PHASE_ANIMATION = false; @@ -244,7 +251,7 @@ class ScreenRotationAnimation { mOriginalHeight = originalHeight; if (!inTransaction) { - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, ">>> OPEN TRANSACTION ScreenRotationAnimation"); SurfaceControl.openTransaction(); } @@ -256,7 +263,7 @@ class ScreenRotationAnimation { flags |= SurfaceControl.SECURE; } - if (WindowManagerService.DEBUG_SURFACE_TRACE) { + if (DEBUG_SURFACE_TRACE) { mSurfaceControl = new SurfaceTrace(session, "ScreenshotSurface", mWidth, mHeight, PixelFormat.OPAQUE, flags); @@ -282,15 +289,14 @@ class ScreenRotationAnimation { Slog.w(TAG, "Unable to allocate freeze surface", e); } - if (WindowManagerService.SHOW_TRANSACTIONS || - WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG, - " FREEZE " + mSurfaceControl + ": CREATE"); + if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM, + " FREEZE " + mSurfaceControl + ": CREATE"); setRotationInTransaction(originalRotation); } finally { if (!inTransaction) { SurfaceControl.closeTransaction(); - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, "<<< CLOSE TRANSACTION ScreenRotationAnimation"); } } @@ -537,8 +543,8 @@ class ScreenRotationAnimation { final int layerStack = mDisplayContent.getDisplay().getLayerStack(); if (USE_CUSTOM_BLACK_FRAME && mCustomBlackFrame == null) { - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( - WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( + TAG_WM, ">>> OPEN TRANSACTION ScreenRotationAnimation.startAnimation"); SurfaceControl.openTransaction(); @@ -561,15 +567,15 @@ class ScreenRotationAnimation { Slog.w(TAG, "Unable to allocate black surface", e); } finally { SurfaceControl.closeTransaction(); - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( - WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( + TAG_WM, "<<< CLOSE TRANSACTION ScreenRotationAnimation.startAnimation"); } } if (!customAnim && mExitingBlackFrame == null) { - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( - WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( + TAG_WM, ">>> OPEN TRANSACTION ScreenRotationAnimation.startAnimation"); SurfaceControl.openTransaction(); try { @@ -601,15 +607,15 @@ class ScreenRotationAnimation { Slog.w(TAG, "Unable to allocate black surface", e); } finally { SurfaceControl.closeTransaction(); - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( - WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( + TAG_WM, "<<< CLOSE TRANSACTION ScreenRotationAnimation.startAnimation"); } } if (customAnim && mEnteringBlackFrame == null) { - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( - WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( + TAG_WM, ">>> OPEN TRANSACTION ScreenRotationAnimation.startAnimation"); SurfaceControl.openTransaction(); @@ -623,8 +629,8 @@ class ScreenRotationAnimation { Slog.w(TAG, "Unable to allocate black surface", e); } finally { SurfaceControl.closeTransaction(); - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( - WindowManagerService.TAG, + if (SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i( + TAG_WM, "<<< CLOSE TRANSACTION ScreenRotationAnimation.startAnimation"); } } @@ -657,8 +663,8 @@ class ScreenRotationAnimation { public void kill() { if (DEBUG_STATE) Slog.v(TAG, "Kill!"); if (mSurfaceControl != null) { - if (WindowManagerService.SHOW_TRANSACTIONS || - WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG, + if (SHOW_TRANSACTIONS || + SHOW_SURFACE_ALLOC) Slog.i(TAG_WM, " FREEZE " + mSurfaceControl + ": DESTROY"); mSurfaceControl.destroy(); mSurfaceControl = null; diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java index 6e2e8308ba63..1b6957d9e554 100644 --- a/services/core/java/com/android/server/wm/Session.java +++ b/services/core/java/com/android/server/wm/Session.java @@ -16,12 +16,11 @@ package com.android.server.wm; -import android.view.IWindowId; -import android.view.IWindowSessionCallback; -import com.android.internal.view.IInputContext; -import com.android.internal.view.IInputMethodClient; -import com.android.internal.view.IInputMethodManager; -import com.android.server.wm.WindowManagerService.H; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.content.ClipData; import android.content.Context; @@ -39,13 +38,20 @@ import android.os.UserHandle; import android.util.Slog; import android.view.Display; import android.view.IWindow; +import android.view.IWindowId; import android.view.IWindowSession; +import android.view.IWindowSessionCallback; import android.view.InputChannel; import android.view.Surface; import android.view.SurfaceControl; import android.view.SurfaceSession; import android.view.WindowManager; +import com.android.internal.view.IInputContext; +import com.android.internal.view.IInputMethodClient; +import com.android.internal.view.IInputMethodManager; +import com.android.server.wm.WindowManagerService.H; + import java.io.PrintWriter; /** @@ -131,7 +137,7 @@ final class Session extends IWindowSession.Stub } catch (RuntimeException e) { // Log all 'real' exceptions thrown to the caller if (!(e instanceof SecurityException)) { - Slog.wtf(WindowManagerService.TAG, "Window Session Crash", e); + Slog.wtf(TAG_WM, "Window Session Crash", e); } throw e; } @@ -200,13 +206,13 @@ final class Session extends IWindowSession.Stub Rect outVisibleInsets, Rect outStableInsets, Rect outsets, Configuration outConfig, Surface outSurface) { - if (false) Slog.d(WindowManagerService.TAG, ">>>>>> ENTERED relayout from " + if (false) Slog.d(TAG_WM, ">>>>>> ENTERED relayout from " + Binder.getCallingPid()); int res = mService.relayoutWindow(this, window, seq, attrs, requestedWidth, requestedHeight, viewFlags, flags, outFrame, outOverscanInsets, outContentInsets, outVisibleInsets, outStableInsets, outsets, outConfig, outSurface); - if (false) Slog.d(WindowManagerService.TAG, "<<<<<< EXITING relayout to " + if (false) Slog.d(TAG_WM, "<<<<<< EXITING relayout to " + Binder.getCallingPid()); return res; } @@ -235,7 +241,7 @@ final class Session extends IWindowSession.Stub public void finishDrawing(IWindow window) { if (WindowManagerService.localLOGV) Slog.v( - WindowManagerService.TAG, "IWindow finishDrawing called for " + window); + TAG_WM, "IWindow finishDrawing called for " + window); mService.finishDrawingWindow(this, window); } @@ -275,24 +281,24 @@ final class Session extends IWindowSession.Stub public boolean performDrag(IWindow window, IBinder dragToken, float touchX, float touchY, float thumbCenterX, float thumbCenterY, ClipData data) { - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "perform drag: win=" + window + " data=" + data); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "perform drag: win=" + window + " data=" + data); } synchronized (mService.mWindowMap) { if (mService.mDragState == null) { - Slog.w(WindowManagerService.TAG, "No drag prepared"); + Slog.w(TAG_WM, "No drag prepared"); throw new IllegalStateException("performDrag() without prepareDrag()"); } if (dragToken != mService.mDragState.mToken) { - Slog.w(WindowManagerService.TAG, "Performing mismatched drag"); + Slog.w(TAG_WM, "Performing mismatched drag"); throw new IllegalStateException("performDrag() does not match prepareDrag()"); } WindowState callingWin = mService.windowForClientLocked(null, window, false); if (callingWin == null) { - Slog.w(WindowManagerService.TAG, "Bad requesting window " + window); + Slog.w(TAG_WM, "Bad requesting window " + window); return false; // !!! TODO: throw here? } @@ -317,7 +323,7 @@ final class Session extends IWindowSession.Stub mService.mInputMonitor.updateInputWindowsLw(true /*force*/); if (!mService.mInputManager.transferTouchFocus(callingWin.mInputChannel, mService.mDragState.mServerChannel)) { - Slog.e(WindowManagerService.TAG, "Unable to transfer touch focus"); + Slog.e(TAG_WM, "Unable to transfer touch focus"); mService.mDragState.unregister(); mService.mDragState = null; mService.mInputMonitor.updateInputWindowsLw(true /*force*/); @@ -333,8 +339,8 @@ final class Session extends IWindowSession.Stub // Make the surface visible at the proper location final SurfaceControl surfaceControl = mService.mDragState.mSurfaceControl; - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i( - WindowManagerService.TAG, ">>> OPEN TRANSACTION performDrag"); + if (SHOW_LIGHT_TRANSACTIONS) Slog.i( + TAG_WM, ">>> OPEN TRANSACTION performDrag"); SurfaceControl.openTransaction(); try { surfaceControl.setPosition(touchX - thumbCenterX, @@ -344,8 +350,8 @@ final class Session extends IWindowSession.Stub surfaceControl.show(); } finally { SurfaceControl.closeTransaction(); - if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i( - WindowManagerService.TAG, "<<< CLOSE TRANSACTION performDrag"); + if (SHOW_LIGHT_TRANSACTIONS) Slog.i( + TAG_WM, "<<< CLOSE TRANSACTION performDrag"); } } @@ -353,16 +359,16 @@ final class Session extends IWindowSession.Stub } public boolean startMovingTask(IWindow window, float startX, float startY) { - if (WindowManagerService.DEBUG_TASK_POSITIONING) Slog.d( - WindowManagerService.TAG, "startMovingTask: {" + startX + "," + startY + "}"); + if (DEBUG_TASK_POSITIONING) Slog.d( + TAG_WM, "startMovingTask: {" + startX + "," + startY + "}"); return mService.startMovingTask(window, startX, startY); } public void reportDropResult(IWindow window, boolean consumed) { IBinder token = window.asBinder(); - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "Drop result=" + consumed + " reported by " + token); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "Drop result=" + consumed + " reported by " + token); } synchronized (mService.mWindowMap) { @@ -371,13 +377,13 @@ final class Session extends IWindowSession.Stub if (mService.mDragState == null) { // Most likely the drop recipient ANRed and we ended the drag // out from under it. Log the issue and move on. - Slog.w(WindowManagerService.TAG, "Drop result given but no drag in progress"); + Slog.w(TAG_WM, "Drop result given but no drag in progress"); return; } if (mService.mDragState.mToken != token) { // We're in a drag, but the wrong window has responded. - Slog.w(WindowManagerService.TAG, "Invalid drop-result claim by " + window); + Slog.w(TAG_WM, "Invalid drop-result claim by " + window); throw new IllegalStateException("reportDropResult() by non-recipient"); } @@ -387,7 +393,7 @@ final class Session extends IWindowSession.Stub mService.mH.removeMessages(H.DRAG_END_TIMEOUT, window.asBinder()); WindowState callingWin = mService.windowForClientLocked(null, window, false); if (callingWin == null) { - Slog.w(WindowManagerService.TAG, "Bad result-reporting window " + window); + Slog.w(TAG_WM, "Bad result-reporting window " + window); return; // !!! TODO: throw here? } @@ -400,20 +406,20 @@ final class Session extends IWindowSession.Stub } public void cancelDragAndDrop(IBinder dragToken) { - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "cancelDragAndDrop"); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "cancelDragAndDrop"); } synchronized (mService.mWindowMap) { long ident = Binder.clearCallingIdentity(); try { if (mService.mDragState == null) { - Slog.w(WindowManagerService.TAG, "cancelDragAndDrop() without prepareDrag()"); + Slog.w(TAG_WM, "cancelDragAndDrop() without prepareDrag()"); throw new IllegalStateException("cancelDragAndDrop() without prepareDrag()"); } if (mService.mDragState.mToken != dragToken) { - Slog.w(WindowManagerService.TAG, + Slog.w(TAG_WM, "cancelDragAndDrop() does not match prepareDrag()"); throw new IllegalStateException( "cancelDragAndDrop() does not match prepareDrag()"); @@ -428,14 +434,14 @@ final class Session extends IWindowSession.Stub } public void dragRecipientEntered(IWindow window) { - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "Drag into new candidate view @ " + window.asBinder()); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "Drag into new candidate view @ " + window.asBinder()); } } public void dragRecipientExited(IWindow window) { - if (WindowManagerService.DEBUG_DRAG) { - Slog.d(WindowManagerService.TAG, "Drag from old candidate view @ " + window.asBinder()); + if (DEBUG_DRAG) { + Slog.d(TAG_WM, "Drag from old candidate view @ " + window.asBinder()); } } @@ -518,10 +524,10 @@ final class Session extends IWindowSession.Stub void windowAddedLocked() { if (mSurfaceSession == null) { if (WindowManagerService.localLOGV) Slog.v( - WindowManagerService.TAG, "First window added to " + this + ", creating SurfaceSession"); + TAG_WM, "First window added to " + this + ", creating SurfaceSession"); mSurfaceSession = new SurfaceSession(); - if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i( - WindowManagerService.TAG, " NEW SURFACE SESSION " + mSurfaceSession); + if (SHOW_TRANSACTIONS) Slog.i( + TAG_WM, " NEW SURFACE SESSION " + mSurfaceSession); mService.mSessions.add(this); if (mLastReportedAnimatorScale != mService.getCurrentAnimatorScale()) { mService.dispatchNewAnimatorScaleLocked(this); @@ -540,14 +546,14 @@ final class Session extends IWindowSession.Stub mService.mSessions.remove(this); if (mSurfaceSession != null) { if (WindowManagerService.localLOGV) Slog.v( - WindowManagerService.TAG, "Last window removed from " + this + TAG_WM, "Last window removed from " + this + ", destroying " + mSurfaceSession); - if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i( - WindowManagerService.TAG, " KILL SURFACE SESSION " + mSurfaceSession); + if (SHOW_TRANSACTIONS) Slog.i( + TAG_WM, " KILL SURFACE SESSION " + mSurfaceSession); try { mSurfaceSession.kill(); } catch (Exception e) { - Slog.w(WindowManagerService.TAG, "Exception thrown when killing surface session " + Slog.w(TAG_WM, "Exception thrown when killing surface session " + mSurfaceSession + " in session " + this + ": " + e.toString()); } diff --git a/services/core/java/com/android/server/wm/StrictModeFlash.java b/services/core/java/com/android/server/wm/StrictModeFlash.java index fb5876b65aed..d1547eb04c78 100644 --- a/services/core/java/com/android/server/wm/StrictModeFlash.java +++ b/services/core/java/com/android/server/wm/StrictModeFlash.java @@ -17,6 +17,9 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.graphics.Canvas; import android.graphics.Color; import android.graphics.PixelFormat; @@ -29,7 +32,7 @@ import android.view.SurfaceControl; import android.view.SurfaceSession; class StrictModeFlash { - private static final String TAG = "StrictModeFlash"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "StrictModeFlash" : TAG_WM; private final SurfaceControl mSurfaceControl; private final Surface mSurface = new Surface(); diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index e4f6c5645446..72a834315b5d 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -19,12 +19,11 @@ package com.android.server.wm; import static android.app.ActivityManager.StackId.DOCKED_STACK_ID; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.HOME_STACK_ID; -import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; import static android.app.ActivityManager.RESIZE_MODE_SYSTEM_SCREEN_ROTATION; -import static com.android.server.wm.WindowManagerService.TAG; -import static com.android.server.wm.WindowManagerService.DEBUG_RESIZE; -import static com.android.server.wm.WindowManagerService.DEBUG_STACK; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RESIZE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK; import static com.android.server.wm.WindowManagerService.H.RESIZE_TASK; import static com.android.server.wm.WindowManagerService.H.SHOW_NON_RESIZEABLE_DOCK_TOAST; import static android.view.WindowManager.DOCKED_INVALID; @@ -156,11 +155,11 @@ class Task implements DimLayer.DimLayerUser { void removeLocked() { if (!mAppTokens.isEmpty() && mStack.isAnimating()) { - if (DEBUG_STACK) Slog.i(TAG, "removeTask: deferring removing taskId=" + mTaskId); + if (DEBUG_STACK) Slog.i(TAG_WM, "removeTask: deferring removing taskId=" + mTaskId); mDeferRemoval = true; return; } - if (DEBUG_STACK) Slog.i(TAG, "removeTask: removing taskId=" + mTaskId); + if (DEBUG_STACK) Slog.i(TAG_WM, "removeTask: removing taskId=" + mTaskId); EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "removeTask"); mDeferRemoval = false; DisplayContent content = getDisplayContent(); @@ -175,7 +174,7 @@ class Task implements DimLayer.DimLayerUser { if (stack == mStack) { return; } - if (DEBUG_STACK) Slog.i(TAG, "moveTaskToStack: removing taskId=" + mTaskId + if (DEBUG_STACK) Slog.i(TAG_WM, "moveTaskToStack: removing taskId=" + mTaskId + " from stack=" + mStack); EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "moveTask"); if (mStack != null) { @@ -186,7 +185,7 @@ class Task implements DimLayer.DimLayerUser { void positionTaskInStack(TaskStack stack, int position, Rect bounds, Configuration config) { if (mStack != null && stack != mStack) { - if (DEBUG_STACK) Slog.i(TAG, "positionTaskInStack: removing taskId=" + mTaskId + if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskInStack: removing taskId=" + mTaskId + " from stack=" + mStack); EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "moveTask"); mStack.removeTask(this); @@ -464,7 +463,7 @@ class Task implements DimLayer.DimLayerUser { for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) { final WindowState win = windows.get(winNdx); if (!resizingWindows.contains(win)) { - if (DEBUG_RESIZE) Slog.d(TAG, "setBounds: Resizing " + win); + if (DEBUG_RESIZE) Slog.d(TAG_WM, "setBounds: Resizing " + win); resizingWindows.add(win); } } diff --git a/services/core/java/com/android/server/wm/TaskPositioner.java b/services/core/java/com/android/server/wm/TaskPositioner.java index 32c320560ce8..725bbbc78985 100644 --- a/services/core/java/com/android/server/wm/TaskPositioner.java +++ b/services/core/java/com/android/server/wm/TaskPositioner.java @@ -18,15 +18,18 @@ package com.android.server.wm; import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT; import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; -import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.RESIZE_MODE_USER; import static android.app.ActivityManager.RESIZE_MODE_USER_FORCED; +import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static com.android.server.wm.DimLayer.RESIZING_HINT_ALPHA; import static com.android.server.wm.DimLayer.RESIZING_HINT_DURATION_MS; -import static com.android.server.wm.WindowManagerService.DEBUG_TASK_POSITIONING; -import static com.android.server.wm.WindowManagerService.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.dipToPixel; import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_HEIGHT_IN_DP; import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_WIDTH_IN_DP; @@ -40,13 +43,13 @@ import android.os.RemoteException; import android.os.Trace; import android.util.DisplayMetrics; import android.util.Slog; +import android.view.BatchedInputEventReceiver; import android.view.Choreographer; import android.view.Display; import android.view.DisplayInfo; import android.view.InputChannel; import android.view.InputDevice; import android.view.InputEvent; -import android.view.BatchedInputEventReceiver; import android.view.MotionEvent; import android.view.SurfaceControl; import android.view.WindowManager; @@ -59,7 +62,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; class TaskPositioner implements DimLayer.DimLayerUser { - private static final String TAG = "TaskPositioner"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "TaskPositioner" : TAG_WM; // The margin the pointer position has to be within the side of the screen to be // considered at the side of the screen. @@ -277,7 +280,7 @@ class TaskPositioner implements DimLayer.DimLayerUser { mDragWindowHandle.frameBottom = p.y; // Pause rotations before a drag. - if (WindowManagerService.DEBUG_ORIENTATION) { + if (DEBUG_ORIENTATION) { Slog.d(TAG, "Pausing rotation during re-position"); } mService.pauseRotationLocked(); @@ -321,7 +324,7 @@ class TaskPositioner implements DimLayer.DimLayerUser { mDragEnded = true; // Resume rotations after a drag. - if (WindowManagerService.DEBUG_ORIENTATION) { + if (DEBUG_ORIENTATION) { Slog.d(TAG, "Resuming rotation after re-position"); } mService.resumeRotationLocked(); diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 996fadfcb460..49d9efe68558 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -39,9 +39,9 @@ import static android.view.WindowManager.DOCKED_INVALID; import static android.view.WindowManager.DOCKED_LEFT; import static android.view.WindowManager.DOCKED_RIGHT; import static android.view.WindowManager.DOCKED_TOP; -import static com.android.server.wm.WindowManagerService.DEBUG_TASK_MOVEMENT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_MOVEMENT; import static com.android.server.wm.WindowManagerService.H.RESIZE_STACK; -import static com.android.server.wm.WindowManagerService.TAG; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; public class TaskStack implements DimLayer.DimLayerUser { @@ -138,7 +138,7 @@ public class TaskStack implements DimLayer.DimLayerUser { task.setBounds(bounds, config); } } else { - Slog.wtf(TAG, "No config for task: " + task + ", is there a mismatch with AM?"); + Slog.wtf(TAG_WM, "No config for task: " + task + ", is there a mismatch with AM?"); } } return true; @@ -285,7 +285,7 @@ public class TaskStack implements DimLayer.DimLayerUser { // Reset position based on minimum/maximum possible positions. position = Math.min(Math.max(position, minPosition), maxPosition); - if (DEBUG_TASK_MOVEMENT) Slog.d(TAG, + if (DEBUG_TASK_MOVEMENT) Slog.d(TAG_WM, "positionTask: task=" + task + " position=" + position); mTasks.add(position, task); @@ -338,14 +338,14 @@ public class TaskStack implements DimLayer.DimLayerUser { } void moveTaskToTop(Task task) { - if (DEBUG_TASK_MOVEMENT) Slog.d(TAG, "moveTaskToTop: task=" + task + " Callers=" + if (DEBUG_TASK_MOVEMENT) Slog.d(TAG_WM, "moveTaskToTop: task=" + task + " Callers=" + Debug.getCallers(6)); mTasks.remove(task); addTask(task, true); } void moveTaskToBottom(Task task) { - if (DEBUG_TASK_MOVEMENT) Slog.d(TAG, "moveTaskToBottom: task=" + task); + if (DEBUG_TASK_MOVEMENT) Slog.d(TAG_WM, "moveTaskToBottom: task=" + task); mTasks.remove(task); addTask(task, false); } @@ -356,7 +356,7 @@ public class TaskStack implements DimLayer.DimLayerUser { * @param task The Task to delete. */ void removeTask(Task task) { - if (DEBUG_TASK_MOVEMENT) Slog.d(TAG, "removeTask: task=" + task); + if (DEBUG_TASK_MOVEMENT) Slog.d(TAG_WM, "removeTask: task=" + task); mTasks.remove(task); if (mDisplayContent != null) { if (mTasks.isEmpty()) { @@ -433,7 +433,7 @@ public class TaskStack implements DimLayer.DimLayerUser { final int dockedSide = dockedStack.getDockSide(); if (dockedSide == DOCKED_INVALID) { // Not sure how you got here...Only thing we can do is return current bounds. - Slog.e(TAG, "Failed to get valid docked side for docked stack=" + dockedStack); + Slog.e(TAG_WM, "Failed to get valid docked side for docked stack=" + dockedStack); outBounds.set(mBounds); return; } diff --git a/services/core/java/com/android/server/wm/ViewServer.java b/services/core/java/com/android/server/wm/ViewServer.java index 741cee3a06d3..ecf5652a1e69 100644 --- a/services/core/java/com/android/server/wm/ViewServer.java +++ b/services/core/java/com/android/server/wm/ViewServer.java @@ -17,6 +17,9 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.util.Slog; import java.net.ServerSocket; @@ -47,7 +50,7 @@ class ViewServer implements Runnable { private static final int VIEW_SERVER_MAX_CONNECTIONS = 10; // Debug facility - private static final String LOG_TAG = "ViewServer"; + private static final String LOG_TAG = TAG_WITH_CLASS_NAME ? "ViewServer" : TAG_WM; private static final String VALUE_PROTOCOL_VERSION = "4"; private static final String VALUE_SERVER_VERSION = "4"; @@ -150,7 +153,7 @@ class ViewServer implements Runnable { * * @see #start() * @see #stop() - * @see WindowManagerService#isViewServerRunning() + * @see WindowManagerService#isViewServerRunning() */ boolean isRunning() { return mThread != null && mThread.isAlive(); diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java index 8b984f03ebd0..3db9ae0c4c82 100644 --- a/services/core/java/com/android/server/wm/WallpaperController.java +++ b/services/core/java/com/android/server/wm/WallpaperController.java @@ -22,13 +22,15 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; -import static com.android.server.wm.WindowManagerService.DEBUG_ADD_REMOVE; -import static com.android.server.wm.WindowManagerService.DEBUG_APP_TRANSITIONS; -import static com.android.server.wm.WindowManagerService.DEBUG_LAYERS; -import static com.android.server.wm.WindowManagerService.DEBUG_WINDOW_MOVEMENT; -import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY; -import static com.android.server.wm.WindowManagerService.DEBUG_WALLPAPER; -import static com.android.server.wm.WindowManagerService.DEBUG_WALLPAPER_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.H.WALLPAPER_DRAW_PENDING_TIMEOUT; import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER; import static com.android.server.wm.WindowManagerService.TYPE_LAYER_OFFSET; @@ -51,7 +53,7 @@ import java.util.ArrayList; * NOTE: All methods in this class must be called with the window manager service lock held. */ class WallpaperController { - private static final String TAG = com.android.server.wm.WindowManagerService.TAG; + private static final String TAG = TAG_WITH_CLASS_NAME ? "WallpaperController" : TAG_WM; final private WindowManagerService mService; private final ArrayList<WindowToken> mWallpaperTokens = new ArrayList<>(); diff --git a/services/core/java/com/android/server/wm/Watermark.java b/services/core/java/com/android/server/wm/Watermark.java index e226e3d73e47..171e575c1801 100644 --- a/services/core/java/com/android/server/wm/Watermark.java +++ b/services/core/java/com/android/server/wm/Watermark.java @@ -16,6 +16,8 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PixelFormat; @@ -53,9 +55,9 @@ class Watermark { Watermark(Display display, DisplayMetrics dm, SurfaceSession session, String[] tokens) { if (false) { - Log.i(WindowManagerService.TAG, "*********************** WATERMARK"); + Log.i(TAG_WM, "*********************** WATERMARK"); for (int i=0; i<tokens.length; i++) { - Log.i(WindowManagerService.TAG, " TOKEN #" + i + ": " + tokens[i]); + Log.i(TAG_WM, " TOKEN #" + i + ": " + tokens[i]); } } @@ -78,7 +80,7 @@ class Watermark { } mText = builder.toString(); if (false) { - Log.i(WindowManagerService.TAG, "Final text: " + mText); + Log.i(TAG_WM, "Final text: " + mText); } int fontSize = WindowManagerService.getPropertyInt(tokens, 1, diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index f20c4e51a1bf..a6523a471ff2 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -21,15 +21,17 @@ import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; -import static com.android.server.wm.WindowManagerService.DEBUG_ANIM; -import static com.android.server.wm.WindowManagerService.DEBUG_FOCUS_LIGHT; -import static com.android.server.wm.WindowManagerService.DEBUG_KEYGUARD; -import static com.android.server.wm.WindowManagerService.DEBUG_LAYOUT_REPEATS; -import static com.android.server.wm.WindowManagerService.DEBUG_ORIENTATION; -import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY; -import static com.android.server.wm.WindowManagerService.DEBUG_WALLPAPER; -import static com.android.server.wm.WindowManagerService.DEBUG_WINDOW_TRACE; -import static com.android.server.wm.WindowManagerService.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_KEYGUARD; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowSurfacePlacer.SET_FORCE_HIDING_CHANGED; import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE; import static com.android.server.wm.WindowSurfacePlacer.SET_UPDATE_ROTATION; @@ -56,7 +58,7 @@ import java.util.ArrayList; * on behalf of WindowManagerService. */ public class WindowAnimator { - private static final String TAG = "WindowAnimator"; + private static final String TAG = TAG_WITH_CLASS_NAME ? "WindowAnimator" : TAG_WM; /** How long to give statusbar to clear the private keyguard flag when animating out */ private static final long KEYGUARD_ANIM_TIMEOUT_MS = 1000; diff --git a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java new file mode 100644 index 000000000000..a49bb31a239c --- /dev/null +++ b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2007 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package com.android.server.wm; + +/** + * Common class for the various debug {@link android.util.Log} output configuration in the window + * manager package. + */ +public class WindowManagerDebugConfig { + // All output logs in the window manager package use the {@link #TAG_WM} string for tagging + // their log output. This makes it easy to identify the origin of the log message when sifting + // through a large amount of log output from multiple sources. However, it also makes trying + // to figure-out the origin of a log message while debugging the window manager a little + // painful. By setting this constant to true, log messages from the window manager package + // will be tagged with their class names instead fot the generic tag. + static final boolean TAG_WITH_CLASS_NAME = false; + + // Default log tag for the window manager package. + static final String TAG_WM = "WindowManager"; + + static final boolean DEBUG_RESIZE = false; + static final boolean DEBUG = false; + static final boolean DEBUG_ADD_REMOVE = false; + static final boolean DEBUG_FOCUS = false; + static final boolean DEBUG_FOCUS_LIGHT = DEBUG_FOCUS || false; + static final boolean DEBUG_ANIM = false; + static final boolean DEBUG_KEYGUARD = false; + static final boolean DEBUG_LAYOUT = false; + static final boolean DEBUG_LAYERS = false; + static final boolean DEBUG_INPUT = false; + static final boolean DEBUG_INPUT_METHOD = false; + static final boolean DEBUG_VISIBILITY = false; + static final boolean DEBUG_WINDOW_MOVEMENT = false; + static final boolean DEBUG_TOKEN_MOVEMENT = false; + static final boolean DEBUG_ORIENTATION = false; + static final boolean DEBUG_APP_ORIENTATION = false; + static final boolean DEBUG_CONFIGURATION = false; + static final boolean DEBUG_APP_TRANSITIONS = false; + static final boolean DEBUG_STARTING_WINDOW = false; + static final boolean DEBUG_WALLPAPER = false; + static final boolean DEBUG_WALLPAPER_LIGHT = false || DEBUG_WALLPAPER; + static final boolean DEBUG_DRAG = false; + static final boolean DEBUG_SCREEN_ON = false; + static final boolean DEBUG_SCREENSHOT = false; + static final boolean DEBUG_BOOT = false; + static final boolean DEBUG_LAYOUT_REPEATS = true; + static final boolean DEBUG_SURFACE_TRACE = false; + static final boolean DEBUG_WINDOW_TRACE = false; + static final boolean DEBUG_TASK_MOVEMENT = false; + static final boolean DEBUG_TASK_POSITIONING = false; + static final boolean DEBUG_STACK = false; + static final boolean DEBUG_DISPLAY = false; + static final boolean DEBUG_POWER = false; + static final boolean DEBUG_DIM_LAYER = false; + static final boolean SHOW_SURFACE_ALLOC = false; + static final boolean SHOW_TRANSACTIONS = false; + static final boolean SHOW_VERBOSE_TRANSACTIONS = false && SHOW_TRANSACTIONS; + static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS; + static final boolean HIDE_STACK_CRAWLS = true; + static final boolean DEBUG_WINDOW_CROP = false; +} diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 5237a13f94a8..fa71cfc5c545 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -20,8 +20,8 @@ import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; import static android.app.ActivityManager.StackId.DOCKED_STACK_ID; import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.StatusBarManager.DISABLE_MASK; -import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND; +import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.view.WindowManager.DOCKED_INVALID; import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW; import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW; @@ -50,15 +50,47 @@ import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static android.view.WindowManagerGlobal.RELAYOUT_DEFER_SURFACE_DESTROY; import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; - import static com.android.server.wm.AppWindowAnimator.PROLONG_ANIMATION_AT_END; import static com.android.server.wm.AppWindowAnimator.PROLONG_ANIMATION_AT_START; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_BOOT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_CONFIGURATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT_METHOD; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_KEYGUARD; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RESIZE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREENSHOT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREEN_ON; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TOKEN_MOVEMENT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.HIDE_STACK_CRAWLS; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS; +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.SHOW_VERBOSE_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.Manifest; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.annotation.Nullable; -import android.app.ActivityManager; import android.app.ActivityManager.StackId; import android.app.ActivityManagerNative; import android.app.AppOpsManager; @@ -122,8 +154,8 @@ import android.view.Display; import android.view.DisplayInfo; import android.view.DropPermissionHolder; import android.view.Gravity; -import android.view.IApplicationToken; import android.view.IAppTransitionAnimationSpecsFuture; +import android.view.IApplicationToken; import android.view.IDockDividerVisibilityListener; import android.view.IInputFilter; import android.view.IOnKeyguardExitResult; @@ -155,8 +187,8 @@ import android.view.WindowManagerPolicy.PointerEventListener; import android.view.animation.Animation; import android.widget.Toast; -import com.android.internal.app.IAssistScreenshotReceiver; import com.android.internal.R; +import com.android.internal.app.IAssistScreenshotReceiver; import com.android.internal.util.FastPrintWriter; import com.android.internal.view.IInputContext; import com.android.internal.view.IInputMethodClient; @@ -196,46 +228,6 @@ import java.util.List; /** {@hide} */ public class WindowManagerService extends IWindowManager.Stub implements Watchdog.Monitor, WindowManagerPolicy.WindowManagerFuncs { - static final String TAG = "WindowManager"; - static final boolean DEBUG = false; - static final boolean DEBUG_ADD_REMOVE = false; - static final boolean DEBUG_FOCUS = false; - static final boolean DEBUG_FOCUS_LIGHT = DEBUG_FOCUS || false; - static final boolean DEBUG_ANIM = false; - static final boolean DEBUG_KEYGUARD = false; - static final boolean DEBUG_LAYOUT = false; - static final boolean DEBUG_RESIZE = false; - static final boolean DEBUG_LAYERS = false; - static final boolean DEBUG_INPUT = false; - static final boolean DEBUG_INPUT_METHOD = false; - static final boolean DEBUG_VISIBILITY = false; - static final boolean DEBUG_WINDOW_MOVEMENT = false; - static final boolean DEBUG_TOKEN_MOVEMENT = false; - static final boolean DEBUG_ORIENTATION = false; - static final boolean DEBUG_APP_ORIENTATION = false; - static final boolean DEBUG_CONFIGURATION = false; - static final boolean DEBUG_APP_TRANSITIONS = false; - static final boolean DEBUG_STARTING_WINDOW = false; - static final boolean DEBUG_WALLPAPER = false; - static final boolean DEBUG_WALLPAPER_LIGHT = false || DEBUG_WALLPAPER; - static final boolean DEBUG_DRAG = false; - static final boolean DEBUG_SCREEN_ON = false; - static final boolean DEBUG_SCREENSHOT = false; - static final boolean DEBUG_BOOT = false; - static final boolean DEBUG_LAYOUT_REPEATS = true; - static final boolean DEBUG_SURFACE_TRACE = false; - static final boolean DEBUG_WINDOW_TRACE = false; - static final boolean DEBUG_TASK_MOVEMENT = false; - static final boolean DEBUG_TASK_POSITIONING = false; - static final boolean DEBUG_STACK = false; - static final boolean DEBUG_DISPLAY = false; - static final boolean DEBUG_POWER = false; - static final boolean DEBUG_DIM_LAYER = false; - static final boolean SHOW_SURFACE_ALLOC = false; - static final boolean SHOW_TRANSACTIONS = false; - static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS; - static final boolean SHOW_VERBOSE_TRANSACTIONS = false && SHOW_TRANSACTIONS; - static final boolean HIDE_STACK_CRAWLS = true; static final int LAYOUT_REPEAT_THRESHOLD = 4; static final boolean PROFILE_ORIENTATION = false; @@ -706,13 +698,13 @@ public class WindowManagerService extends IWindowManager.Stub switch (motionEvent.getAction()) { case MotionEvent.ACTION_DOWN: { if (DEBUG_DRAG) { - Slog.w(TAG, "Unexpected ACTION_DOWN in drag layer"); + Slog.w(TAG_WM, "Unexpected ACTION_DOWN in drag layer"); } } break; case MotionEvent.ACTION_MOVE: { if (mStylusButtonDownAtStart && !isStylusButtonDown) { - if (DEBUG_DRAG) Slog.d(TAG, "Button no longer pressed; dropping at " + if (DEBUG_DRAG) Slog.d(TAG_WM, "Button no longer pressed; dropping at " + newX + "," + newY); synchronized (mWindowMap) { endDrag = completeDropLw(newX, newY); @@ -726,7 +718,7 @@ public class WindowManagerService extends IWindowManager.Stub } break; case MotionEvent.ACTION_UP: { - if (DEBUG_DRAG) Slog.d(TAG, "Got UP on move channel; dropping at " + if (DEBUG_DRAG) Slog.d(TAG_WM, "Got UP on move channel; dropping at " + newX + "," + newY); synchronized (mWindowMap) { endDrag = completeDropLw(newX, newY); @@ -734,13 +726,13 @@ public class WindowManagerService extends IWindowManager.Stub } break; case MotionEvent.ACTION_CANCEL: { - if (DEBUG_DRAG) Slog.d(TAG, "Drag cancelled!"); + if (DEBUG_DRAG) Slog.d(TAG_WM, "Drag cancelled!"); endDrag = true; } break; } if (endDrag) { - if (DEBUG_DRAG) Slog.d(TAG, "Drag ended; tearing down state"); + if (DEBUG_DRAG) Slog.d(TAG_WM, "Drag ended; tearing down state"); // tell all the windows that the drag has ended synchronized (mWindowMap) { mDragState.endDragLw(); @@ -752,7 +744,7 @@ public class WindowManagerService extends IWindowManager.Stub handled = true; } } catch (Exception e) { - Slog.e(TAG, "Exception caught by drag handleMotion", e); + Slog.e(TAG_WM, "Exception caught by drag handleMotion", e); } finally { finishInputEvent(event, handled); } @@ -889,7 +881,7 @@ public class WindowManagerService extends IWindowManager.Stub LocalServices.addService(WindowManagerPolicy.class, mPolicy); - mPointerEventDispatcher = new PointerEventDispatcher(mInputManager.monitorInput(TAG)); + mPointerEventDispatcher = new PointerEventDispatcher(mInputManager.monitorInput(TAG_WM)); mFxSession = new SurfaceSession(); mDisplayManager = (DisplayManager)context.getSystemService(Context.DISPLAY_SERVICE); @@ -950,7 +942,7 @@ public class WindowManagerService extends IWindowManager.Stub updateShowImeWithHardKeyboard(); mHoldingScreenWakeLock = mPowerManager.newWakeLock( - PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, TAG); + PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, TAG_WM); mHoldingScreenWakeLock.setReferenceCounted(false); mAnimator = new WindowAnimator(this); @@ -988,7 +980,7 @@ public class WindowManagerService extends IWindowManager.Stub // The window manager only throws security exceptions, so let's // log all others. if (!(e instanceof SecurityException)) { - Slog.wtf(TAG, "Window Manager Crash", e); + Slog.wtf(TAG_WM, "Window Manager Crash", e); } throw e; } @@ -998,7 +990,7 @@ public class WindowManagerService extends IWindowManager.Stub final WindowList windows = pos.getWindowList(); final int i = windows.indexOf(pos); if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v( - TAG, "Adding window " + window + " at " + TAG_WM, "Adding window " + window + " at " + (i+1) + " of " + windows.size() + " (after " + pos + ")"); windows.add(i+1, window); mWindowsChanged = true; @@ -1008,10 +1000,10 @@ public class WindowManagerService extends IWindowManager.Stub final WindowList windows = pos.getWindowList(); int i = windows.indexOf(pos); if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v( - TAG, "Adding window " + window + " at " + TAG_WM, "Adding window " + window + " at " + i + " of " + windows.size() + " (before " + pos + ")"); if (i < 0) { - Slog.w(TAG, "placeWindowBefore: Unable to find " + pos + " in " + windows); + Slog.w(TAG_WM, "placeWindowBefore: Unable to find " + pos + " in " + windows); i = 0; } windows.add(i, window); @@ -1087,7 +1079,7 @@ public class WindowManagerService extends IWindowManager.Stub } // No windows from this token on this display - if (localLOGV) Slog.v(TAG, "Figuring out where to add app window " + client.asBinder() + if (localLOGV) Slog.v(TAG_WM, "Figuring out where to add app window " + client.asBinder() + " (token=" + token + ")"); // Figure out where the window should go, based on the // order of applications. @@ -1195,7 +1187,7 @@ public class WindowManagerService extends IWindowManager.Stub break; } } - if (DEBUG_FOCUS_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, + if (DEBUG_FOCUS_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Based on layer: Adding window " + win + " at " + (i + 1) + " of " + windows.size()); windows.add(i + 1, win); @@ -1227,7 +1219,7 @@ public class WindowManagerService extends IWindowManager.Stub //apptoken note that the window could be a floating window //that was created later or a window at the top of the list of //windows associated with this token. - if (DEBUG_FOCUS_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, + if (DEBUG_FOCUS_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "not Base app: Adding window " + win + " at " + (newIdx + 1) + " of " + windows.size()); windows.add(newIdx + 1, win); @@ -1265,7 +1257,7 @@ public class WindowManagerService extends IWindowManager.Stub } } i++; - if (DEBUG_FOCUS_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, + if (DEBUG_FOCUS_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Free window: Adding window " + win + " at " + i + " of " + windows.size()); windows.add(i, win); mWindowsChanged = true; @@ -1300,7 +1292,7 @@ public class WindowManagerService extends IWindowManager.Stub // in the same sublayer. if (wSublayer >= sublayer) { if (addToToken) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Adding " + win + " to " + token); token.windows.add(i, win); } placeWindowBefore(wSublayer >= 0 ? attached : w, win); @@ -1311,7 +1303,7 @@ public class WindowManagerService extends IWindowManager.Stub // in the same sublayer. if (wSublayer > sublayer) { if (addToToken) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Adding " + win + " to " + token); token.windows.add(i, win); } placeWindowBefore(w, win); @@ -1321,7 +1313,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (i >= NA) { if (addToToken) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Adding " + win + " to " + token); token.windows.add(win); } if (sublayer < 0) { @@ -1336,7 +1328,7 @@ public class WindowManagerService extends IWindowManager.Stub } private void addWindowToListInOrderLocked(final WindowState win, boolean addToToken) { - if (DEBUG_FOCUS_LIGHT) Slog.d(TAG, "addWindowToListInOrderLocked: win=" + win + + if (DEBUG_FOCUS_LIGHT) Slog.d(TAG_WM, "addWindowToListInOrderLocked: win=" + win + " Callers=" + Debug.getCallers(4)); if (win.mAttachedWindow == null) { final WindowToken token = win.mToken; @@ -1347,7 +1339,7 @@ public class WindowManagerService extends IWindowManager.Stub addFreeWindowToListLocked(win); } if (addToToken) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Adding " + win + " to " + token); token.windows.add(tokenWindowsPos, win); } } else { @@ -1375,9 +1367,9 @@ public class WindowManagerService extends IWindowManager.Stub if (fl == 0 || fl == (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM) || type == TYPE_APPLICATION_STARTING || type == TYPE_DOCK_DIVIDER) { if (DEBUG_INPUT_METHOD) { - Slog.i(TAG, "isVisibleOrAdding " + w + ": " + w.isVisibleOrAdding()); + Slog.i(TAG_WM, "isVisibleOrAdding " + w + ": " + w.isVisibleOrAdding()); if (!w.isVisibleOrAdding()) { - Slog.i(TAG, " mSurfaceController=" + w.mWinAnimator.mSurfaceController + Slog.i(TAG_WM, " mSurfaceController=" + w.mWinAnimator.mSurfaceController + " relayoutCalled=" + w.mRelayoutCalled + " viewVis=" + w.mViewVisibility + " policyVis=" + w.mPolicyVisibility @@ -1385,7 +1377,7 @@ public class WindowManagerService extends IWindowManager.Stub + " attachHid=" + w.mAttachedHidden + " exiting=" + w.mExiting + " destroying=" + w.mDestroying); if (w.mAppToken != null) { - Slog.i(TAG, " mAppToken.hiddenRequested=" + w.mAppToken.hiddenRequested); + Slog.i(TAG_WM, " mAppToken.hiddenRequested=" + w.mAppToken.hiddenRequested); } } } @@ -1409,11 +1401,11 @@ public class WindowManagerService extends IWindowManager.Stub for (i = windows.size() - 1; i >= 0; --i) { WindowState win = windows.get(i); - if (DEBUG_INPUT_METHOD && willMove) Slog.i(TAG, "Checking window @" + i + if (DEBUG_INPUT_METHOD && willMove) Slog.i(TAG_WM, "Checking window @" + i + " " + win + " fl=0x" + Integer.toHexString(win.mAttrs.flags)); if (canBeImeTarget(win)) { w = win; - //Slog.i(TAG, "Putting input method here!"); + //Slog.i(TAG_WM, "Putting input method here!"); // Yet more tricksyness! If this window is a "starting" // window, we do actually want to be on top of it, but @@ -1435,7 +1427,7 @@ public class WindowManagerService extends IWindowManager.Stub // Now w is either mWindows[0] or an IME (or null if mWindows is empty). - if (DEBUG_INPUT_METHOD && willMove) Slog.v(TAG, "Proposed new IME target: " + w); + if (DEBUG_INPUT_METHOD && willMove) Slog.v(TAG_WM, "Proposed new IME target: " + w); // Now, a special case -- if the last target's window is in the // process of exiting, and is above the new target, keep on the @@ -1448,11 +1440,11 @@ public class WindowManagerService extends IWindowManager.Stub && curTarget.isDisplayedLw() && curTarget.isClosing() && (w == null || curTarget.mWinAnimator.mAnimLayer > w.mWinAnimator.mAnimLayer)) { - if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Current target higher, not changing"); + if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, "Current target higher, not changing"); return windows.indexOf(curTarget) + 1; } - if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Desired input method target=" + if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, "Desired input method target=" + w + " willMove=" + willMove); if (willMove && w != null) { @@ -1485,7 +1477,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (highestTarget != null) { - if (DEBUG_INPUT_METHOD) Slog.v(TAG, mAppTransition + " " + highestTarget + if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, mAppTransition + " " + highestTarget + " animating=" + highestTarget.mWinAnimator.isAnimating() + " layer=" + highestTarget.mWinAnimator.mAnimLayer + " new layer=" + w.mWinAnimator.mAnimLayer); @@ -1510,10 +1502,10 @@ public class WindowManagerService extends IWindowManager.Stub } } - //Slog.i(TAG, "Placing input method @" + (i+1)); + //Slog.i(TAG_WM, "Placing input method @" + (i+1)); if (w != null) { if (willMove) { - if (DEBUG_INPUT_METHOD) Slog.w(TAG, "Moving IM target from " + curTarget + " to " + if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to " + w + (HIDE_STACK_CRAWLS ? "" : " Callers=" + Debug.getCallers(4))); mInputMethodTarget = w; mInputMethodTargetWaitingAnim = false; @@ -1526,7 +1518,7 @@ public class WindowManagerService extends IWindowManager.Stub return i+1; } if (willMove) { - if (DEBUG_INPUT_METHOD) Slog.w(TAG, "Moving IM target from " + curTarget + " to null." + if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to null." + (HIDE_STACK_CRAWLS ? "" : " Callers=" + Debug.getCallers(4))); mInputMethodTarget = null; setInputMethodAnimLayerAdjustment(0); @@ -1539,7 +1531,7 @@ public class WindowManagerService extends IWindowManager.Stub if (pos >= 0) { win.mTargetAppToken = mInputMethodTarget.mAppToken; if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v( - TAG, "Adding input method window " + win + " at " + pos); + TAG_WM, "Adding input method window " + win + " at " + pos); // TODO(multidisplay): IMEs are only supported on the default display. getDefaultWindowListLocked().add(pos, win); mWindowsChanged = true; @@ -1552,19 +1544,19 @@ public class WindowManagerService extends IWindowManager.Stub } void setInputMethodAnimLayerAdjustment(int adj) { - if (DEBUG_LAYERS) Slog.v(TAG, "Setting im layer adj to " + adj); + if (DEBUG_LAYERS) Slog.v(TAG_WM, "Setting im layer adj to " + adj); mInputMethodAnimLayerAdjustment = adj; WindowState imw = mInputMethodWindow; if (imw != null) { imw.mWinAnimator.mAnimLayer = imw.mLayer + adj; - if (DEBUG_LAYERS) Slog.v(TAG, "IM win " + imw + if (DEBUG_LAYERS) Slog.v(TAG_WM, "IM win " + imw + " anim layer: " + imw.mWinAnimator.mAnimLayer); int wi = imw.mChildWindows.size(); while (wi > 0) { wi--; WindowState cw = imw.mChildWindows.get(wi); cw.mWinAnimator.mAnimLayer = cw.mLayer + adj; - if (DEBUG_LAYERS) Slog.v(TAG, "IM win " + cw + if (DEBUG_LAYERS) Slog.v(TAG_WM, "IM win " + cw + " anim layer: " + cw.mWinAnimator.mAnimLayer); } } @@ -1573,7 +1565,7 @@ public class WindowManagerService extends IWindowManager.Stub di --; imw = mInputMethodDialogs.get(di); imw.mWinAnimator.mAnimLayer = imw.mLayer + adj; - if (DEBUG_LAYERS) Slog.v(TAG, "IM win " + imw + if (DEBUG_LAYERS) Slog.v(TAG_WM, "IM win " + imw + " anim layer: " + imw.mWinAnimator.mAnimLayer); } } @@ -1583,7 +1575,7 @@ public class WindowManagerService extends IWindowManager.Stub int wpos = windows.indexOf(win); if (wpos >= 0) { if (wpos < interestingPos) interestingPos--; - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Temp removing at " + wpos + ": " + win); + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Temp removing at " + wpos + ": " + win); windows.remove(wpos); mWindowsChanged = true; int NC = win.mChildWindows.size(); @@ -1593,7 +1585,7 @@ public class WindowManagerService extends IWindowManager.Stub int cpos = windows.indexOf(cw); if (cpos >= 0) { if (cpos < interestingPos) interestingPos--; - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Temp removing child at " + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Temp removing child at " + cpos + ": " + cw); windows.remove(cpos); } @@ -1610,7 +1602,7 @@ public class WindowManagerService extends IWindowManager.Stub WindowList windows = win.getWindowList(); int wpos = windows.indexOf(win); if (wpos >= 0) { - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "ReAdd removing from " + wpos + ": " + win); + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "ReAdd removing from " + wpos + ": " + win); windows.remove(wpos); mWindowsChanged = true; reAddWindowLocked(wpos, win); @@ -1621,7 +1613,7 @@ public class WindowManagerService extends IWindowManager.Stub int N = windows.size(); while (N > 0) { N--; - Slog.v(TAG, prefix + "#" + N + ": " + windows.get(N)); + Slog.v(TAG_WM, prefix + "#" + N + ": " + windows.get(N)); } } @@ -1631,12 +1623,12 @@ public class WindowManagerService extends IWindowManager.Stub // TODO(multidisplay): IMEs are only supported on the default display. WindowList windows = getDefaultWindowListLocked(); final int N = dialogs.size(); - if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Removing " + N + " dialogs w/pos=" + pos); + if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, "Removing " + N + " dialogs w/pos=" + pos); for (int i=0; i<N; i++) { pos = tmpRemoveWindowLocked(pos, dialogs.get(i)); } if (DEBUG_INPUT_METHOD) { - Slog.v(TAG, "Window list w/pos=" + pos); + Slog.v(TAG_WM, "Window list w/pos=" + pos); logWindowList(windows, " "); } @@ -1653,14 +1645,14 @@ public class WindowManagerService extends IWindowManager.Stub break; } } - if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Adding " + N + " dialogs at pos=" + pos); + if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, "Adding " + N + " dialogs at pos=" + pos); for (int i=0; i<N; i++) { WindowState win = dialogs.get(i); win.mTargetAppToken = targetAppToken; pos = reAddWindowLocked(pos, win); } if (DEBUG_INPUT_METHOD) { - Slog.v(TAG, "Final window list:"); + Slog.v(TAG_WM, "Final window list:"); logWindowList(windows, " "); } return; @@ -1670,7 +1662,7 @@ public class WindowManagerService extends IWindowManager.Stub win.mTargetAppToken = null; reAddWindowToListInOrderLocked(win); if (DEBUG_INPUT_METHOD) { - Slog.v(TAG, "No IM target, final list:"); + Slog.v(TAG_WM, "No IM target, final list:"); logWindowList(windows, " "); } } @@ -1736,18 +1728,18 @@ public class WindowManagerService extends IWindowManager.Stub if (imWin != null) { if (DEBUG_INPUT_METHOD) { - Slog.v(TAG, "Moving IM from " + imPos); + Slog.v(TAG_WM, "Moving IM from " + imPos); logWindowList(windows, " "); } imPos = tmpRemoveWindowLocked(imPos, imWin); if (DEBUG_INPUT_METHOD) { - Slog.v(TAG, "List after removing with new pos " + imPos + ":"); + Slog.v(TAG_WM, "List after removing with new pos " + imPos + ":"); logWindowList(windows, " "); } imWin.mTargetAppToken = mInputMethodTarget.mAppToken; reAddWindowLocked(imPos, imWin); if (DEBUG_INPUT_METHOD) { - Slog.v(TAG, "List after moving IM to " + imPos + ":"); + Slog.v(TAG_WM, "List after moving IM to " + imPos + ":"); logWindowList(windows, " "); } if (DN > 0) moveInputMethodDialogsLocked(imPos+1); @@ -1760,12 +1752,12 @@ public class WindowManagerService extends IWindowManager.Stub // because they aren't currently associated with a focus window. if (imWin != null) { - if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Moving IM from " + imPos); + if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, "Moving IM from " + imPos); tmpRemoveWindowLocked(0, imWin); imWin.mTargetAppToken = null; reAddWindowToListInOrderLocked(imWin); if (DEBUG_INPUT_METHOD) { - Slog.v(TAG, "List with no IM target:"); + Slog.v(TAG_WM, "List with no IM target:"); logWindowList(windows, " "); } if (DN > 0) moveInputMethodDialogsLocked(-1); @@ -1804,38 +1796,38 @@ public class WindowManagerService extends IWindowManager.Stub final DisplayContent displayContent = getDisplayContentLocked(displayId); if (displayContent == null) { - Slog.w(TAG, "Attempted to add window to a display that does not exist: " + Slog.w(TAG_WM, "Attempted to add window to a display that does not exist: " + displayId + ". Aborting."); return WindowManagerGlobal.ADD_INVALID_DISPLAY; } if (!displayContent.hasAccess(session.mUid)) { - Slog.w(TAG, "Attempted to add window to a display for which the application " + Slog.w(TAG_WM, "Attempted to add window to a display for which the application " + "does not have access: " + displayId + ". Aborting."); return WindowManagerGlobal.ADD_INVALID_DISPLAY; } if (mWindowMap.containsKey(client.asBinder())) { - Slog.w(TAG, "Window " + client + " is already added"); + Slog.w(TAG_WM, "Window " + client + " is already added"); return WindowManagerGlobal.ADD_DUPLICATE_ADD; } if (type >= FIRST_SUB_WINDOW && type <= LAST_SUB_WINDOW) { attachedWindow = windowForClientLocked(null, attrs.token, false); if (attachedWindow == null) { - Slog.w(TAG, "Attempted to add window with token that is not a window: " + Slog.w(TAG_WM, "Attempted to add window with token that is not a window: " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN; } if (attachedWindow.mAttrs.type >= FIRST_SUB_WINDOW && attachedWindow.mAttrs.type <= LAST_SUB_WINDOW) { - Slog.w(TAG, "Attempted to add window with token that is a sub-window: " + Slog.w(TAG_WM, "Attempted to add window with token that is a sub-window: " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN; } } if (type == TYPE_PRIVATE_PRESENTATION && !displayContent.isPrivate()) { - Slog.w(TAG, "Attempted to add private presentation window to a non-private display. Aborting."); + Slog.w(TAG_WM, "Attempted to add private presentation window to a non-private display. Aborting."); return WindowManagerGlobal.ADD_PERMISSION_DENIED; } @@ -1844,37 +1836,37 @@ public class WindowManagerService extends IWindowManager.Stub AppWindowToken atoken = null; if (token == null) { if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) { - Slog.w(TAG, "Attempted to add application window with unknown token " + Slog.w(TAG_WM, "Attempted to add application window with unknown token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (type == TYPE_INPUT_METHOD) { - Slog.w(TAG, "Attempted to add input method window with unknown token " + Slog.w(TAG_WM, "Attempted to add input method window with unknown token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (type == TYPE_VOICE_INTERACTION) { - Slog.w(TAG, "Attempted to add voice interaction window with unknown token " + Slog.w(TAG_WM, "Attempted to add voice interaction window with unknown token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (type == TYPE_WALLPAPER) { - Slog.w(TAG, "Attempted to add wallpaper window with unknown token " + Slog.w(TAG_WM, "Attempted to add wallpaper window with unknown token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (type == TYPE_DREAM) { - Slog.w(TAG, "Attempted to add Dream window with unknown token " + Slog.w(TAG_WM, "Attempted to add Dream window with unknown token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (type == TYPE_QS_DIALOG) { - Slog.w(TAG, "Attempted to add QS dialog window with unknown token " + Slog.w(TAG_WM, "Attempted to add QS dialog window with unknown token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (type == TYPE_ACCESSIBILITY_OVERLAY) { - Slog.w(TAG, "Attempted to add Accessibility overlay window with unknown token " + Slog.w(TAG_WM, "Attempted to add Accessibility overlay window with unknown token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } @@ -1883,52 +1875,52 @@ public class WindowManagerService extends IWindowManager.Stub } else if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) { atoken = token.appWindowToken; if (atoken == null) { - Slog.w(TAG, "Attempted to add window with non-application token " + Slog.w(TAG_WM, "Attempted to add window with non-application token " + token + ". Aborting."); return WindowManagerGlobal.ADD_NOT_APP_TOKEN; } else if (atoken.removed) { - Slog.w(TAG, "Attempted to add window with exiting application token " + Slog.w(TAG_WM, "Attempted to add window with exiting application token " + token + ". Aborting."); return WindowManagerGlobal.ADD_APP_EXITING; } if (type == TYPE_APPLICATION_STARTING && atoken.firstWindowDrawn) { // No need for this guy! if (DEBUG_STARTING_WINDOW || localLOGV) Slog.v( - TAG, "**** NO NEED TO START: " + attrs.getTitle()); + TAG_WM, "**** NO NEED TO START: " + attrs.getTitle()); return WindowManagerGlobal.ADD_STARTING_NOT_NEEDED; } } else if (type == TYPE_INPUT_METHOD) { if (token.windowType != TYPE_INPUT_METHOD) { - Slog.w(TAG, "Attempted to add input method window with bad token " + Slog.w(TAG_WM, "Attempted to add input method window with bad token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (type == TYPE_VOICE_INTERACTION) { if (token.windowType != TYPE_VOICE_INTERACTION) { - Slog.w(TAG, "Attempted to add voice interaction window with bad token " + Slog.w(TAG_WM, "Attempted to add voice interaction window with bad token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (type == TYPE_WALLPAPER) { if (token.windowType != TYPE_WALLPAPER) { - Slog.w(TAG, "Attempted to add wallpaper window with bad token " + Slog.w(TAG_WM, "Attempted to add wallpaper window with bad token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (type == TYPE_DREAM) { if (token.windowType != TYPE_DREAM) { - Slog.w(TAG, "Attempted to add Dream window with bad token " + Slog.w(TAG_WM, "Attempted to add Dream window with bad token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (type == TYPE_ACCESSIBILITY_OVERLAY) { if (token.windowType != TYPE_ACCESSIBILITY_OVERLAY) { - Slog.w(TAG, "Attempted to add Accessibility overlay window with bad token " + Slog.w(TAG_WM, "Attempted to add Accessibility overlay window with bad token " + attrs.token + ". Aborting."); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (token.appWindowToken != null) { - Slog.w(TAG, "Non-null appWindowToken for system window of type=" + type); + Slog.w(TAG_WM, "Non-null appWindowToken for system window of type=" + type); // It is not valid to use an app token with other system types; we will // instead make a new token for it (as if null had been passed in for the token). attrs.token = null; @@ -1941,18 +1933,18 @@ public class WindowManagerService extends IWindowManager.Stub if (win.mDeathRecipient == null) { // Client has apparently died, so there is no reason to // continue. - Slog.w(TAG, "Adding window client " + client.asBinder() + Slog.w(TAG_WM, "Adding window client " + client.asBinder() + " that is dead, aborting."); return WindowManagerGlobal.ADD_APP_EXITING; } if (win.getDisplayContent() == null) { - Slog.w(TAG, "Adding window to Display that has been removed."); + Slog.w(TAG_WM, "Adding window to Display that has been removed."); return WindowManagerGlobal.ADD_INVALID_DISPLAY; } if (atoken != null && atoken.appDied) { - Slog.d(TAG, "App is now revived: " + atoken); + Slog.d(TAG_WM, "App is now revived: " + atoken); atoken.appDied = false; } @@ -1992,7 +1984,7 @@ public class WindowManagerService extends IWindowManager.Stub if (type == TYPE_APPLICATION_STARTING && token.appWindowToken != null) { token.appWindowToken.startingWindow = win; - if (DEBUG_STARTING_WINDOW) Slog.v (TAG, "addWindow: " + token.appWindowToken + if (DEBUG_STARTING_WINDOW) Slog.v (TAG_WM, "addWindow: " + token.appWindowToken + " startingWindow=" + win); } @@ -2073,7 +2065,7 @@ public class WindowManagerService extends IWindowManager.Stub } mInputMonitor.updateInputWindowsLw(false /*force*/); - if (localLOGV || DEBUG_ADD_REMOVE) Slog.v(TAG, "addWindow: New client " + if (localLOGV || DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "addWindow: New client " + client.asBinder() + ": window=" + win + " Callers=" + Debug.getCallers(5)); if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked(false)) { @@ -2178,11 +2170,11 @@ public class WindowManagerService extends IWindowManager.Stub void removeWindowLocked(WindowState win) { final boolean startingWindow = win.mAttrs.type == TYPE_APPLICATION_STARTING; if (startingWindow) { - if (DEBUG_STARTING_WINDOW) Slog.d(TAG, "Starting window removed " + win); + if (DEBUG_STARTING_WINDOW) Slog.d(TAG_WM, "Starting window removed " + win); } if (localLOGV || DEBUG_FOCUS || DEBUG_FOCUS_LIGHT && win==mCurrentFocus) Slog.v( - TAG, "Remove " + win + " client=" + TAG_WM, "Remove " + win + " client=" + Integer.toHexString(System.identityHashCode(win.mClient.asBinder())) + ", surfaceController=" + win.mWinAnimator.mSurfaceController + " Callers=" + Debug.getCallers(4)); @@ -2192,7 +2184,7 @@ public class WindowManagerService extends IWindowManager.Stub win.disposeInputChannel(); if (DEBUG_APP_TRANSITIONS) Slog.v( - TAG, "Remove " + win + ": mSurfaceController=" + win.mWinAnimator.mSurfaceController + TAG_WM, "Remove " + win + ": mSurfaceController=" + win.mWinAnimator.mSurfaceController + " mExiting=" + win.mExiting + " isAnimating=" + win.mWinAnimator.isAnimating() + " app-animation=" @@ -2213,7 +2205,7 @@ public class WindowManagerService extends IWindowManager.Stub if (appToken != null && appToken.mWillReplaceWindow) { // This window is going to be replaced. We need to keep it around until the new one // gets added, then we will get rid of this one. - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Preserving " + win + " until the new one is " + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Preserving " + win + " until the new one is " + "added"); win.mExiting = true; appToken.mReplacingRemoveRequested = true; @@ -2225,7 +2217,7 @@ public class WindowManagerService extends IWindowManager.Stub wasVisible = win.isWinVisibleLw(); if (wasVisible && appToken != null && appToken.appDied) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG, + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Not removing " + win + " because app died while it's visible"); win.mAppDied = true; @@ -2300,7 +2292,7 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=win.mChildWindows.size()-1; i>=0; i--) { WindowState cwin = win.mChildWindows.get(i); - Slog.w(TAG, "Force-removing child win " + cwin + " from container " + Slog.w(TAG_WM, "Force-removing child win " + cwin + " from container " + win); removeWindowInnerLocked(cwin); } @@ -2314,13 +2306,13 @@ public class WindowManagerService extends IWindowManager.Stub if (false) { RuntimeException e = new RuntimeException("here"); e.fillInStackTrace(); - Slog.w(TAG, "Removing window " + win, e); + Slog.w(TAG_WM, "Removing window " + win, e); } mPolicy.removeWindowLw(win); win.removeLocked(); - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "removeWindowInnerLocked: " + win); + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "removeWindowInnerLocked: " + win); mWindowMap.remove(win.mClient.asBinder()); if (win.mAppOp != AppOpsManager.OP_NONE) { mAppOps.finishOp(win.mAppOp, win.getOwningUid(), win.getOwningPackage()); @@ -2329,7 +2321,7 @@ public class WindowManagerService extends IWindowManager.Stub mPendingRemove.remove(win); mResizingWindows.remove(win); mWindowsChanged = true; - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Final remove of window: " + win); + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Final remove of window: " + win); if (mInputMethodWindow == win) { mInputMethodWindow = null; @@ -2339,13 +2331,13 @@ public class WindowManagerService extends IWindowManager.Stub final WindowToken token = win.mToken; final AppWindowToken atoken = win.mAppToken; - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + win + " from " + token); + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Removing " + win + " from " + token); token.windows.remove(win); if (atoken != null) { atoken.allAppWindows.remove(win); } if (localLOGV) Slog.v( - TAG, "**** Removing window " + win + ": count=" + TAG_WM, "**** Removing window " + win + ": count=" + token.windows.size()); if (token.windows.size() == 0) { if (!token.explicit) { @@ -2357,13 +2349,13 @@ public class WindowManagerService extends IWindowManager.Stub if (atoken != null) { if (atoken.startingWindow == win) { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Notify removed startingWindow " + win); + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Notify removed startingWindow " + win); scheduleRemoveStartingWindowLocked(atoken); } else if (atoken.allAppWindows.size() == 0 && atoken.startingData != null) { // If this is the last window and we had requested a starting // transition window, well there is no point now. - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Nulling last startingWindow"); + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Nulling last startingWindow"); atoken.startingData = null; } else if (atoken.allAppWindows.size() == 1 && atoken.startingView != null) { // If this is the last window except for a starting transition @@ -2419,18 +2411,18 @@ public class WindowManagerService extends IWindowManager.Stub static void logSurface(WindowState w, String msg, RuntimeException where) { String str = " SURFACE " + msg + ": " + w; if (where != null) { - Slog.i(TAG, str, where); + Slog.i(TAG_WM, str, where); } else { - Slog.i(TAG, str); + Slog.i(TAG_WM, str); } } static void logSurface(SurfaceControl s, String title, String msg, RuntimeException where) { String str = " SURFACE " + s + ": " + msg + " / " + title; if (where != null) { - Slog.i(TAG, str, where); + Slog.i(TAG_WM, str, where); } else { - Slog.i(TAG, str); + Slog.i(TAG_WM, str); } } @@ -2543,7 +2535,7 @@ public class WindowManagerService extends IWindowManager.Stub win.setWindowScale(win.mRequestedWidth, win.mRequestedHeight); if (SHOW_TRANSACTIONS) { - Slog.i(TAG, ">>> OPEN TRANSACTION repositionChild"); + Slog.i(TAG_WM, ">>> OPEN TRANSACTION repositionChild"); } SurfaceControl.openTransaction(); @@ -2561,7 +2553,7 @@ public class WindowManagerService extends IWindowManager.Stub SurfaceControl.closeTransaction(); if (SHOW_TRANSACTIONS) { - Slog.i(TAG, "<<< CLOSE TRANSACTION repositionChild"); + Slog.i(TAG_WM, "<<< CLOSE TRANSACTION repositionChild"); } outFrame = win.mCompatFrame; @@ -2633,7 +2625,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": viewVisibility=" + viewVisibility + if (DEBUG_LAYOUT) Slog.v(TAG_WM, "Relayout " + win + ": viewVisibility=" + viewVisibility + " req=" + requestedWidth + "x" + requestedHeight + " " + win.mAttrs); winAnimator.mSurfaceDestroyDeferred = (flags & RELAYOUT_DEFER_SURFACE_DESTROY) != 0; win.mEnforceSizeCompat = @@ -2662,7 +2654,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_SCREEN_ON) { RuntimeException stack = new RuntimeException(); stack.fillInStackTrace(); - Slog.i(TAG, "Relayout " + win + ": oldVis=" + oldVisibility + Slog.i(TAG_WM, "Relayout " + win + ": oldVis=" + oldVisibility + " newVis=" + viewVisibility, stack); } if (viewVisibility == View.VISIBLE && @@ -2674,7 +2666,7 @@ public class WindowManagerService extends IWindowManager.Stub } catch (Exception e) { mInputMonitor.updateInputWindowsLw(true /*force*/); - Slog.w(TAG, "Exception thrown when creating surface for client " + Slog.w(TAG_WM, "Exception thrown when creating surface for client " + client + " (" + win.mAttrs.getTitle() + ")", e); Binder.restoreCallingIdentity(origId); @@ -2693,7 +2685,7 @@ public class WindowManagerService extends IWindowManager.Stub winAnimator.mEnteringAnimation = false; if (winAnimator.mSurfaceController != null && winAnimator.mSurfaceController.hasSurface()) { - if (DEBUG_VISIBILITY) Slog.i(TAG, "Relayout invis " + win + if (DEBUG_VISIBILITY) Slog.i(TAG_WM, "Relayout invis " + win + ": mExiting=" + win.mExiting); // If we are using a saved surface to do enter animation, just let the // animation run and don't destroy the surface. This could happen when @@ -2713,7 +2705,7 @@ public class WindowManagerService extends IWindowManager.Stub } outSurface.release(); - if (DEBUG_VISIBILITY) Slog.i(TAG, "Releasing surface in: " + win); + if (DEBUG_VISIBILITY) Slog.i(TAG_WM, "Releasing surface in: " + win); } if (focusMayChange) { @@ -2765,7 +2757,7 @@ public class WindowManagerService extends IWindowManager.Stub outStableInsets.set(win.mStableInsets); outOutsets.set(win.mOutsets); if (localLOGV) Slog.v( - TAG, "Relayout given client " + client.asBinder() + TAG_WM, "Relayout given client " + client.asBinder() + ", requestedWidth=" + requestedWidth + ", requestedHeight=" + requestedHeight + ", viewVisibility=" + viewVisibility @@ -2773,14 +2765,14 @@ public class WindowManagerService extends IWindowManager.Stub + ", surface=" + outSurface); if (localLOGV || DEBUG_FOCUS) Slog.v( - TAG, "Relayout of " + win + ": focusMayChange=" + focusMayChange); + TAG_WM, "Relayout of " + win + ": focusMayChange=" + focusMayChange); result |= mInTouchMode ? WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE : 0; mInputMonitor.updateInputWindowsLw(true /*force*/); if (DEBUG_LAYOUT) { - Slog.v(TAG, "Relayout complete " + win + ": outFrame=" + outFrame.toShortString()); + Slog.v(TAG_WM, "Relayout complete " + win + ": outFrame=" + outFrame.toShortString()); } } @@ -2834,7 +2826,7 @@ public class WindowManagerService extends IWindowManager.Stub WindowSurfaceController surfaceController = winAnimator.createSurfaceLocked(); if (surfaceController != null) { surfaceController.getSurface(outSurface); - if (SHOW_TRANSACTIONS) Slog.i(TAG, " OUT SURFACE " + outSurface + ": copied"); + if (SHOW_TRANSACTIONS) Slog.i(TAG_WM, " OUT SURFACE " + outSurface + ": copied"); } else { // For some reason there isn't a surface. Clear the // caller's object so they see the same state. @@ -2930,7 +2922,7 @@ public class WindowManagerService extends IWindowManager.Stub try { synchronized (mWindowMap) { WindowState win = windowForClientLocked(session, client, false); - if (DEBUG_ADD_REMOVE) Slog.d(TAG, "finishDrawingWindow: " + win + " mDrawState=" + if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "finishDrawingWindow: " + win + " mDrawState=" + (win != null ? win.mWinAnimator.drawStateToString() : "null")); if (win != null && win.mWinAnimator.finishDrawingLocked()) { if ((win.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0) { @@ -2956,7 +2948,7 @@ public class WindowManagerService extends IWindowManager.Stub DisplayInfo displayInfo = getDefaultDisplayInfoLocked(); final int width = displayInfo.appWidth; final int height = displayInfo.appHeight; - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG_WM, "applyAnimation: atoken=" + atoken); // Determine the visible rect to calculate the thumbnail clip @@ -2992,7 +2984,7 @@ public class WindowManagerService extends IWindowManager.Stub // screen gets the enter animation. Both appear in the mOpeningApps set. enter = false; } - if (DEBUG_APP_TRANSITIONS) Slog.d(TAG, "Loading animation for app transition." + if (DEBUG_APP_TRANSITIONS) Slog.d(TAG_WM, "Loading animation for app transition." + " transit=" + AppTransition.appTransitionToString(transit) + " enter=" + enter + " frame=" + frame + " insets=" + insets + " surfaceInsets=" + surfaceInsets); Animation a = mAppTransition.loadAnimation(lp, transit, enter, @@ -3005,7 +2997,7 @@ public class WindowManagerService extends IWindowManager.Stub e = new RuntimeException(); e.fillInStackTrace(); } - Slog.v(TAG, "Loaded animation " + a + " for " + atoken, e); + Slog.v(TAG_WM, "Loaded animation " + a + " for " + atoken, e); } final int containingWidth = frame.width(); final int containingHeight = frame.height(); @@ -3027,7 +3019,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { int t = tasks.size() - 1; if (t < 0) { - Slog.w(TAG, "validateAppTokens: empty task list"); + Slog.w(TAG_WM, "validateAppTokens: empty task list"); return; } @@ -3036,7 +3028,7 @@ public class WindowManagerService extends IWindowManager.Stub Task targetTask = mTaskIdToTask.get(taskId); DisplayContent displayContent = targetTask.getDisplayContent(); if (displayContent == null) { - Slog.w(TAG, "validateAppTokens: no Display for taskId=" + taskId); + Slog.w(TAG_WM, "validateAppTokens: no Display for taskId=" + taskId); return; } @@ -3050,7 +3042,7 @@ public class WindowManagerService extends IWindowManager.Stub DisplayContent lastDisplayContent = displayContent; displayContent = mTaskIdToTask.get(taskId).getDisplayContent(); if (displayContent != lastDisplayContent) { - Slog.w(TAG, "validateAppTokens: displayContent changed in TaskGroup list!"); + Slog.w(TAG_WM, "validateAppTokens: displayContent changed in TaskGroup list!"); return; } @@ -3076,9 +3068,9 @@ public class WindowManagerService extends IWindowManager.Stub } if (taskNdx >= 0 || t >= 0) { - Slog.w(TAG, "validateAppTokens: Mismatch! ActivityManager=" + tasks); - Slog.w(TAG, "validateAppTokens: Mismatch! WindowManager=" + localTasks); - Slog.w(TAG, "validateAppTokens: Mismatch! Callers=" + Debug.getCallers(4)); + Slog.w(TAG_WM, "validateAppTokens: Mismatch! ActivityManager=" + tasks); + Slog.w(TAG_WM, "validateAppTokens: Mismatch! WindowManager=" + localTasks); + Slog.w(TAG_WM, "validateAppTokens: Mismatch! Callers=" + Debug.getCallers(4)); } } } @@ -3101,7 +3093,7 @@ public class WindowManagerService extends IWindowManager.Stub + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + permission; - Slog.w(TAG, msg); + Slog.w(TAG_WM, msg); return false; } @@ -3127,7 +3119,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { WindowToken wtoken = mTokenMap.get(token); if (wtoken != null) { - Slog.w(TAG, "Attempted to add existing input method token: " + token); + Slog.w(TAG_WM, "Attempted to add existing input method token: " + token); return; } wtoken = new WindowToken(this, token, type, true); @@ -3197,7 +3189,7 @@ public class WindowManagerService extends IWindowManager.Stub mInputMonitor.updateInputWindowsLw(true /*force*/); } else { - Slog.w(TAG, "Attempted to remove non-existing token: " + token); + Slog.w(TAG_WM, "Attempted to remove non-existing token: " + token); } } Binder.restoreCallingIdentity(origId); @@ -3205,7 +3197,7 @@ public class WindowManagerService extends IWindowManager.Stub private Task createTaskLocked(int taskId, int stackId, int userId, AppWindowToken atoken, Rect bounds, Configuration config) { - if (DEBUG_STACK) Slog.i(TAG, "createTaskLocked: taskId=" + taskId + " stackId=" + stackId + if (DEBUG_STACK) Slog.i(TAG_WM, "createTaskLocked: taskId=" + taskId + " stackId=" + stackId + " atoken=" + atoken + " bounds=" + bounds); final TaskStack stack = mStackIdToStack.get(stackId); if (stack == null) { @@ -3238,14 +3230,14 @@ public class WindowManagerService extends IWindowManager.Stub try { inputDispatchingTimeoutNanos = token.getKeyDispatchingTimeout() * 1000000L; } catch (RemoteException ex) { - Slog.w(TAG, "Could not get dispatching timeout.", ex); + Slog.w(TAG_WM, "Could not get dispatching timeout.", ex); inputDispatchingTimeoutNanos = DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; } synchronized(mWindowMap) { AppWindowToken atoken = findAppWindowToken(token.asBinder()); if (atoken != null) { - Slog.w(TAG, "Attempted to add existing app token: " + token); + Slog.w(TAG_WM, "Attempted to add existing app token: " + token); return; } atoken = new AppWindowToken(this, token, voiceInteraction); @@ -3257,7 +3249,7 @@ public class WindowManagerService extends IWindowManager.Stub (ActivityInfo.CONFIG_SCREEN_SIZE | ActivityInfo.CONFIG_ORIENTATION)) != 0; atoken.mLaunchTaskBehind = launchTaskBehind; atoken.mCropWindowsToStack = cropWindowsToStack; - if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken + if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "addAppToken: " + atoken + " to stack=" + stackId + " task=" + taskId + " at " + addPos); Task task = mTaskIdToTask.get(taskId); @@ -3285,7 +3277,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { final AppWindowToken atoken = findAppWindowToken(token); if (atoken == null) { - Slog.w(TAG, "Attempted to set task id of non-existing app token: " + token); + Slog.w(TAG_WM, "Attempted to set task id of non-existing app token: " + token); return; } final Task oldTask = atoken.mTask; @@ -3303,7 +3295,7 @@ public class WindowManagerService extends IWindowManager.Stub public int getOrientationLocked() { if (mDisplayFrozen) { if (mLastWindowForcedOrientation != SCREEN_ORIENTATION_UNSPECIFIED) { - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display is frozen, return " + mLastWindowForcedOrientation); // If the display is frozen, some activities may be in the middle // of restarting, and thus have removed their old window. If the @@ -3330,7 +3322,7 @@ public class WindowManagerService extends IWindowManager.Stub continue; } - if (DEBUG_ORIENTATION) Slog.v(TAG, win + " forcing orientation to " + req); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, win + " forcing orientation to " + req); if (mPolicy.isKeyguardHostWindow(win.mAttrs)) { mLastKeyguardForcedOrientation = req; } @@ -3350,11 +3342,11 @@ public class WindowManagerService extends IWindowManager.Stub if (req == SCREEN_ORIENTATION_BEHIND) { req = mLastKeyguardForcedOrientation; } - if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + appShowWhenLocked + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Done at " + appShowWhenLocked + " -- show when locked, return " + req); return req; } - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "No one is requesting an orientation when the screen is locked"); return mLastKeyguardForcedOrientation; } @@ -3384,12 +3376,12 @@ public class WindowManagerService extends IWindowManager.Stub for (int tokenNdx = firstToken; tokenNdx >= 0; --tokenNdx) { final AppWindowToken atoken = tokens.get(tokenNdx); - if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + atoken); + if (DEBUG_APP_ORIENTATION) Slog.v(TAG_WM, "Checking app orientation: " + atoken); // if we're about to tear down this window and not seek for // the behind activity, don't use it for orientation if (!findingBehind && !atoken.hidden && atoken.hiddenRequested) { - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Skipping " + atoken + " -- going to hide"); continue; } @@ -3399,7 +3391,7 @@ public class WindowManagerService extends IWindowManager.Stub // explicitly say to use the orientation behind it, and the last app was // full screen, then we'll stick with the user's orientation. if (lastOrientation != SCREEN_ORIENTATION_BEHIND && lastFullscreen) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + atoken + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Done at " + atoken + " -- end of group, return " + lastOrientation); return lastOrientation; } @@ -3407,7 +3399,7 @@ public class WindowManagerService extends IWindowManager.Stub // We ignore any hidden applications on the top. if (atoken.hiddenRequested) { - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Skipping " + atoken + " -- hidden on top"); continue; } @@ -3423,20 +3415,20 @@ public class WindowManagerService extends IWindowManager.Stub // orientation it has and ignores whatever is under it. lastFullscreen = atoken.appFullscreen; if (lastFullscreen && or != SCREEN_ORIENTATION_BEHIND) { - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Done at " + atoken + " -- full screen, return " + or); return or; } // If this application has requested an explicit orientation, then use it. if (or != SCREEN_ORIENTATION_UNSPECIFIED && or != SCREEN_ORIENTATION_BEHIND) { - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Done at " + atoken + " -- explicitly set, return " + or); return or; } findingBehind |= (or == SCREEN_ORIENTATION_BEHIND); } } - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "No app is requesting an orientation, return " + mForcedAppOrientation); // The next app has not been requested to be visible, so we keep the current orientation // to prevent freezing/unfreezing the display too early. @@ -3567,7 +3559,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { AppWindowToken atoken = findAppWindowToken(token.asBinder()); if (atoken == null) { - Slog.w(TAG, "Attempted to set orientation of non-existing app token: " + token); + Slog.w(TAG_WM, "Attempted to set orientation of non-existing app token: " + token); return; } @@ -3607,14 +3599,14 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { final AppWindowToken newFocus; if (token == null) { - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG, "Clearing focused app, was " + mFocusedApp); + if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Clearing focused app, was " + mFocusedApp); newFocus = null; } else { newFocus = findAppWindowToken(token); if (newFocus == null) { - Slog.w(TAG, "Attempted to set focus to non-existing app token: " + token); + Slog.w(TAG_WM, "Attempted to set focus to non-existing app token: " + token); } - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG, "Set focused app to: " + newFocus + if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Set focused app to: " + newFocus + " old focus=" + mFocusedApp + " moveFocusNow=" + moveFocusNow); } @@ -3774,7 +3766,7 @@ public class WindowManagerService extends IWindowManager.Stub } synchronized(mWindowMap) { - if (DEBUG_APP_TRANSITIONS) Slog.w(TAG, "Execute app transition: " + mAppTransition + if (DEBUG_APP_TRANSITIONS) Slog.w(TAG_WM, "Execute app transition: " + mAppTransition + " Callers=" + Debug.getCallers(5)); if (mAppTransition.isTransitionSet()) { mAppTransition.setReady(); @@ -3800,12 +3792,12 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { if (DEBUG_STARTING_WINDOW) Slog.v( - TAG, "setAppStartingWindow: token=" + token + " pkg=" + pkg + TAG_WM, "setAppStartingWindow: token=" + token + " pkg=" + pkg + " transferFrom=" + transferFrom); AppWindowToken wtoken = findAppWindowToken(token); if (wtoken == null) { - Slog.w(TAG, "Attempted to set icon of non-existing app token: " + token); + Slog.w(TAG_WM, "Attempted to set icon of non-existing app token: " + token); return; } @@ -3834,7 +3826,7 @@ public class WindowManagerService extends IWindowManager.Stub // show a starting window -- the current effect (a full-screen // opaque starting window that fades away to the real contents // when it is ready) does not work for this. - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Checking theme of starting window: 0x" + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Checking theme of starting window: 0x" + Integer.toHexString(theme)); if (theme != 0) { AttributeCache.Entry ent = AttributeCache.instance().get(pkg, theme, @@ -3852,7 +3844,7 @@ public class WindowManagerService extends IWindowManager.Stub com.android.internal.R.styleable.Window_windowShowWallpaper, false); final boolean windowDisableStarting = ent.array.getBoolean( com.android.internal.R.styleable.Window_windowDisablePreview, false); - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Translucent=" + windowIsTranslucent + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Translucent=" + windowIsTranslucent + " Floating=" + windowIsFloating + " ShowWallpaper=" + windowShowWallpaper); if (windowIsTranslucent) { @@ -3875,14 +3867,14 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Creating StartingData"); + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Creating StartingData"); wtoken.startingData = new StartingData(pkg, theme, compatInfo, nonLocalizedLabel, labelRes, icon, logo, windowFlags); Message m = mH.obtainMessage(H.ADD_STARTING, wtoken); // Note: we really want to do sendMessageAtFrontOfQueue() because we // want to process the message ASAP, before any other queued // messages. - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Enqueueing ADD_STARTING"); + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Enqueueing ADD_STARTING"); mH.sendMessageAtFrontOfQueue(m); } } @@ -3901,7 +3893,7 @@ public class WindowManagerService extends IWindowManager.Stub // letting windows get shown immediately without any more transitions. mSkipAppTransitionAnimation = true; - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Moving existing starting " + startingWindow + " from " + ttoken + " to " + wtoken); final long origId = Binder.clearCallingIdentity(); @@ -3922,11 +3914,11 @@ public class WindowManagerService extends IWindowManager.Stub startingWindow.mAppToken = wtoken; if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE || DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "Removing starting window: " + startingWindow); + Slog.v(TAG_WM, "Removing starting window: " + startingWindow); } startingWindow.getWindowList().remove(startingWindow); mWindowsChanged = true; - if (DEBUG_ADD_REMOVE) Slog.v(TAG, + if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Removing starting " + startingWindow + " from " + ttoken); ttoken.windows.remove(startingWindow); ttoken.allAppWindows.remove(startingWindow); @@ -3964,7 +3956,7 @@ public class WindowManagerService extends IWindowManager.Stub } else if (ttoken.startingData != null) { // The previous app was getting ready to show a // starting window, but hasn't yet done so. Steal it! - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Moving pending starting from " + ttoken + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Moving pending starting from " + ttoken + " to " + wtoken); wtoken.startingData = ttoken.startingData; ttoken.startingData = null; @@ -4047,7 +4039,7 @@ public class WindowManagerService extends IWindowManager.Stub (visible && wtoken.mWillReplaceWindow)) { boolean changed = false; if (DEBUG_APP_TRANSITIONS) Slog.v( - TAG, "Changing app " + wtoken + " hidden=" + wtoken.hidden + TAG_WM, "Changing app " + wtoken + " hidden=" + wtoken.hidden + " performLayout=" + performLayout); boolean runningAppAnimation = false; @@ -4075,7 +4067,7 @@ public class WindowManagerService extends IWindowManager.Stub continue; } - //Slog.i(TAG, "Window " + win + ": vis=" + win.isVisible()); + //Slog.i(TAG_WM, "Window " + win + ": vis=" + win.isVisible()); //win.dump(" "); if (visible) { if (!win.isVisibleNow()) { @@ -4121,7 +4113,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "setTokenVisibilityLocked: " + wtoken + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "setTokenVisibilityLocked: " + wtoken + ": hidden=" + wtoken.hidden + " hiddenRequested=" + wtoken.hiddenRequested); @@ -4170,11 +4162,11 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { wtoken = findAppWindowToken(token); if (wtoken == null) { - Slog.w(TAG, "Attempted to set visibility of non-existing app token: " + token); + Slog.w(TAG_WM, "Attempted to set visibility of non-existing app token: " + token); return; } - if (DEBUG_APP_TRANSITIONS || DEBUG_ORIENTATION) Slog.v(TAG, "setAppVisibility(" + + if (DEBUG_APP_TRANSITIONS || DEBUG_ORIENTATION) Slog.v(TAG_WM, "setAppVisibility(" + token + ", visible=" + visible + "): " + mAppTransition + " hidden=" + wtoken.hidden + " hiddenRequested=" + wtoken.hiddenRequested + " Callers=" + Debug.getCallers(6)); @@ -4202,7 +4194,7 @@ public class WindowManagerService extends IWindowManager.Stub if (!wtoken.mAppAnimator.usingTransferredAnimation && (!wtoken.startingDisplayed || mSkipAppTransitionAnimation)) { if (DEBUG_APP_TRANSITIONS) Slog.v( - TAG, "Setting dummy animation on: " + wtoken); + TAG_WM, "Setting dummy animation on: " + wtoken); wtoken.mAppAnimator.setDummyAnimation(); } wtoken.inPendingTransaction = true; @@ -4241,7 +4233,7 @@ public class WindowManagerService extends IWindowManager.Stub if (win != null) { final AppWindowToken focusedToken = win.mAppToken; if (focusedToken != null) { - if (DEBUG_APP_TRANSITIONS) Slog.d(TAG, "TRANSIT_TASK_OPEN_BEHIND, " + + if (DEBUG_APP_TRANSITIONS) Slog.d(TAG_WM, "TRANSIT_TASK_OPEN_BEHIND, " + " adding " + focusedToken + " to mOpeningApps"); // Force animation to be loaded. focusedToken.hidden = true; @@ -4264,7 +4256,7 @@ public class WindowManagerService extends IWindowManager.Stub void unsetAppFreezingScreenLocked(AppWindowToken wtoken, boolean unfreezeSurfaceNow, boolean force) { if (wtoken.mAppAnimator.freezingScreen) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "Clear freezing of " + wtoken + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Clear freezing of " + wtoken + " force=" + force); final int N = wtoken.allAppWindows.size(); boolean unfrozeWindows = false; @@ -4274,7 +4266,7 @@ public class WindowManagerService extends IWindowManager.Stub w.mAppFreezing = false; if (w.mHasSurface && !w.mOrientationChanging && mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "set mOrientationChanging of " + w); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "set mOrientationChanging of " + w); w.mOrientationChanging = true; mWindowPlacerLocked.mOrientationChangeComplete = false; } @@ -4284,7 +4276,7 @@ public class WindowManagerService extends IWindowManager.Stub } } if (force || unfrozeWindows) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "No longer freezing: " + wtoken); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "No longer freezing: " + wtoken); wtoken.mAppAnimator.freezingScreen = false; wtoken.mAppAnimator.lastFreezeDuration = (int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); @@ -4307,7 +4299,7 @@ public class WindowManagerService extends IWindowManager.Stub e = new RuntimeException(); e.fillInStackTrace(); } - Slog.i(TAG, "Set freezing of " + wtoken.appToken + Slog.i(TAG_WM, "Set freezing of " + wtoken.appToken + ": hidden=" + wtoken.hidden + " freezing=" + wtoken.mAppAnimator.freezingScreen, e); } @@ -4339,13 +4331,13 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { if (configChanges == 0 && okToDisplay()) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping set freeze of " + token); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Skipping set freeze of " + token); return; } AppWindowToken wtoken = findAppWindowToken(token); if (wtoken == null || wtoken.appToken == null) { - Slog.w(TAG, "Attempted to freeze screen with non-existing app token: " + wtoken); + Slog.w(TAG_WM, "Attempted to freeze screen with non-existing app token: " + wtoken); return; } final long origId = Binder.clearCallingIdentity(); @@ -4367,7 +4359,7 @@ public class WindowManagerService extends IWindowManager.Stub return; } final long origId = Binder.clearCallingIdentity(); - if (DEBUG_ORIENTATION) Slog.v(TAG, "Clear freezing of " + token + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Clear freezing of " + token + ": hidden=" + wtoken.hidden + " freezing=" + wtoken.mAppAnimator.freezingScreen); unsetAppFreezingScreenLocked(wtoken, true, force); Binder.restoreCallingIdentity(origId); @@ -4389,7 +4381,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { WindowToken basewtoken = mTokenMap.remove(token); if (basewtoken != null && (wtoken=basewtoken.appWindowToken) != null) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Removing app token: " + wtoken); + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Removing app token: " + wtoken); delayed = setTokenVisibilityLocked(wtoken, null, false, AppTransition.TRANSIT_UNSET, true, wtoken.voiceInteraction); wtoken.inPendingTransaction = false; @@ -4402,15 +4394,15 @@ public class WindowManagerService extends IWindowManager.Stub delayed = true; } if (DEBUG_APP_TRANSITIONS) Slog.v( - TAG, "Removing app " + wtoken + " delayed=" + delayed + TAG_WM, "Removing app " + wtoken + " delayed=" + delayed + " animation=" + wtoken.mAppAnimator.animation + " animating=" + wtoken.mAppAnimator.animating); - if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "removeAppToken: " + if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM, "removeAppToken: " + wtoken + " delayed=" + delayed + " Callers=" + Debug.getCallers(4)); final TaskStack stack = wtoken.mTask.mStack; if (delayed && !wtoken.allAppWindows.isEmpty()) { // set the token aside because it has an active animation to be finished - if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, + if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM, "removeAppToken make exiting: " + wtoken); stack.mExitingAppTokens.add(wtoken); wtoken.mIsExiting = true; @@ -4429,13 +4421,13 @@ public class WindowManagerService extends IWindowManager.Stub } unsetAppFreezingScreenLocked(wtoken, true, true); if (mFocusedApp == wtoken) { - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG, "Removing focused app token:" + wtoken); + if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Removing focused app token:" + wtoken); mFocusedApp = null; updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/); mInputMonitor.setFocusedAppLw(null); } } else { - Slog.w(TAG, "Attempted to remove non-existing app token: " + token); + Slog.w(TAG_WM, "Attempted to remove non-existing app token: " + token); } if (!delayed && wtoken != null) { @@ -4455,7 +4447,7 @@ public class WindowManagerService extends IWindowManager.Stub return; } if (wtoken != null && wtoken.startingWindow != null) { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, Debug.getCallers(1) + + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, Debug.getCallers(1) + ": Schedule remove starting " + wtoken + (wtoken != null ? " startingWindow=" + wtoken.startingWindow : "")); Message m = mH.obtainMessage(H.REMOVE_STARTING, wtoken); @@ -4467,16 +4459,16 @@ public class WindowManagerService extends IWindowManager.Stub final int numStacks = mStackIdToStack.size(); for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) { final TaskStack stack = mStackIdToStack.valueAt(stackNdx); - Slog.v(TAG, " Stack #" + stack.mStackId + " tasks from bottom to top:"); + Slog.v(TAG_WM, " Stack #" + stack.mStackId + " tasks from bottom to top:"); final ArrayList<Task> tasks = stack.getTasks(); final int numTasks = tasks.size(); for (int taskNdx = 0; taskNdx < numTasks; ++taskNdx) { final Task task = tasks.get(taskNdx); - Slog.v(TAG, " Task #" + task.mTaskId + " activities from bottom to top:"); + Slog.v(TAG_WM, " Task #" + task.mTaskId + " activities from bottom to top:"); AppTokenList tokens = task.mAppTokens; final int numTokens = tokens.size(); for (int tokenNdx = 0; tokenNdx < numTokens; ++tokenNdx) { - Slog.v(TAG, " activity #" + tokenNdx + ": " + tokens.get(tokenNdx).token); + Slog.v(TAG_WM, " activity #" + tokenNdx + ": " + tokens.get(tokenNdx).token); } } } @@ -4486,10 +4478,10 @@ public class WindowManagerService extends IWindowManager.Stub final int numDisplays = mDisplayContents.size(); for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) { final DisplayContent displayContent = mDisplayContents.valueAt(displayNdx); - Slog.v(TAG, " Display #" + displayContent.getDisplayId()); + Slog.v(TAG_WM, " Display #" + displayContent.getDisplayId()); final WindowList windows = displayContent.getWindowList(); for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) { - Slog.v(TAG, " #" + winNdx + ": " + windows.get(winNdx)); + Slog.v(TAG_WM, " #" + winNdx + ": " + windows.get(winNdx)); } } } @@ -4502,21 +4494,21 @@ public class WindowManagerService extends IWindowManager.Stub for (int j=0; j<NCW; j++) { WindowState cwin = win.mChildWindows.get(j); if (!winAdded && cwin.mSubLayer >= 0) { - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Re-adding child window at " + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Re-adding child window at " + index + ": " + cwin); win.mRebuilding = false; windows.add(index, win); index++; winAdded = true; } - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Re-adding window at " + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Re-adding window at " + index + ": " + cwin); cwin.mRebuilding = false; windows.add(index, cwin); index++; } if (!winAdded) { - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Re-adding window at " + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Re-adding window at " + index + ": " + win); win.mRebuilding = false; windows.add(index, win); @@ -4623,7 +4615,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { Task task = mTaskIdToTask.get(taskId); if (task == null) { - Slog.e(TAG, "moveTaskToBottom: taskId=" + taskId + Slog.e(TAG_WM, "moveTaskToBottom: taskId=" + taskId + " not found in mTaskIdToTask"); return; } @@ -4667,7 +4659,7 @@ public class WindowManagerService extends IWindowManager.Stub if (displayContent != null) { TaskStack stack = mStackIdToStack.get(stackId); if (stack == null) { - if (DEBUG_STACK) Slog.d(TAG, "attachStack: stackId=" + stackId); + if (DEBUG_STACK) Slog.d(TAG_WM, "attachStack: stackId=" + stackId); stack = new TaskStack(this, stackId); mStackIdToStack.put(stackId, stack); } @@ -4723,7 +4715,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { Task task = mTaskIdToTask.get(taskId); if (task == null) { - if (DEBUG_STACK) Slog.i(TAG, "removeTask: could not find taskId=" + taskId); + if (DEBUG_STACK) Slog.i(TAG_WM, "removeTask: could not find taskId=" + taskId); return; } task.removeLocked(); @@ -4752,11 +4744,11 @@ public class WindowManagerService extends IWindowManager.Stub public void addTask(int taskId, int stackId, boolean toTop) { synchronized (mWindowMap) { - if (DEBUG_STACK) Slog.i(TAG, "addTask: adding taskId=" + taskId + if (DEBUG_STACK) Slog.i(TAG_WM, "addTask: adding taskId=" + taskId + " to " + (toTop ? "top" : "bottom")); Task task = mTaskIdToTask.get(taskId); if (task == null) { - if (DEBUG_STACK) Slog.i(TAG, "addTask: could not find taskId=" + taskId); + if (DEBUG_STACK) Slog.i(TAG_WM, "addTask: could not find taskId=" + taskId); return; } TaskStack stack = mStackIdToStack.get(stackId); @@ -4769,16 +4761,16 @@ public class WindowManagerService extends IWindowManager.Stub public void moveTaskToStack(int taskId, int stackId, boolean toTop) { synchronized (mWindowMap) { - if (DEBUG_STACK) Slog.i(TAG, "moveTaskToStack: moving taskId=" + taskId + if (DEBUG_STACK) Slog.i(TAG_WM, "moveTaskToStack: moving taskId=" + taskId + " to stackId=" + stackId + " at " + (toTop ? "top" : "bottom")); Task task = mTaskIdToTask.get(taskId); if (task == null) { - if (DEBUG_STACK) Slog.i(TAG, "moveTaskToStack: could not find taskId=" + taskId); + if (DEBUG_STACK) Slog.i(TAG_WM, "moveTaskToStack: could not find taskId=" + taskId); return; } TaskStack stack = mStackIdToStack.get(stackId); if (stack == null) { - if (DEBUG_STACK) Slog.i(TAG, "moveTaskToStack: could not find stackId=" + stackId); + if (DEBUG_STACK) Slog.i(TAG_WM, "moveTaskToStack: could not find stackId=" + stackId); return; } task.moveTaskToStack(stack, toTop); @@ -4803,7 +4795,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { Task task = mTaskIdToTask.get(taskId); if (task == null) { - if (DEBUG_STACK) Slog.i(TAG, "scheduleShowToast: could not find taskId=" + taskId); + if (DEBUG_STACK) Slog.i(TAG_WM, "scheduleShowToast: could not find taskId=" + taskId); return; } task.setShowNonResizeableDockToast(); @@ -4849,17 +4841,17 @@ public class WindowManagerService extends IWindowManager.Stub public void positionTaskInStack(int taskId, int stackId, int position, Rect bounds, Configuration config) { synchronized (mWindowMap) { - if (DEBUG_STACK) Slog.i(TAG, "positionTaskInStack: positioning taskId=" + taskId + if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskInStack: positioning taskId=" + taskId + " in stackId=" + stackId + " at " + position); Task task = mTaskIdToTask.get(taskId); if (task == null) { - if (DEBUG_STACK) Slog.i(TAG, + if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskInStack: could not find taskId=" + taskId); return; } TaskStack stack = mStackIdToStack.get(stackId); if (stack == null) { - if (DEBUG_STACK) Slog.i(TAG, + if (DEBUG_STACK) Slog.i(TAG_WM, "positionTaskInStack: could not find stackId=" + stackId); return; } @@ -5000,7 +4992,7 @@ public class WindowManagerService extends IWindowManager.Stub // If this isn't coming from the system then don't allow disabling the lockscreen // to bypass security. if (Binder.getCallingUid() != Process.SYSTEM_UID && isKeyguardSecure()) { - Log.d(TAG, "current mode is SecurityMode, ignore hide keyguard"); + Log.d(TAG_WM, "current mode is SecurityMode, ignore hide keyguard"); return; } @@ -5091,7 +5083,7 @@ public class WindowManagerService extends IWindowManager.Stub != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires DISABLE_KEYGUARD permission"); } - if (DEBUG_KEYGUARD) Slog.d(TAG, "keyguardGoingAway: disableWinAnim=" + if (DEBUG_KEYGUARD) Slog.d(TAG_WM, "keyguardGoingAway: disableWinAnim=" + disableWindowAnimations + " kgToNotifShade=" + keyguardGoingToNotificationShade); synchronized (mWindowMap) { mAnimator.mKeyguardGoingAway = true; @@ -5102,14 +5094,14 @@ public class WindowManagerService extends IWindowManager.Stub } public void keyguardWaitingForActivityDrawn() { - if (DEBUG_KEYGUARD) Slog.d(TAG, "keyguardWaitingForActivityDrawn"); + if (DEBUG_KEYGUARD) Slog.d(TAG_WM, "keyguardWaitingForActivityDrawn"); synchronized (mWindowMap) { mKeyguardWaitingForActivityDrawn = true; } } public void notifyActivityDrawnForKeyguard() { - if (DEBUG_KEYGUARD) Slog.d(TAG, "notifyActivityDrawnForKeyguard: waiting=" + if (DEBUG_KEYGUARD) Slog.d(TAG_WM, "notifyActivityDrawnForKeyguard: waiting=" + mKeyguardWaitingForActivityDrawn + " Callers=" + Debug.getCallers(5)); synchronized (mWindowMap) { if (mKeyguardWaitingForActivityDrawn) { @@ -5331,7 +5323,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_BOOT) { RuntimeException here = new RuntimeException("here"); here.fillInStackTrace(); - Slog.i(TAG, "enableScreenAfterBoot: mDisplayEnabled=" + mDisplayEnabled + Slog.i(TAG_WM, "enableScreenAfterBoot: mDisplayEnabled=" + mDisplayEnabled + " mForceDisplayEnabled=" + mForceDisplayEnabled + " mShowingBootMessages=" + mShowingBootMessages + " mSystemBooted=" + mSystemBooted, here); @@ -5362,7 +5354,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_BOOT) { RuntimeException here = new RuntimeException("here"); here.fillInStackTrace(); - Slog.i(TAG, "enableScreenIfNeededLocked: mDisplayEnabled=" + mDisplayEnabled + Slog.i(TAG_WM, "enableScreenIfNeededLocked: mDisplayEnabled=" + mDisplayEnabled + " mForceDisplayEnabled=" + mForceDisplayEnabled + " mShowingBootMessages=" + mShowingBootMessages + " mSystemBooted=" + mSystemBooted, here); @@ -5381,7 +5373,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mDisplayEnabled) { return; } - Slog.w(TAG, "***** BOOT TIMEOUT: forcing display enabled"); + Slog.w(TAG_WM, "***** BOOT TIMEOUT: forcing display enabled"); mForceDisplayEnabled = true; } performEnableScreen(); @@ -5420,7 +5412,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (DEBUG_SCREEN_ON || DEBUG_BOOT) { - Slog.i(TAG, "******** booted=" + mSystemBooted + " msg=" + mShowingBootMessages + Slog.i(TAG_WM, "******** booted=" + mSystemBooted + " msg=" + mShowingBootMessages + " haveBoot=" + haveBootMsg + " haveApp=" + haveApp + " haveWall=" + haveWallpaper + " wallEnabled=" + wallpaperEnabled + " haveKeyguard=" + haveKeyguard); @@ -5445,7 +5437,7 @@ public class WindowManagerService extends IWindowManager.Stub public void performEnableScreen() { synchronized(mWindowMap) { - if (DEBUG_BOOT) Slog.i(TAG, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled + if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled + " mForceDisplayEnabled=" + mForceDisplayEnabled + " mShowingBootMessages=" + mShowingBootMessages + " mSystemBooted=" + mSystemBooted @@ -5469,7 +5461,7 @@ public class WindowManagerService extends IWindowManager.Stub try { IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger"); if (surfaceFlinger != null) { - //Slog.i(TAG, "******* TELLING SURFACE FLINGER WE ARE BOOTED!"); + //Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!"); Parcel data = Parcel.obtain(); data.writeInterfaceToken("android.ui.ISurfaceComposer"); surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED @@ -5477,20 +5469,20 @@ public class WindowManagerService extends IWindowManager.Stub data.recycle(); } } catch (RemoteException ex) { - Slog.e(TAG, "Boot completed: SurfaceFlinger is dead!"); + Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!"); } mBootAnimationStopped = true; } if (!mForceDisplayEnabled && !checkBootAnimationCompleteLocked()) { - if (DEBUG_BOOT) Slog.i(TAG, "performEnableScreen: Waiting for anim complete"); + if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: Waiting for anim complete"); return; } EventLog.writeEvent(EventLogTags.WM_BOOT_ANIMATION_DONE, SystemClock.uptimeMillis()); Trace.asyncTraceEnd(Trace.TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0); mDisplayEnabled = true; - if (DEBUG_SCREEN_ON || DEBUG_BOOT) Slog.i(TAG, "******************** ENABLING SCREEN!"); + if (DEBUG_SCREEN_ON || DEBUG_BOOT) Slog.i(TAG_WM, "******************** ENABLING SCREEN!"); // Enable input dispatch. mInputMonitor.setEventDispatchingLw(mEventDispatchingEnabled); @@ -5512,10 +5504,10 @@ public class WindowManagerService extends IWindowManager.Stub mH.removeMessages(H.CHECK_IF_BOOT_ANIMATION_FINISHED); mH.sendEmptyMessageDelayed(H.CHECK_IF_BOOT_ANIMATION_FINISHED, BOOT_ANIMATION_POLL_INTERVAL); - if (DEBUG_BOOT) Slog.i(TAG, "checkBootAnimationComplete: Waiting for anim complete"); + if (DEBUG_BOOT) Slog.i(TAG_WM, "checkBootAnimationComplete: Waiting for anim complete"); return false; } - if (DEBUG_BOOT) Slog.i(TAG, "checkBootAnimationComplete: Animation complete!"); + if (DEBUG_BOOT) Slog.i(TAG_WM, "checkBootAnimationComplete: Animation complete!"); return true; } @@ -5525,7 +5517,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_BOOT) { RuntimeException here = new RuntimeException("here"); here.fillInStackTrace(); - Slog.i(TAG, "showBootMessage: msg=" + msg + " always=" + always + Slog.i(TAG_WM, "showBootMessage: msg=" + msg + " always=" + always + " mAllowBootMessages=" + mAllowBootMessages + " mShowingBootMessages=" + mShowingBootMessages + " mSystemBooted=" + mSystemBooted, here); @@ -5554,7 +5546,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_BOOT) { RuntimeException here = new RuntimeException("here"); here.fillInStackTrace(); - Slog.i(TAG, "hideBootMessagesLocked: mDisplayEnabled=" + mDisplayEnabled + Slog.i(TAG_WM, "hideBootMessagesLocked: mDisplayEnabled=" + mDisplayEnabled + " mForceDisplayEnabled=" + mForceDisplayEnabled + " mShowingBootMessages=" + mShowingBootMessages + " mSystemBooted=" + mSystemBooted, here); @@ -5605,7 +5597,7 @@ public class WindowManagerService extends IWindowManager.Stub public void showCircularMask(boolean visible) { synchronized(mWindowMap) { - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, ">>> OPEN TRANSACTION showCircularMask(visible=" + visible + ")"); SurfaceControl.openTransaction(); try { @@ -5631,7 +5623,7 @@ public class WindowManagerService extends IWindowManager.Stub } } finally { SurfaceControl.closeTransaction(); - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, "<<< CLOSE TRANSACTION showCircularMask(visible=" + visible + ")"); } } @@ -5640,7 +5632,7 @@ public class WindowManagerService extends IWindowManager.Stub public void showEmulatorDisplayOverlay() { synchronized(mWindowMap) { - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, ">>> OPEN TRANSACTION showEmulatorDisplayOverlay"); SurfaceControl.openTransaction(); try { @@ -5656,7 +5648,7 @@ public class WindowManagerService extends IWindowManager.Stub mEmulatorDisplayOverlay.setVisibility(true); } finally { SurfaceControl.closeTransaction(); - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, "<<< CLOSE TRANSACTION showEmulatorDisplayOverlay"); } } @@ -5695,7 +5687,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (SHOW_VERBOSE_TRANSACTIONS) Slog.i(TAG, + if (SHOW_VERBOSE_TRANSACTIONS) Slog.i(TAG_WM, ">>> OPEN TRANSACTION showStrictModeViolation"); SurfaceControl.openTransaction(); try { @@ -5707,7 +5699,7 @@ public class WindowManagerService extends IWindowManager.Stub mStrictModeFlash.setVisibility(on); } finally { SurfaceControl.closeTransaction(); - if (SHOW_VERBOSE_TRANSACTIONS) Slog.i(TAG, + if (SHOW_VERBOSE_TRANSACTIONS) Slog.i(TAG_WM, "<<< CLOSE TRANSACTION showStrictModeViolation"); } } @@ -5794,7 +5786,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { displayContent = getDisplayContentLocked(displayId); if (displayContent == null) { - if (DEBUG_SCREENSHOT) Slog.i(TAG, "Screenshot of " + appToken + if (DEBUG_SCREENSHOT) Slog.i(TAG_WM, "Screenshot of " + appToken + ": returning null. No Display for displayId=" + displayId); return null; } @@ -5803,7 +5795,7 @@ public class WindowManagerService extends IWindowManager.Stub int dw = displayInfo.logicalWidth; int dh = displayInfo.logicalHeight; if (dw == 0 || dh == 0) { - if (DEBUG_SCREENSHOT) Slog.i(TAG, "Screenshot of " + appToken + if (DEBUG_SCREENSHOT) Slog.i(TAG_WM, "Screenshot of " + appToken + ": returning null. logical widthxheight=" + dw + "x" + dh); return null; } @@ -5925,21 +5917,21 @@ public class WindowManagerService extends IWindowManager.Stub if (appToken != null && appWin == null) { // Can't find a window to snapshot. - if (DEBUG_SCREENSHOT) Slog.i(TAG, + if (DEBUG_SCREENSHOT) Slog.i(TAG_WM, "Screenshot: Couldn't find a surface matching " + appToken); return null; } if (!screenshotReady) { if (retryCount > MAX_SCREENSHOT_RETRIES) { - Slog.i(TAG, "Screenshot max retries " + retryCount + " of " + appToken + + Slog.i(TAG_WM, "Screenshot max retries " + retryCount + " of " + appToken + " appWin=" + (appWin == null ? "null" : (appWin + " drawState=" + appWin.mWinAnimator.mDrawState))); return null; } // Delay and hope that window gets drawn. - if (DEBUG_SCREENSHOT) Slog.i(TAG, "Screenshot: No image ready for " + appToken + if (DEBUG_SCREENSHOT) Slog.i(TAG_WM, "Screenshot: No image ready for " + appToken + ", " + appWin + " drawState=" + appWin.mWinAnimator.mDrawState); continue; } @@ -5950,7 +5942,7 @@ public class WindowManagerService extends IWindowManager.Stub // taken. if (maxLayer == 0) { - if (DEBUG_SCREENSHOT) Slog.i(TAG, "Screenshot of " + appToken + if (DEBUG_SCREENSHOT) Slog.i(TAG_WM, "Screenshot of " + appToken + ": returning null maxLayer=" + maxLayer); return null; } @@ -5998,11 +5990,11 @@ public class WindowManagerService extends IWindowManager.Stub convertCropForSurfaceFlinger(crop, rot, dw, dh); if (DEBUG_SCREENSHOT) { - Slog.i(TAG, "Screenshot: " + dw + "x" + dh + " from " + minLayer + " to " + Slog.i(TAG_WM, "Screenshot: " + dw + "x" + dh + " from " + minLayer + " to " + maxLayer + " appToken=" + appToken); for (int i = 0; i < windows.size(); i++) { WindowState win = windows.get(i); - Slog.i(TAG, win + ": " + win.mLayer + Slog.i(TAG_WM, win + ": " + win.mLayer + " animLayer=" + win.mWinAnimator.mAnimLayer + " surfaceLayer=" + win.mWinAnimator.mSurfaceController.getLayer()); } @@ -6012,13 +6004,13 @@ public class WindowManagerService extends IWindowManager.Stub mAnimator.getScreenRotationAnimationLocked(Display.DEFAULT_DISPLAY); final boolean inRotation = screenRotationAnimation != null && screenRotationAnimation.isAnimating(); - if (DEBUG_SCREENSHOT && inRotation) Slog.v(TAG, + if (DEBUG_SCREENSHOT && inRotation) Slog.v(TAG_WM, "Taking screenshot while rotating"); bm = SurfaceControl.screenshot(crop, width, height, minLayer, maxLayer, inRotation, rot); if (bm == null) { - Slog.w(TAG, "Screenshot failure taking screenshot for (" + dw + "x" + dh + Slog.w(TAG_WM, "Screenshot failure taking screenshot for (" + dw + "x" + dh + ") to layer " + maxLayer); return null; } @@ -6040,7 +6032,7 @@ public class WindowManagerService extends IWindowManager.Stub } } if (allBlack) { - Slog.i(TAG, "Screenshot " + appWin + " was monochrome(" + + Slog.i(TAG_WM, "Screenshot " + appWin + " was monochrome(" + Integer.toHexString(firstColor) + ")! mSurfaceLayer=" + (appWin != null ? appWin.mWinAnimator.mSurfaceController.getLayer() : "null") + @@ -6072,7 +6064,7 @@ public class WindowManagerService extends IWindowManager.Stub + "rotation constant."); } - if (DEBUG_ORIENTATION) Slog.v(TAG, "freezeRotation: mRotation=" + mRotation); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "freezeRotation: mRotation=" + mRotation); long origId = Binder.clearCallingIdentity(); try { @@ -6096,7 +6088,7 @@ public class WindowManagerService extends IWindowManager.Stub throw new SecurityException("Requires SET_ORIENTATION permission"); } - if (DEBUG_ORIENTATION) Slog.v(TAG, "thawRotation: mRotation=" + mRotation); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "thawRotation: mRotation=" + mRotation); long origId = Binder.clearCallingIdentity(); try { @@ -6150,7 +6142,7 @@ public class WindowManagerService extends IWindowManager.Stub } public void updateRotationUnchecked(boolean alwaysSendConfiguration, boolean forceRelayout) { - if(DEBUG_ORIENTATION) Slog.v(TAG, "updateRotationUnchecked(" + if(DEBUG_ORIENTATION) Slog.v(TAG_WM, "updateRotationUnchecked(" + "alwaysSendConfiguration=" + alwaysSendConfiguration + ")"); long origId = Binder.clearCallingIdentity(); @@ -6181,7 +6173,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mDeferredRotationPauseCount > 0) { // Rotation updates have been paused temporarily. Defer the update until // updates have been resumed. - if (DEBUG_ORIENTATION) Slog.v(TAG, "Deferring rotation, rotation is paused."); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, rotation is paused."); return false; } @@ -6191,13 +6183,13 @@ public class WindowManagerService extends IWindowManager.Stub // Rotation updates cannot be performed while the previous rotation change // animation is still in progress. Skip this update. We will try updating // again after the animation is finished and the display is unfrozen. - if (DEBUG_ORIENTATION) Slog.v(TAG, "Deferring rotation, animation in progress."); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, animation in progress."); return false; } if (!mDisplayEnabled) { // No point choosing a rotation if the display is not enabled. - if (DEBUG_ORIENTATION) Slog.v(TAG, "Deferring rotation, display is not enabled."); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, display is not enabled."); return false; } @@ -6211,7 +6203,7 @@ public class WindowManagerService extends IWindowManager.Stub mForcedAppOrientation, rotation); if (DEBUG_ORIENTATION) { - Slog.v(TAG, "Application requested orientation " + Slog.v(TAG_WM, "Application requested orientation " + mForcedAppOrientation + ", got rotation " + rotation + " which has " + (altOrientation ? "incompatible" : "compatible") + " metrics"); @@ -6223,7 +6215,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (DEBUG_ORIENTATION) { - Slog.v(TAG, + Slog.v(TAG_WM, "Rotation changed to " + rotation + (altOrientation ? " (alt)" : "") + " from " + mRotation + (mAltOrientation ? " (alt)" : "") + ", forceApp=" + mForcedAppOrientation); @@ -6260,7 +6252,7 @@ public class WindowManagerService extends IWindowManager.Stub final DisplayInfo displayInfo = displayContent.getDisplayInfo(); if (!inTransaction) { if (SHOW_TRANSACTIONS) { - Slog.i(TAG, ">>> OPEN TRANSACTION setRotationUnchecked"); + Slog.i(TAG_WM, ">>> OPEN TRANSACTION setRotationUnchecked"); } SurfaceControl.openTransaction(); } @@ -6282,7 +6274,7 @@ public class WindowManagerService extends IWindowManager.Stub if (!inTransaction) { SurfaceControl.closeTransaction(); if (SHOW_LIGHT_TRANSACTIONS) { - Slog.i(TAG, "<<< CLOSE TRANSACTION setRotationUnchecked"); + Slog.i(TAG_WM, "<<< CLOSE TRANSACTION setRotationUnchecked"); } } } @@ -6295,7 +6287,7 @@ public class WindowManagerService extends IWindowManager.Stub w.mAppToken.destroySavedSurfaces(); } if (w.mHasSurface) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "Set mOrientationChanging of " + w); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Set mOrientationChanging of " + w); w.mOrientationChanging = true; mWindowPlacerLocked.mOrientationChangeComplete = false; } @@ -6465,7 +6457,7 @@ public class WindowManagerService extends IWindowManager.Stub try { return mViewServer.start(); } catch (IOException e) { - Slog.w(TAG, "View server did not start"); + Slog.w(TAG_WM, "View server did not start"); } } return false; @@ -6475,7 +6467,7 @@ public class WindowManagerService extends IWindowManager.Stub mViewServer = new ViewServer(this, port); return mViewServer.start(); } catch (IOException e) { - Slog.w(TAG, "View server did not start"); + Slog.w(TAG_WM, "View server did not start"); } return false; } @@ -6709,7 +6701,7 @@ public class WindowManagerService extends IWindowManager.Stub } } catch (Exception e) { - Slog.w(TAG, "Could not send command " + command + " with parameters " + parameters, e); + Slog.w(TAG_WM, "Could not send command " + command + " with parameters " + parameters, e); success = false; } finally { if (data != null) { @@ -6980,7 +6972,7 @@ public class WindowManagerService extends IWindowManager.Stub displayContent.mBaseDisplayRect.set(0, 0, dw, dh); if (false) { - Slog.i(TAG, "Set app display size: " + appWidth + " x " + appHeight); + Slog.i(TAG_WM, "Set app display size: " + appWidth + " x " + appHeight); } mCompatibleScreenScale = CompatibilityInfo.computeCompatibleScaling(mDisplayMetrics, @@ -7123,7 +7115,7 @@ public class WindowManagerService extends IWindowManager.Stub } private void startScrollingTask(DisplayContent displayContent, int startX, int startY) { - if (DEBUG_TASK_POSITIONING) Slog.d(TAG, + if (DEBUG_TASK_POSITIONING) Slog.d(TAG_WM, "startScrollingTask: " + "{" + startX + ", " + startY + "}"); Task task = null; @@ -7158,22 +7150,22 @@ public class WindowManagerService extends IWindowManager.Stub private boolean startPositioningLocked( WindowState win, boolean resize, float startX, float startY) { - if (DEBUG_TASK_POSITIONING) Slog.d(TAG, "startPositioningLocked: " + if (DEBUG_TASK_POSITIONING) Slog.d(TAG_WM, "startPositioningLocked: " + "win=" + win + ", resize=" + resize + ", {" + startX + ", " + startY + "}"); if (win == null || win.getAppToken() == null) { - Slog.w(TAG, "startPositioningLocked: Bad window " + win); + Slog.w(TAG_WM, "startPositioningLocked: Bad window " + win); return false; } if (win.mInputChannel == null) { - Slog.wtf(TAG, "startPositioningLocked: " + win + " has no input channel, " + Slog.wtf(TAG_WM, "startPositioningLocked: " + win + " has no input channel, " + " probably being removed"); return false; } final DisplayContent displayContent = win.getDisplayContent(); if (displayContent == null) { - Slog.w(TAG, "startPositioningLocked: Invalid display content " + win); + Slog.w(TAG_WM, "startPositioningLocked: Invalid display content " + win); return false; } @@ -7183,7 +7175,7 @@ public class WindowManagerService extends IWindowManager.Stub mInputMonitor.updateInputWindowsLw(true /*force*/); if (!mInputManager.transferTouchFocus( win.mInputChannel, mTaskPositioner.mServerChannel)) { - Slog.e(TAG, "startPositioningLocked: Unable to transfer touch focus"); + Slog.e(TAG_WM, "startPositioningLocked: Unable to transfer touch focus"); mTaskPositioner.unregister(); mTaskPositioner = null; mInputMonitor.updateInputWindowsLw(true /*force*/); @@ -7196,7 +7188,7 @@ public class WindowManagerService extends IWindowManager.Stub private void finishPositioning() { if (DEBUG_TASK_POSITIONING) { - Slog.d(TAG, "finishPositioning"); + Slog.d(TAG_WM, "finishPositioning"); } synchronized (mWindowMap) { if (mTaskPositioner != null) { @@ -7214,7 +7206,7 @@ public class WindowManagerService extends IWindowManager.Stub IBinder prepareDragSurface(IWindow window, SurfaceSession session, int flags, int width, int height, Surface outSurface) { if (DEBUG_DRAG) { - Slog.d(TAG, "prepare drag surface: w=" + width + " h=" + height + Slog.d(TAG_WM, "prepare drag surface: w=" + width + " h=" + height + " flags=" + Integer.toHexString(flags) + " win=" + window + " asbinder=" + window.asBinder()); } @@ -7241,7 +7233,7 @@ public class WindowManagerService extends IWindowManager.Stub } surface.setAlpha(alpha); - if (SHOW_TRANSACTIONS) Slog.i(TAG, " DRAG " + if (SHOW_TRANSACTIONS) Slog.i(TAG_WM, " DRAG " + surface + ": CREATE"); outSurface.copyFrom(surface); final IBinder winBinder = window.asBinder(); @@ -7257,10 +7249,10 @@ public class WindowManagerService extends IWindowManager.Stub Message msg = mH.obtainMessage(H.DRAG_START_TIMEOUT, winBinder); mH.sendMessageDelayed(msg, 5000); } else { - Slog.w(TAG, "Drag already in progress"); + Slog.w(TAG_WM, "Drag already in progress"); } } catch (OutOfResourcesException e) { - Slog.e(TAG, "Can't allocate drag surface w=" + width + " h=" + height, e); + Slog.e(TAG_WM, "Can't allocate drag surface w=" + width + " h=" + height, e); if (mDragState != null) { mDragState.reset(); mDragState = null; @@ -7339,7 +7331,7 @@ public class WindowManagerService extends IWindowManager.Stub public boolean detectSafeMode() { if (!mInputMonitor.waitForInputDevicesReady( INPUT_DEVICES_READY_FOR_SAFE_MODE_DETECTION_TIMEOUT_MILLIS)) { - Slog.w(TAG, "Devices still not ready after waiting " + Slog.w(TAG_WM, "Devices still not ready after waiting " + INPUT_DEVICES_READY_FOR_SAFE_MODE_DETECTION_TIMEOUT_MILLIS + " milliseconds before attempting to detect safe mode."); } @@ -7363,10 +7355,10 @@ public class WindowManagerService extends IWindowManager.Stub } catch (IllegalArgumentException e) { } if (mSafeMode) { - Log.i(TAG, "SAFE MODE ENABLED (menu=" + menuState + " s=" + sState + Log.i(TAG_WM, "SAFE MODE ENABLED (menu=" + menuState + " s=" + sState + " dpad=" + dpadState + " trackball=" + trackballState + ")"); } else { - Log.i(TAG, "SAFE MODE not enabled"); + Log.i(TAG_WM, "SAFE MODE not enabled"); } mPolicy.setSafeMode(mSafeMode); return mSafeMode; @@ -7487,7 +7479,7 @@ public class WindowManagerService extends IWindowManager.Stub @Override public void handleMessage(Message msg) { if (DEBUG_WINDOW_TRACE) { - Slog.v(TAG, "handleMessage: entry what=" + msg.what); + Slog.v(TAG_WM, "handleMessage: entry what=" + msg.what); } switch (msg.what) { case REPORT_FOCUS_CHANGE: { @@ -7510,11 +7502,11 @@ public class WindowManagerService extends IWindowManager.Stub return; } mLastFocus = newFocus; - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG, "Focus moving from " + lastFocus + + if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Focus moving from " + lastFocus + " to " + newFocus); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { - //Slog.i(TAG, "Delaying loss of focus..."); + //Slog.i(TAG_WM, "Delaying loss of focus..."); mLosingFocus.add(lastFocus); lastFocus = null; } @@ -7529,13 +7521,13 @@ public class WindowManagerService extends IWindowManager.Stub //System.out.println("Changing focus from " + lastFocus // + " to " + newFocus); if (newFocus != null) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG, "Gaining focus: " + newFocus); + if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Gaining focus: " + newFocus); newFocus.reportFocusChangedSerialized(true, mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG, "Losing focus: " + lastFocus); + if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Losing focus: " + lastFocus); lastFocus.reportFocusChangedSerialized(false, mInTouchMode); } } break; @@ -7550,7 +7542,7 @@ public class WindowManagerService extends IWindowManager.Stub final int N = losers.size(); for (int i=0; i<N; i++) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG, "Losing delayed focus: " + + if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Losing delayed focus: " + losers.get(i)); losers.get(i).reportFocusChangedSerialized(false, mInTouchMode); } @@ -7571,7 +7563,7 @@ public class WindowManagerService extends IWindowManager.Stub return; } - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Add starting " + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Add starting " + wtoken + ": pkg=" + sd.pkg); View view = null; @@ -7580,7 +7572,7 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.token, sd.pkg, sd.theme, sd.compatInfo, sd.nonLocalizedLabel, sd.labelRes, sd.icon, sd.logo, sd.windowFlags); } catch (Exception e) { - Slog.w(TAG, "Exception when adding starting window", e); + Slog.w(TAG_WM, "Exception when adding starting window", e); } if (view != null) { @@ -7591,7 +7583,7 @@ public class WindowManagerService extends IWindowManager.Stub // If the window was successfully added, then // we need to remove it. if (wtoken.startingWindow != null) { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Aborted starting " + wtoken + ": removed=" + wtoken.removed + " startingData=" + wtoken.startingData); @@ -7602,7 +7594,7 @@ public class WindowManagerService extends IWindowManager.Stub } else { wtoken.startingView = view; } - if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG, + if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG_WM, "Added starting " + wtoken + ": startingWindow=" + wtoken.startingWindow + " startingView=" @@ -7613,7 +7605,7 @@ public class WindowManagerService extends IWindowManager.Stub try { mPolicy.removeStartingWindow(wtoken.token, view); } catch (Exception e) { - Slog.w(TAG, "Exception when removing starting window", e); + Slog.w(TAG_WM, "Exception when removing starting window", e); } } } @@ -7624,7 +7616,7 @@ public class WindowManagerService extends IWindowManager.Stub IBinder token = null; View view = null; synchronized (mWindowMap) { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Remove starting " + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Remove starting " + wtoken + ": startingWindow=" + wtoken.startingWindow + " startingView=" + wtoken.startingView); @@ -7641,7 +7633,7 @@ public class WindowManagerService extends IWindowManager.Stub try { mPolicy.removeStartingWindow(token, view); } catch (Exception e) { - Slog.w(TAG, "Exception when removing starting window", e); + Slog.w(TAG_WM, "Exception when removing starting window", e); } } } break; @@ -7657,7 +7649,7 @@ public class WindowManagerService extends IWindowManager.Stub } AppWindowToken wtoken = mFinishedStarting.remove(N-1); - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Finished starting " + wtoken + ": startingWindow=" + wtoken.startingWindow + " startingView=" + wtoken.startingView); @@ -7677,7 +7669,7 @@ public class WindowManagerService extends IWindowManager.Stub try { mPolicy.removeStartingWindow(token, view); } catch (Exception e) { - Slog.w(TAG, "Exception when removing starting window", e); + Slog.w(TAG_WM, "Exception when removing starting window", e); } } } break; @@ -7687,7 +7679,7 @@ public class WindowManagerService extends IWindowManager.Stub try { if (DEBUG_VISIBILITY) Slog.v( - TAG, "Reporting drawn in " + wtoken); + TAG_WM, "Reporting drawn in " + wtoken); wtoken.appToken.windowsDrawn(); } catch (RemoteException ex) { } @@ -7701,7 +7693,7 @@ public class WindowManagerService extends IWindowManager.Stub try { if (DEBUG_VISIBILITY) Slog.v( - TAG, "Reporting visible in " + wtoken + TAG_WM, "Reporting visible in " + wtoken + " visible=" + nowVisible + " gone=" + nowGone); if (nowVisible) { @@ -7716,7 +7708,7 @@ public class WindowManagerService extends IWindowManager.Stub case WINDOW_FREEZE_TIMEOUT: { // TODO(multidisplay): Can non-default displays rotate? synchronized (mWindowMap) { - Slog.w(TAG, "Window freeze timeout expired."); + Slog.w(TAG_WM, "Window freeze timeout expired."); mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_TIMEOUT; final WindowList windows = getDefaultWindowListLocked(); int i = windows.size(); @@ -7727,7 +7719,7 @@ public class WindowManagerService extends IWindowManager.Stub w.mOrientationChanging = false; w.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); - Slog.w(TAG, "Force clearing orientation change: " + w); + Slog.w(TAG_WM, "Force clearing orientation change: " + w); } } mWindowPlacerLocked.performSurfacePlacement(); @@ -7739,7 +7731,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { if (mAppTransition.isTransitionSet() || !mOpeningApps.isEmpty() || !mClosingApps.isEmpty()) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "*** APP TRANSITION TIMEOUT." + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "*** APP TRANSITION TIMEOUT." + " isTransitionSet()=" + mAppTransition.isTransitionSet() + " mOpeningApps.size()=" + mOpeningApps.size() + " mClosingApps.size()=" + mClosingApps.size()); @@ -7788,7 +7780,7 @@ public class WindowManagerService extends IWindowManager.Stub case APP_FREEZE_TIMEOUT: { synchronized (mWindowMap) { - Slog.w(TAG, "App freeze timeout expired."); + Slog.w(TAG_WM, "App freeze timeout expired."); mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_TIMEOUT; final int numStacks = mStackIdToStack.size(); for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) { @@ -7799,7 +7791,7 @@ public class WindowManagerService extends IWindowManager.Stub for (int tokenNdx = tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { AppWindowToken tok = tokens.get(tokenNdx); if (tok.mAppAnimator.freezingScreen) { - Slog.w(TAG, "Force clearing freeze: " + tok); + Slog.w(TAG_WM, "Force clearing freeze: " + tok); unsetAppFreezingScreenLocked(tok, true, true); } } @@ -7839,7 +7831,7 @@ public class WindowManagerService extends IWindowManager.Stub case DRAG_START_TIMEOUT: { IBinder win = (IBinder)msg.obj; if (DEBUG_DRAG) { - Slog.w(TAG, "Timeout starting drag by win " + win); + Slog.w(TAG_WM, "Timeout starting drag by win " + win); } synchronized (mWindowMap) { // !!! TODO: ANR the app that has failed to start the drag in time @@ -7856,7 +7848,7 @@ public class WindowManagerService extends IWindowManager.Stub case DRAG_END_TIMEOUT: { IBinder win = (IBinder)msg.obj; if (DEBUG_DRAG) { - Slog.w(TAG, "Timeout ending drag to win " + win); + Slog.w(TAG_WM, "Timeout ending drag to win " + win); } synchronized (mWindowMap) { // !!! TODO: ANR the drag-receiving app @@ -7881,7 +7873,7 @@ public class WindowManagerService extends IWindowManager.Stub case WAITING_FOR_DRAWN_TIMEOUT: { Runnable callback = null; synchronized (mWindowMap) { - Slog.w(TAG, "Timeout waiting for drawn: undrawn=" + mWaitingForDrawn); + Slog.w(TAG_WM, "Timeout waiting for drawn: undrawn=" + mWaitingForDrawn); mWaitingForDrawn.clear(); callback = mWaitingForDrawnCallback; mWaitingForDrawnCallback = null; @@ -8006,7 +7998,7 @@ public class WindowManagerService extends IWindowManager.Stub case CHECK_IF_BOOT_ANIMATION_FINISHED: { final boolean bootAnimationComplete; synchronized (mWindowMap) { - if (DEBUG_BOOT) Slog.i(TAG, "CHECK_IF_BOOT_ANIMATION_FINISHED:"); + if (DEBUG_BOOT) Slog.i(TAG_WM, "CHECK_IF_BOOT_ANIMATION_FINISHED:"); bootAnimationComplete = checkBootAnimationCompleteLocked(); } if (bootAnimationComplete) { @@ -8063,7 +8055,7 @@ public class WindowManagerService extends IWindowManager.Stub break; } if (DEBUG_WINDOW_TRACE) { - Slog.v(TAG, "handleMessage: exit"); + Slog.v(TAG_WM, "handleMessage: exit"); } } } @@ -8098,9 +8090,9 @@ public class WindowManagerService extends IWindowManager.Stub // TODO(multidisplay): IMEs are only supported on the default display. WindowState imFocus = getDefaultWindowListLocked().get(idx-1); if (DEBUG_INPUT_METHOD) { - Slog.i(TAG, "Desired input method target: " + imFocus); - Slog.i(TAG, "Current focus: " + mCurrentFocus); - Slog.i(TAG, "Last focus: " + mLastFocus); + Slog.i(TAG_WM, "Desired input method target: " + imFocus); + Slog.i(TAG_WM, "Current focus: " + mCurrentFocus); + Slog.i(TAG_WM, "Last focus: " + mLastFocus); } if (imFocus != null) { // This may be a starting window, in which case we still want @@ -8112,18 +8104,18 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=0; i<imFocus.mAppToken.windows.size(); i++) { WindowState w = imFocus.mAppToken.windows.get(i); if (w != imFocus) { - Log.i(TAG, "Switching to real app window: " + w); + Log.i(TAG_WM, "Switching to real app window: " + w); imFocus = w; break; } } } if (DEBUG_INPUT_METHOD) { - Slog.i(TAG, "IM target client: " + imFocus.mSession.mClient); + Slog.i(TAG_WM, "IM target client: " + imFocus.mSession.mClient); if (imFocus.mSession.mClient != null) { - Slog.i(TAG, "IM target client binder: " + Slog.i(TAG_WM, "IM target client binder: " + imFocus.mSession.mClient.asBinder()); - Slog.i(TAG, "Requesting client binder: " + client.asBinder()); + Slog.i(TAG_WM, "Requesting client binder: " + client.asBinder()); } } if (imFocus.mSession.mClient != null && @@ -8236,7 +8228,7 @@ public class WindowManagerService extends IWindowManager.Stub } private void setForcedDisplayScalingModeLocked(DisplayContent displayContent, int mode) { - Slog.i(TAG, "Using display scaling mode: " + (mode == 0 ? "auto" : "off")); + Slog.i(TAG_WM, "Using display scaling mode: " + (mode == 0 ? "auto" : "off")); displayContent.mDisplayScalingDisabled = (mode != 0); reconfigureDisplayLocked(displayContent); } @@ -8257,7 +8249,7 @@ public class WindowManagerService extends IWindowManager.Stub height = Integer.parseInt(sizeStr.substring(pos+1)); if (displayContent.mBaseDisplayWidth != width || displayContent.mBaseDisplayHeight != height) { - Slog.i(TAG, "FORCED DISPLAY SIZE: " + width + "x" + height); + Slog.i(TAG_WM, "FORCED DISPLAY SIZE: " + width + "x" + height); displayContent.mBaseDisplayWidth = width; displayContent.mBaseDisplayHeight = height; } @@ -8277,7 +8269,7 @@ public class WindowManagerService extends IWindowManager.Stub try { density = Integer.parseInt(densityStr); if (displayContent.mBaseDisplayDensity != density) { - Slog.i(TAG, "FORCED DISPLAY DENSITY: " + density); + Slog.i(TAG_WM, "FORCED DISPLAY DENSITY: " + density); displayContent.mBaseDisplayDensity = density; } } catch (NumberFormatException ex) { @@ -8288,14 +8280,14 @@ public class WindowManagerService extends IWindowManager.Stub int mode = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.DISPLAY_SCALING_FORCE, 0); if (mode != 0) { - Slog.i(TAG, "FORCED DISPLAY SCALING DISABLED"); + Slog.i(TAG_WM, "FORCED DISPLAY SCALING DISABLED"); displayContent.mDisplayScalingDisabled = true; } } // displayContent must not be null private void setForcedDisplaySizeLocked(DisplayContent displayContent, int width, int height) { - Slog.i(TAG, "Using new display size: " + width + "x" + height); + Slog.i(TAG_WM, "Using new display size: " + width + "x" + height); displayContent.mBaseDisplayWidth = width; displayContent.mBaseDisplayHeight = height; reconfigureDisplayLocked(displayContent); @@ -8378,7 +8370,7 @@ public class WindowManagerService extends IWindowManager.Stub // displayContent must not be null private void setForcedDisplayDensityLocked(DisplayContent displayContent, int density) { - Slog.i(TAG, "Using new display density: " + density); + Slog.i(TAG_WM, "Using new display density: " + density); displayContent.mBaseDisplayDensity = density; reconfigureDisplayLocked(displayContent); } @@ -8495,14 +8487,14 @@ public class WindowManagerService extends IWindowManager.Stub boolean throwOnError) { WindowState win = mWindowMap.get(client); if (localLOGV) Slog.v( - TAG, "Looking up client " + client + ": " + win); + TAG_WM, "Looking up client " + client + ": " + win); if (win == null) { RuntimeException ex = new IllegalArgumentException( "Requested window " + client + " does not exist"); if (throwOnError) { throw ex; } - Slog.w(TAG, "Failed looking up window", ex); + Slog.w(TAG_WM, "Failed looking up window", ex); return null; } if (session != null && win.mSession != session) { @@ -8512,7 +8504,7 @@ public class WindowManagerService extends IWindowManager.Stub if (throwOnError) { throw ex; } - Slog.w(TAG, "Failed looking up window", ex); + Slog.w(TAG_WM, "Failed looking up window", ex); return null; } @@ -8543,7 +8535,7 @@ public class WindowManagerService extends IWindowManager.Stub win.mRebuilding = true; mRebuildTmp[numRemoved] = win; mWindowsChanged = true; - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Rebuild removing window: " + win); + if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Rebuild removing window: " + win); NW--; numRemoved++; continue; @@ -8594,7 +8586,7 @@ public class WindowManagerService extends IWindowManager.Stub i -= lastBelow; if (i != numRemoved) { displayContent.layoutNeeded = true; - Slog.w(TAG, "On display=" + displayContent.getDisplayId() + " Rebuild removed " + + Slog.w(TAG_WM, "On display=" + displayContent.getDisplayId() + " Rebuild removed " + numRemoved + " windows but added " + i, new RuntimeException("here").fillInStackTrace()); for (i=0; i<numRemoved; i++) { @@ -8604,14 +8596,14 @@ public class WindowManagerService extends IWindowManager.Stub PrintWriter pw = new FastPrintWriter(sw, false, 1024); ws.dump(pw, "", true); pw.flush(); - Slog.w(TAG, "This window was lost: " + ws); - Slog.w(TAG, sw.toString()); + Slog.w(TAG_WM, "This window was lost: " + ws); + Slog.w(TAG_WM, sw.toString()); ws.mWinAnimator.destroySurfaceLocked(); } } - Slog.w(TAG, "Current app token list:"); + Slog.w(TAG_WM, "Current app token list:"); dumpAppTokensLocked(); - Slog.w(TAG, "Final window list:"); + Slog.w(TAG_WM, "Final window list:"); dumpWindowsLocked(); } Arrays.fill(mRebuildTmp, null); @@ -8623,7 +8615,7 @@ public class WindowManagerService extends IWindowManager.Stub int curLayer = 0; int i; - if (DEBUG_LAYERS) Slog.v(TAG, "Assigning layers based on windows=" + windows, + if (DEBUG_LAYERS) Slog.v(TAG_WM, "Assigning layers based on windows=" + windows, new RuntimeException("here").fillInStackTrace()); boolean anyLayerChanged = false; @@ -8672,7 +8664,7 @@ public class WindowManagerService extends IWindowManager.Stub // Force an animation pass just to update the mDimLayer layer. scheduleAnimationLocked(); } - if (DEBUG_LAYERS) Slog.v(TAG, "Assign layer " + w + ": " + if (DEBUG_LAYERS) Slog.v(TAG_WM, "Assign layer " + w + ": " + "mBase=" + w.mBaseLayer + " mLayer=" + w.mLayer + (wtoken == null ? @@ -8701,7 +8693,8 @@ public class WindowManagerService extends IWindowManager.Stub } if (!force) { final TaskStack stack = w.getStack(); - if (stack != null && StackId.isAlwaysOnTop(stack.mStackId)) { + if (stack != null && (StackId.isAlwaysOnTop(stack.mStackId) + || stack.mStackId == DOCKED_STACK_ID)) { // If the window's stack is always on top, we want to make it above other windows // also when these windows are animating. force = true; @@ -8718,7 +8711,7 @@ public class WindowManagerService extends IWindowManager.Stub // it frozen/off until this window draws at its new // orientation. if (!okToDisplay() && mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "Changing surface while display frozen: " + w); + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Changing surface while display frozen: " + w); w.mOrientationChanging = true; w.mLastFreezeDuration = 0; mWindowPlacerLocked.mOrientationChangeComplete = false; @@ -8763,7 +8756,7 @@ public class WindowManagerService extends IWindowManager.Stub rebuildAppWindowListLocked(); changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT; - if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, + if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG_WM, "Wallpaper layer changed: assigning layers + relayout"); moveInputMethodWindowsIfNeededLocked(true); mWindowPlacerLocked.mWallpaperMayChange = true; @@ -8781,11 +8774,11 @@ public class WindowManagerService extends IWindowManager.Stub w.setInsetsChanged(); boolean configChanged = w.isConfigChanged(); if (DEBUG_CONFIGURATION && configChanged) { - Slog.v(TAG, "Win " + w + " config changed: " + Slog.v(TAG_WM, "Win " + w + " config changed: " + mCurConfiguration); } final boolean dragResizingChanged = w.isDragResizeChanged(); - if (localLOGV) Slog.v(TAG, "Resizing " + w + if (localLOGV) Slog.v(TAG_WM, "Resizing " + w + ": configChanged=" + configChanged + " dragResizingChanged=" + dragResizingChanged + " last=" + w.mLastFrame + " frame=" + w.mFrame); @@ -8797,7 +8790,7 @@ public class WindowManagerService extends IWindowManager.Stub || configChanged || dragResizingChanged) { if (DEBUG_RESIZE || DEBUG_ORIENTATION) { - Slog.v(TAG, "Resize reasons for w=" + w + ": " + Slog.v(TAG_WM, "Resize reasons for w=" + w + ": " + " contentInsetsChanged=" + w.mContentInsetsChanged + " " + w.mContentInsets.toShortString() + " visibleInsetsChanged=" + w.mVisibleInsetsChanged @@ -8831,7 +8824,7 @@ public class WindowManagerService extends IWindowManager.Stub // application when it has finished drawing. if (w.mOrientationChanging || dragResizingChanged) { if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) { - Slog.v(TAG, "Orientation or resize start waiting for draw" + Slog.v(TAG_WM, "Orientation or resize start waiting for draw" + ", mDrawState=DRAW_PENDING in " + w + ", surfaceController " + winAnimator.mSurfaceController); } @@ -8842,13 +8835,13 @@ public class WindowManagerService extends IWindowManager.Stub } } if (!mResizingWindows.contains(w)) { - if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG_WM, "Resizing window " + w); mResizingWindows.add(w); } } else if (w.mOrientationChanging) { if (w.isDrawnLw()) { - if (DEBUG_ORIENTATION) Slog.v(TAG, + if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Orientation not waiting for draw in " + w + ", surfaceController " + winAnimator.mSurfaceController); w.mOrientationChanging = false; @@ -8865,22 +8858,22 @@ public class WindowManagerService extends IWindowManager.Stub } for (int j = mWaitingForDrawn.size() - 1; j >= 0; j--) { WindowState win = mWaitingForDrawn.get(j); - if (DEBUG_SCREEN_ON) Slog.i(TAG, "Waiting for drawn " + win + + if (DEBUG_SCREEN_ON) Slog.i(TAG_WM, "Waiting for drawn " + win + ": removed=" + win.mRemoved + " visible=" + win.isVisibleLw() + " mHasSurface=" + win.mHasSurface + " drawState=" + win.mWinAnimator.mDrawState); if (win.mRemoved || !win.mHasSurface || !win.mPolicyVisibility) { // Window has been removed or hidden; no draw will now happen, so stop waiting. - if (DEBUG_SCREEN_ON) Slog.w(TAG, "Aborted waiting for drawn: " + win); + if (DEBUG_SCREEN_ON) Slog.w(TAG_WM, "Aborted waiting for drawn: " + win); mWaitingForDrawn.remove(win); } else if (win.hasDrawnLw()) { // Window is now drawn (and shown). - if (DEBUG_SCREEN_ON) Slog.d(TAG, "Window drawn win=" + win); + if (DEBUG_SCREEN_ON) Slog.d(TAG_WM, "Window drawn win=" + win); mWaitingForDrawn.remove(win); } } if (mWaitingForDrawn.isEmpty()) { - if (DEBUG_SCREEN_ON) Slog.d(TAG, "All windows drawn!"); + if (DEBUG_SCREEN_ON) Slog.d(TAG_WM, "All windows drawn!"); mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT); mH.sendEmptyMessage(H.ALL_WINDOWS_DRAWN); } @@ -8960,7 +8953,7 @@ public class WindowManagerService extends IWindowManager.Stub // window list to make sure we haven't left any dangling surfaces // around. - Slog.i(TAG, "Out of memory for surface! Looking for leaks..."); + Slog.i(TAG_WM, "Out of memory for surface! Looking for leaks..."); final int numDisplays = mDisplayContents.size(); for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) { final WindowList windows = mDisplayContents.valueAt(displayNdx).getWindowList(); @@ -8970,7 +8963,7 @@ public class WindowManagerService extends IWindowManager.Stub WindowStateAnimator wsa = ws.mWinAnimator; if (wsa.mSurfaceController != null) { if (!mSessions.contains(wsa.mSession)) { - Slog.w(TAG, "LEAKED SURFACE (session doesn't exist): " + Slog.w(TAG_WM, "LEAKED SURFACE (session doesn't exist): " + ws + " surface=" + wsa.mSurfaceController + " token=" + ws.mToken + " pid=" + ws.mSession.mPid @@ -8980,7 +8973,7 @@ public class WindowManagerService extends IWindowManager.Stub mForceRemoves.add(ws); leakedSurface = true; } else if (ws.mAppToken != null && ws.mAppToken.clientHidden) { - Slog.w(TAG, "LEAKED SURFACE (app token hidden): " + Slog.w(TAG_WM, "LEAKED SURFACE (app token hidden): " + ws + " surface=" + wsa.mSurfaceController + " token=" + ws.mAppToken + " saved=" + ws.mAppToken.hasSavedSurface()); @@ -8994,7 +8987,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (!leakedSurface) { - Slog.w(TAG, "No leaked surfaces; killing applicatons!"); + Slog.w(TAG_WM, "No leaked surfaces; killing applicatons!"); SparseIntArray pidCandidates = new SparseIntArray(); for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) { final WindowList windows = mDisplayContents.valueAt(displayNdx).getWindowList(); @@ -9027,7 +9020,7 @@ public class WindowManagerService extends IWindowManager.Stub if (leakedSurface || killedApps) { // We managed to reclaim some memory, so get rid of the trouble // surface and ask the app to request another one. - Slog.w(TAG, "Looks like we have reclaimed some memory, clearing surface for retry."); + Slog.w(TAG_WM, "Looks like we have reclaimed some memory, clearing surface for retry."); if (surfaceController != null) { if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) logSurface(winAnimator.mWin, "RECOVER DESTROY", null); @@ -9066,7 +9059,7 @@ public class WindowManagerService extends IWindowManager.Stub newFocus = computeFocusedWindowLocked(); } - if (DEBUG_FOCUS_LIGHT || localLOGV) Slog.v(TAG, "Changing focus from " + + if (DEBUG_FOCUS_LIGHT || localLOGV) Slog.v(TAG_WM, "Changing focus from " + mCurrentFocus + " to " + newFocus + " Callers=" + Debug.getCallers(4)); final WindowState oldFocus = mCurrentFocus; mCurrentFocus = newFocus; @@ -9126,7 +9119,7 @@ public class WindowManagerService extends IWindowManager.Stub final WindowState win = windows.get(i); if (localLOGV || DEBUG_FOCUS) Slog.v( - TAG, "Looking for focus: " + i + TAG_WM, "Looking for focus: " + i + " = " + win + ", flags=" + win.mAttrs.flags + ", canReceive=" + win.canReceiveKeys()); @@ -9139,7 +9132,7 @@ public class WindowManagerService extends IWindowManager.Stub // If this window's application has been removed, just skip it. if (wtoken != null && (wtoken.removed || wtoken.sendingToBottom)) { - if (DEBUG_FOCUS) Slog.v(TAG, "Skipping " + wtoken + " because " + if (DEBUG_FOCUS) Slog.v(TAG_WM, "Skipping " + wtoken + " because " + (wtoken.removed ? "removed" : "sendingToBottom")); continue; } @@ -9160,7 +9153,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mFocusedApp == token && token.stackCanReceiveKeys()) { // Whoops, we are below the focused app whose stack can receive keys... // No focus for you!!! - if (localLOGV || DEBUG_FOCUS_LIGHT) Slog.v(TAG, + if (localLOGV || DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: Reached focused app=" + mFocusedApp); return null; } @@ -9172,12 +9165,12 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG, "findFocusedWindow: Found new focus @ " + i + + if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: Found new focus @ " + i + " = " + win); return win; } - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG, "findFocusedWindow: No focusable windows."); + if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: No focusable windows."); return null; } @@ -9253,7 +9246,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mWaitingForConfig || mAppsFreezingScreen > 0 || mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_ACTIVE || mClientFreezingScreen || !mOpeningApps.isEmpty()) { - if (DEBUG_ORIENTATION) Slog.d(TAG, + if (DEBUG_ORIENTATION) Slog.d(TAG_WM, "stopFreezingDisplayLocked: Returning mWaitingForConfig=" + mWaitingForConfig + ", mAppsFreezingScreen=" + mAppsFreezingScreen + ", mWindowsFreezingScreen=" + mWindowsFreezingScreen @@ -9271,7 +9264,7 @@ public class WindowManagerService extends IWindowManager.Stub sb.append(" due to "); sb.append(mLastFinishedFreezeSource); } - Slog.i(TAG, sb.toString()); + Slog.i(TAG_WM, sb.toString()); mH.removeMessages(H.APP_FREEZE_TIMEOUT); mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT); if (PROFILE_ORIENTATION) { @@ -9286,7 +9279,7 @@ public class WindowManagerService extends IWindowManager.Stub mAnimator.getScreenRotationAnimationLocked(displayId); if (CUSTOM_SCREEN_ROTATION && screenRotationAnimation != null && screenRotationAnimation.hasScreenshot()) { - if (DEBUG_ORIENTATION) Slog.i(TAG, "**** Dismissing screen rotation animation"); + if (DEBUG_ORIENTATION) Slog.i(TAG_WM, "**** Dismissing screen rotation animation"); // TODO(multidisplay): rotation on main screen only. DisplayInfo displayInfo = displayContent.getDisplayInfo(); // Get rotation animation again, with new top window @@ -9332,7 +9325,7 @@ public class WindowManagerService extends IWindowManager.Stub mScreenFrozenLock.release(); if (updateRotation) { - if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation"); + if (DEBUG_ORIENTATION) Slog.d(TAG_WM, "Performing post-rotate rotation"); configChanged |= updateRotationUncheckedLocked(false); } @@ -10071,7 +10064,7 @@ public class WindowManagerService extends IWindowManager.Stub private DisplayContent newDisplayContentLocked(final Display display) { DisplayContent displayContent = new DisplayContent(display, this); final int displayId = display.getDisplayId(); - if (DEBUG_DISPLAY) Slog.v(TAG, "Adding display=" + display); + if (DEBUG_DISPLAY) Slog.v(TAG_WM, "Adding display=" + display); mDisplayContents.put(displayId, displayContent); DisplayInfo displayInfo = displayContent.getDisplayInfo(); @@ -10175,7 +10168,7 @@ public class WindowManagerService extends IWindowManager.Stub displayContent.mDeferredRemoval = true; return; } - if (DEBUG_DISPLAY) Slog.v(TAG, "Removing display=" + displayContent); + if (DEBUG_DISPLAY) Slog.v(TAG_WM, "Removing display=" + displayContent); mDisplayContents.delete(displayId); displayContent.close(); if (displayId == Display.DEFAULT_DISPLAY) { @@ -10212,10 +10205,10 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { AppWindowToken appWindowToken = findAppWindowToken(token); if (appWindowToken == null || !appWindowToken.isVisible()) { - Slog.w(TAG, "Attempted to set replacing window on non-existing app token " + token); + Slog.w(TAG_WM, "Attempted to set replacing window on non-existing app token " + token); return; } - if (DEBUG_ADD_REMOVE) Slog.d(TAG, "Marking app token " + appWindowToken + if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "Marking app token " + appWindowToken + " as replacing window."); appWindowToken.mWillReplaceWindow = true; appWindowToken.mHasReplacedWindow = false; @@ -10225,7 +10218,7 @@ public class WindowManagerService extends IWindowManager.Stub // Set-up dummy animation so we can start treating windows associated with this // token like they are in transition before the new app window is ready for us to // run the real transition animation. - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "setReplacingWindow() Setting dummy animation on: " + appWindowToken); appWindowToken.mAppAnimator.setDummyAnimation(); } diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index c9ded3a46a6f..4fb3283cc634 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -83,16 +83,18 @@ import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; -import static com.android.server.wm.WindowManagerService.DEBUG_ADD_REMOVE; -import static com.android.server.wm.WindowManagerService.DEBUG_ANIM; -import static com.android.server.wm.WindowManagerService.DEBUG_APP_TRANSITIONS; -import static com.android.server.wm.WindowManagerService.DEBUG_CONFIGURATION; -import static com.android.server.wm.WindowManagerService.DEBUG_FOCUS_LIGHT; -import static com.android.server.wm.WindowManagerService.DEBUG_LAYOUT; -import static com.android.server.wm.WindowManagerService.DEBUG_ORIENTATION; -import static com.android.server.wm.WindowManagerService.DEBUG_POWER; -import static com.android.server.wm.WindowManagerService.DEBUG_RESIZE; -import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_CONFIGURATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_POWER; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RESIZE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; class WindowList extends ArrayList<WindowState> { } @@ -101,7 +103,7 @@ class WindowList extends ArrayList<WindowState> { * A window in the window manager. */ final class WindowState implements WindowManagerPolicy.WindowState { - static final String TAG = "WindowState"; + static final String TAG = TAG_WITH_CLASS_NAME ? "WindowState" : TAG_WM; // The minimal size of a window within the usable area of the freeform stack. // TODO(multi-window): fix the min sizes when we have mininum width/height support, @@ -479,8 +481,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { + WindowManagerService.TYPE_LAYER_OFFSET; mSubLayer = mPolicy.subWindowTypeToLayerLw(a.type); mAttachedWindow = attachedWindow; - if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " - + mAttachedWindow); + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + mAttachedWindow); final WindowList childWindows = mAttachedWindow.mChildWindows; final int numChildWindows = childWindows.size(); @@ -626,7 +627,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { final int ph = mContainingFrame.height(); if (!mParentFrame.equals(pf)) { - //Slog.i(TAG, "Window " + this + " content frame from " + mParentFrame + //Slog.i(TAG_WM, "Window " + this + " content frame from " + mParentFrame // + " to " + pf); mParentFrame.set(pf); mContentChanged = true; @@ -1242,7 +1243,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { disposeInputChannel(); if (mAttachedWindow != null) { - if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + this + " from " + mAttachedWindow); + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + this + " from " + mAttachedWindow); mAttachedWindow.mChildWindows.remove(this); } mWinAnimator.destroyDeferredSurfaceLocked(); @@ -1700,9 +1701,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { } public void destroySavedSurface() { - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, - "Destroying saved surface: " + this); - + if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, "Destroying saved surface: " + this); if (mSurfaceSaved) { mWinAnimator.destroySurfaceLocked(); } diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 1790fb36a6ee..77b51430bc69 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -20,15 +20,20 @@ import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; import static android.view.WindowManager.LayoutParams.FLAG_SCALED; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; -import static com.android.server.wm.WindowManagerService.DEBUG_ANIM; -import static com.android.server.wm.WindowManagerService.DEBUG_LAYERS; -import static com.android.server.wm.WindowManagerService.DEBUG_ORIENTATION; -import static com.android.server.wm.WindowManagerService.DEBUG_STARTING_WINDOW; -import static com.android.server.wm.WindowManagerService.DEBUG_SURFACE_TRACE; -import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY; -import static com.android.server.wm.WindowManagerService.SHOW_LIGHT_TRANSACTIONS; -import static com.android.server.wm.WindowManagerService.SHOW_SURFACE_ALLOC; -import static com.android.server.wm.WindowManagerService.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER; +import static com.android.server.wm.WindowManagerDebugConfig.HIDE_STACK_CRAWLS; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS; +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_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER; import static com.android.server.wm.WindowManagerService.localLOGV; import static com.android.server.wm.WindowState.DRAG_RESIZE_MODE_FREEFORM; @@ -64,7 +69,7 @@ import java.io.PrintWriter; * Keep track of animations and surface operations for a single WindowState. **/ class WindowStateAnimator { - static final String TAG = "WindowStateAnimator"; + static final String TAG = TAG_WITH_CLASS_NAME ? "WindowStateAnimator" : TAG_WM; static final int WINDOW_FREEZE_LAYER = TYPE_LAYER_MULTIPLIER * 200; // Unchanging local convenience fields. @@ -402,7 +407,7 @@ class WindowStateAnimator { finishExit(); final int displayId = mWin.getDisplayId(); mAnimator.setPendingLayoutChanges(displayId, WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM); - if (WindowManagerService.DEBUG_LAYOUT_REPEATS) + if (DEBUG_LAYOUT_REPEATS) mService.mWindowPlacerLocked.debugLayoutRepeats( "WindowStateAnimator", mAnimator.getPendingLayoutChanges(displayId)); @@ -414,7 +419,7 @@ class WindowStateAnimator { } void finishExit() { - if (WindowManagerService.DEBUG_ANIM) Slog.v( + if (DEBUG_ANIM) Slog.v( TAG, "finishExit in " + this + ": exiting=" + mWin.mExiting + " remove=" + mWin.mRemoveOnExit @@ -660,7 +665,7 @@ class WindowStateAnimator { // Start a new transaction and apply position & offset. final int layerStack = w.getDisplayContent().getDisplay().getLayerStack(); - if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(w, + if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w, "POS " + mTmpSize.left + ", " + mTmpSize.top, null); mSurfaceController.setPositionAndLayer(mTmpSize.left, mTmpSize.top, layerStack, mAnimLayer); @@ -750,7 +755,7 @@ class WindowStateAnimator { try { if (DEBUG_VISIBILITY) { RuntimeException e = null; - if (!WindowManagerService.HIDE_STACK_CRAWLS) { + if (!HIDE_STACK_CRAWLS) { e = new RuntimeException(); e.fillInStackTrace(); } @@ -762,7 +767,7 @@ class WindowStateAnimator { if (mPendingDestroySurface != null) { if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { RuntimeException e = null; - if (!WindowManagerService.HIDE_STACK_CRAWLS) { + if (!HIDE_STACK_CRAWLS) { e = new RuntimeException(); e.fillInStackTrace(); } @@ -775,7 +780,7 @@ class WindowStateAnimator { } else { if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { RuntimeException e = null; - if (!WindowManagerService.HIDE_STACK_CRAWLS) { + if (!HIDE_STACK_CRAWLS) { e = new RuntimeException(); e.fillInStackTrace(); } @@ -811,7 +816,7 @@ class WindowStateAnimator { if (mPendingDestroySurface != null) { if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { RuntimeException e = null; - if (!WindowManagerService.HIDE_STACK_CRAWLS) { + if (!HIDE_STACK_CRAWLS) { e = new RuntimeException(); e.fillInStackTrace(); } @@ -850,7 +855,7 @@ class WindowStateAnimator { wallpaperAnimator.mAnimation != null && !wallpaperAnimator.mAnimation.getDetachWallpaper()) { attachedTransformation = wallpaperAnimator.mTransformation; - if (WindowManagerService.DEBUG_WALLPAPER && attachedTransformation != null) { + if (DEBUG_WALLPAPER && attachedTransformation != null) { Slog.v(TAG, "WP target attached xform: " + attachedTransformation); } } @@ -860,7 +865,7 @@ class WindowStateAnimator { && wpAppAnimator.animation != null && !wpAppAnimator.animation.getDetachWallpaper()) { appTransformation = wpAppAnimator.transformation; - if (WindowManagerService.DEBUG_WALLPAPER && appTransformation != null) { + if (DEBUG_WALLPAPER && appTransformation != null) { Slog.v(TAG, "WP target app xform: " + appTransformation); } } @@ -931,7 +936,7 @@ class WindowStateAnimator { // (a 2x2 matrix + an offset) // Here we must not transform the position of the surface // since it is already included in the transformation. - //Slog.i(TAG, "Transform: " + matrix); + //Slog.i(TAG_WM, "Transform: " + matrix); mHaveMatrix = true; tmpMatrix.getValues(tmpFloats); @@ -953,7 +958,7 @@ class WindowStateAnimator { || (!PixelFormat.formatHasAlpha(mWin.mAttrs.format) || (mWin.isIdentityMatrix(mDsDx, mDtDx, mDsDy, mDtDy) && x == frame.left && y == frame.top))) { - //Slog.i(TAG, "Applying alpha transform"); + //Slog.i(TAG_WM, "Applying alpha transform"); if (selfTransformation) { mShownAlpha *= mTransformation.getAlpha(); } @@ -971,7 +976,7 @@ class WindowStateAnimator { mShownAlpha *= screenRotationAnimation.getEnterTransformation().getAlpha(); } } else { - //Slog.i(TAG, "Not applying alpha transform"); + //Slog.i(TAG_WM, "Not applying alpha transform"); } if ((DEBUG_SURFACE_TRACE || WindowManagerService.localLOGV) @@ -1263,7 +1268,7 @@ class WindowStateAnimator { mLastDtDy = mDtDy; w.mLastHScale = w.mHScale; w.mLastVScale = w.mVScale; - if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(w, + if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w, "controller=" + mSurfaceController + "alpha=" + mShownAlpha + " layer=" + mAnimLayer + " matrix=[" + mDsDx + "*" + w.mHScale @@ -1461,10 +1466,8 @@ class WindowStateAnimator { mWin.mAppToken.removeAllDeadWindows(); if (mWin.mAppToken.startingData != null) { - if (WindowManagerService.DEBUG_STARTING_WINDOW || - WindowManagerService.DEBUG_ANIM) Slog.v(TAG, - "Finish starting " + mWin.mToken - + ": first real window is shown, no animation"); + if (DEBUG_STARTING_WINDOW || DEBUG_ANIM) Slog.v(TAG, "Finish starting " + + mWin.mToken + ": first real window is shown, no animation"); // If this initial window is animating, stop it -- we // will do an animation to reveal it from behind the // starting window, so there is no need for it to also @@ -1575,16 +1578,16 @@ class WindowStateAnimator { a = mService.mAppTransition.loadAnimationAttr(mWin.mAttrs, attr); } } - if (WindowManagerService.DEBUG_ANIM) Slog.v(TAG, + if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: win=" + this + " anim=" + anim + " attr=0x" + Integer.toHexString(attr) + " a=" + a + " transit=" + transit + " isEntrance=" + isEntrance + " Callers " + Debug.getCallers(3)); if (a != null) { - if (WindowManagerService.DEBUG_ANIM) { + if (DEBUG_ANIM) { RuntimeException e = null; - if (!WindowManagerService.HIDE_STACK_CRAWLS) { + if (!HIDE_STACK_CRAWLS) { e = new RuntimeException(); e.fillInStackTrace(); } diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java index f8b8d6ced8d8..bd2912d0c5e6 100644 --- a/services/core/java/com/android/server/wm/WindowSurfaceController.java +++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java @@ -16,12 +16,14 @@ package com.android.server.wm; -import static com.android.server.wm.WindowManagerService.SHOW_TRANSACTIONS; -import static com.android.server.wm.WindowManagerService.SHOW_LIGHT_TRANSACTIONS; -import static com.android.server.wm.WindowManagerService.SHOW_SURFACE_ALLOC; -import static com.android.server.wm.WindowManagerService.DEBUG_SURFACE_TRACE; -import static com.android.server.wm.WindowManagerService.HIDE_STACK_CRAWLS; -import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SURFACE_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.HIDE_STACK_CRAWLS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.graphics.Point; import android.graphics.PointF; @@ -41,7 +43,7 @@ import java.io.PrintWriter; import java.util.ArrayList; class WindowSurfaceController { - static final String TAG = "WindowSurfaceController"; + static final String TAG = TAG_WITH_CLASS_NAME ? "WindowSurfaceController" : TAG_WM; final WindowStateAnimator mAnimator; @@ -392,7 +394,7 @@ class WindowSurfaceController { } static class SurfaceTrace extends SurfaceControl { - private final static String SURFACE_TAG = "SurfaceTrace"; + private final static String SURFACE_TAG = TAG_WITH_CLASS_NAME ? "SurfaceTrace" : TAG_WM; private final static boolean LOG_SURFACE_TRACE = DEBUG_SURFACE_TRACE; final static ArrayList<SurfaceTrace> sSurfaces = new ArrayList<SurfaceTrace>(); diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java index 3ae3be5955dc..50153fa7a11d 100644 --- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java +++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java @@ -15,24 +15,24 @@ import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; -import static com.android.server.wm.WindowManagerService.DEBUG; -import static com.android.server.wm.WindowManagerService.DEBUG_ADD_REMOVE; -import static com.android.server.wm.WindowManagerService.DEBUG_APP_TRANSITIONS; -import static com.android.server.wm.WindowManagerService.DEBUG_LAYOUT; -import static com.android.server.wm.WindowManagerService.DEBUG_LAYOUT_REPEATS; -import static com.android.server.wm.WindowManagerService.DEBUG_ORIENTATION; -import static com.android.server.wm.WindowManagerService.DEBUG_POWER; -import static com.android.server.wm.WindowManagerService.DEBUG_STARTING_WINDOW; -import static com.android.server.wm.WindowManagerService.DEBUG_TOKEN_MOVEMENT; -import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY; -import static com.android.server.wm.WindowManagerService.DEBUG_WALLPAPER_LIGHT; -import static com.android.server.wm.WindowManagerService.DEBUG_WINDOW_TRACE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_POWER; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TOKEN_MOVEMENT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE; import static com.android.server.wm.WindowManagerService.H.*; import static com.android.server.wm.WindowManagerService.LAYOUT_REPEAT_THRESHOLD; import static com.android.server.wm.WindowManagerService.MAX_ANIMATION_DURATION; -import static com.android.server.wm.WindowManagerService.SHOW_LIGHT_TRANSACTIONS; -import static com.android.server.wm.WindowManagerService.SHOW_TRANSACTIONS; -import static com.android.server.wm.WindowManagerService.TAG; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_PLACING_SURFACES; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES; import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_NONE; @@ -153,7 +153,7 @@ class WindowSurfacePlacer { if (DEBUG) { throw new RuntimeException("Recursive call!"); } - Slog.w(TAG, "performLayoutAndPlaceSurfacesLocked called while in layout. Callers=" + Slog.w(TAG_WM, "performLayoutAndPlaceSurfacesLocked called while in layout. Callers=" + Debug.getCallers(3)); return; } @@ -179,10 +179,10 @@ class WindowSurfacePlacer { // Wait a little bit for things to settle down, and off we go. while (!mService.mForceRemoves.isEmpty()) { WindowState ws = mService.mForceRemoves.remove(0); - Slog.i(TAG, "Force removing: " + ws); + Slog.i(TAG_WM, "Force removing: " + ws); mService.removeWindowInnerLocked(ws); } - Slog.w(TAG, + Slog.w(TAG_WM, "Due to memory failure, waiting a bit for next layout"); Object tmp = new Object(); synchronized (tmp) { @@ -202,7 +202,7 @@ class WindowSurfacePlacer { if (++mLayoutRepeatCount < 6) { requestTraversal(); } else { - Slog.e(TAG, "Performed 6 layouts in a row. Skipping"); + Slog.e(TAG_WM, "Performed 6 layouts in a row. Skipping"); mLayoutRepeatCount = 0; } } else { @@ -215,7 +215,7 @@ class WindowSurfacePlacer { } } catch (RuntimeException e) { mInLayout = false; - Slog.wtf(TAG, "Unhandled exception while laying out windows", e); + Slog.wtf(TAG_WM, "Unhandled exception while laying out windows", e); } Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); @@ -223,7 +223,7 @@ class WindowSurfacePlacer { void debugLayoutRepeats(final String msg, int pendingLayoutChanges) { if (mLayoutRepeatCount >= LAYOUT_REPEAT_THRESHOLD) { - Slog.v(TAG, "Layouts looping: " + msg + + Slog.v(TAG_WM, "Layouts looping: " + msg + ", mPendingLayoutChanges = 0x" + Integer.toHexString(pendingLayoutChanges)); } } @@ -231,7 +231,7 @@ class WindowSurfacePlacer { // "Something has changed! Let's make it correct now." private void performSurfacePlacementInner(boolean recoveringMemory) { if (DEBUG_WINDOW_TRACE) { - Slog.v(TAG, + Slog.v(TAG_WM, "performSurfacePlacementInner: entry. Called by " + Debug.getCallers(3)); } @@ -276,16 +276,16 @@ class WindowSurfacePlacer { final int defaultDw = defaultInfo.logicalWidth; final int defaultDh = defaultInfo.logicalHeight; - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, ">>> OPEN TRANSACTION performLayoutAndPlaceSurfaces"); SurfaceControl.openTransaction(); try { applySurfaceChangesTransaction(recoveringMemory, numDisplays, defaultDw, defaultDh); } catch (RuntimeException e) { - Slog.wtf(TAG, "Unhandled exception in Window Manager", e); + Slog.wtf(TAG_WM, "Unhandled exception in Window Manager", e); } finally { SurfaceControl.closeTransaction(); - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, "<<< CLOSE TRANSACTION performLayoutAndPlaceSurfaces"); } @@ -332,7 +332,7 @@ class WindowSurfacePlacer { if (mWallpaperMayChange) { if (DEBUG_WALLPAPER_LIGHT) - Slog.v(TAG, "Wallpaper may change! Adjusting"); + Slog.v(TAG_WM, "Wallpaper may change! Adjusting"); defaultDisplay.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; if (DEBUG_LAYOUT_REPEATS) debugLayoutRepeats("WallpaperMayChange", defaultDisplay.pendingLayoutChanges); @@ -368,7 +368,7 @@ class WindowSurfacePlacer { } if (DEBUG_ORIENTATION && mService.mDisplayFrozen) - Slog.v(TAG, + Slog.v(TAG_WM, "With display frozen, orientationChangeComplete=" + mOrientationChangeComplete); if (mOrientationChangeComplete) { @@ -429,7 +429,7 @@ class WindowSurfacePlacer { token.mAppAnimator.clearAnimation(); token.mAppAnimator.animating = false; if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) - Slog.v(TAG, + Slog.v(TAG_WM, "performLayout: App token exiting now removed" + token); token.removeAppFromTaskLocked(); } @@ -475,7 +475,7 @@ class WindowSurfacePlacer { || Settings.Global.getInt(mService.mContext.getContentResolver(), Settings.Global.THEATER_MODE_ON, 0) == 0) { if (DEBUG_VISIBILITY || DEBUG_POWER) { - Slog.v(TAG, "Turning screen on after layout!"); + Slog.v(TAG_WM, "Turning screen on after layout!"); } mService.mPowerManager.wakeUp(SystemClock.uptimeMillis(), "android.server.wm:TURN_ON"); @@ -484,7 +484,7 @@ class WindowSurfacePlacer { } if (mUpdateRotation) { - if (DEBUG_ORIENTATION) Slog.d(TAG, + if (DEBUG_ORIENTATION) Slog.d(TAG_WM, "Performing post-rotate rotation"); if (mService.updateRotationUncheckedLocked(false)) { mService.mH.sendEmptyMessage(SEND_NEW_CONFIGURATION); @@ -538,7 +538,7 @@ class WindowSurfacePlacer { mService.scheduleAnimationLocked(); - if (DEBUG_WINDOW_TRACE) Slog.e(TAG, + if (DEBUG_WINDOW_TRACE) Slog.e(TAG_WM, "performSurfacePlacementInner exit: animating=" + mService.mAnimator.isAnimating()); } @@ -582,7 +582,7 @@ class WindowSurfacePlacer { do { repeats++; if (repeats > 6) { - Slog.w(TAG, "Animation repeat aborted after too many iterations"); + Slog.w(TAG_WM, "Animation repeat aborted after too many iterations"); displayContent.layoutNeeded = false; break; } @@ -598,7 +598,7 @@ class WindowSurfacePlacer { if (isDefaultDisplay && (displayContent.pendingLayoutChanges & FINISH_LAYOUT_REDO_CONFIG) != 0) { - if (DEBUG_LAYOUT) Slog.v(TAG, "Computing new config from layout"); + if (DEBUG_LAYOUT) Slog.v(TAG_WM, "Computing new config from layout"); if (mService.updateOrientationFromAppTokensLocked(true)) { displayContent.layoutNeeded = true; mService.mH.sendEmptyMessage(SEND_NEW_CONFIGURATION); @@ -614,7 +614,7 @@ class WindowSurfacePlacer { performLayoutLockedInner(displayContent, repeats == 1, false /* updateInputWindows */); } else { - Slog.w(TAG, "Layout repeat skipped after too many iterations"); + Slog.w(TAG_WM, "Layout repeat skipped after too many iterations"); } // FIRST AND ONE HALF LOOP: Make WindowManagerPolicy think @@ -700,7 +700,7 @@ class WindowSurfacePlacer { } } - //Slog.i(TAG, "Window " + this + " clearing mContentChanged - done placing"); + //Slog.i(TAG_WM, "Window " + this + " clearing mContentChanged - done placing"); w.mContentChanged = false; // Moved from updateWindowsAndWallpaperLocked(). @@ -722,7 +722,7 @@ class WindowSurfacePlacer { } if ((w.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0) { if (DEBUG_WALLPAPER_LIGHT) - Slog.v(TAG, "First draw done in potential wallpaper target " + w); + Slog.v(TAG_WM, "First draw done in potential wallpaper target " + w); mWallpaperMayChange = true; displayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; if (DEBUG_LAYOUT_REPEATS) { @@ -743,7 +743,7 @@ class WindowSurfacePlacer { final AppWindowToken atoken = w.mAppToken; if (DEBUG_STARTING_WINDOW && atoken != null && w == atoken.startingWindow) { - Slog.d(TAG, "updateWindows: starting " + w + Slog.d(TAG_WM, "updateWindows: starting " + w + " isOnScreen=" + w.isOnScreen() + " allDrawn=" + atoken.allDrawn + " freezingScreen=" + atoken.mAppAnimator.freezingScreen); } @@ -757,11 +757,11 @@ class WindowSurfacePlacer { || winAnimator.mAttrType == TYPE_BASE_APPLICATION) && !w.mExiting && !w.mDestroying) { if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) { - Slog.v(TAG, "Eval win " + w + ": isDrawn=" + Slog.v(TAG_WM, "Eval win " + w + ": isDrawn=" + w.isDrawnLw() + ", isAnimating=" + winAnimator.isAnimating()); if (!w.isDrawnLw()) { - Slog.v(TAG, "Not displayed: s=" + Slog.v(TAG_WM, "Not displayed: s=" + winAnimator.mSurfaceController + " pv=" + w.mPolicyVisibility + " mDrawState=" + winAnimator.drawStateToString() @@ -776,7 +776,7 @@ class WindowSurfacePlacer { if (w.isDrawnLw()) { atoken.numDrawnWindows++; if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) - Slog.v(TAG, "tokenMayBeDrawn: " + atoken + Slog.v(TAG_WM, "tokenMayBeDrawn: " + atoken + " freezingScreen=" + atoken.mAppAnimator.freezingScreen + " mAppFreezing=" + w.mAppFreezing); @@ -844,8 +844,8 @@ class WindowSurfacePlacer { int i; if (DEBUG_LAYOUT) { - Slog.v(TAG, "-------------------------------------"); - Slog.v(TAG, "performLayout: needed=" + Slog.v(TAG_WM, "-------------------------------------"); + Slog.v(TAG_WM, "performLayout: needed=" + displayContent.layoutNeeded + " dw=" + dw + " dh=" + dh); } @@ -878,18 +878,18 @@ class WindowSurfacePlacer { || win.isGoneForLayoutLw(); if (DEBUG_LAYOUT && !win.mLayoutAttached) { - Slog.v(TAG, "1ST PASS " + win + Slog.v(TAG_WM, "1ST PASS " + win + ": gone=" + gone + " mHaveFrame=" + win.mHaveFrame + " mLayoutAttached=" + win.mLayoutAttached + " screen changed=" + win.isConfigChanged()); final AppWindowToken atoken = win.mAppToken; - if (gone) Slog.v(TAG, " GONE: mViewVisibility=" + if (gone) Slog.v(TAG_WM, " GONE: mViewVisibility=" + win.mViewVisibility + " mRelayoutCalled=" + win.mRelayoutCalled + " hidden=" + win.mRootToken.hidden + " hiddenRequested=" + (atoken != null && atoken.hiddenRequested) + " mAttachedHidden=" + win.mAttachedHidden); - else Slog.v(TAG, " VIS: mViewVisibility=" + else Slog.v(TAG_WM, " VIS: mViewVisibility=" + win.mViewVisibility + " mRelayoutCalled=" + win.mRelayoutCalled + " hidden=" + win.mRootToken.hidden + " hiddenRequested=" @@ -909,7 +909,7 @@ class WindowSurfacePlacer { win.mAppToken.layoutConfigChanges)))) { if (!win.mLayoutAttached) { if (initial) { - //Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial"); + //Slog.i(TAG_WM, "Window " + this + " clearing mContentChanged - initial"); win.mContentChanged = false; } if (win.mAttrs.type == TYPE_DREAM) { @@ -929,7 +929,7 @@ class WindowSurfacePlacer { displayContent.mDimLayerController.updateDimLayer(task); } - if (DEBUG_LAYOUT) Slog.v(TAG, + if (DEBUG_LAYOUT) Slog.v(TAG_WM, " LAYOUT: mFrame=" + win.mFrame + " mContainingFrame=" + win.mContainingFrame + " mDisplayFrame=" @@ -950,7 +950,7 @@ class WindowSurfacePlacer { final WindowState win = windows.get(i); if (win.mLayoutAttached) { - if (DEBUG_LAYOUT) Slog.v(TAG, + if (DEBUG_LAYOUT) Slog.v(TAG_WM, "2ND PASS " + win + " mHaveFrame=" + win.mHaveFrame + " mViewVisibility=" + win.mViewVisibility + " mRelayoutCalled=" + win.mRelayoutCalled); // If this view is GONE, then skip it -- keep the current @@ -964,14 +964,14 @@ class WindowSurfacePlacer { if ((win.mViewVisibility != View.GONE && win.mRelayoutCalled) || !win.mHaveFrame || win.mLayoutNeeded) { if (initial) { - //Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial"); + //Slog.i(TAG_WM, "Window " + this + " clearing mContentChanged - initial"); win.mContentChanged = false; } win.mLayoutNeeded = false; win.prelayout(); mService.mPolicy.layoutWindowLw(win, win.mAttachedWindow); win.mLayoutSeq = seq; - if (DEBUG_LAYOUT) Slog.v(TAG, + if (DEBUG_LAYOUT) Slog.v(TAG_WM, " LAYOUT: mFrame=" + win.mFrame + " mContainingFrame=" + win.mContainingFrame + " mDisplayFrame=" + win.mDisplayFrame); } @@ -1002,7 +1002,7 @@ class WindowSurfacePlacer { if (!transitionGoodToGo(appsCount)) { return 0; } - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "**** GOOD TO GO"); + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "**** GOOD TO GO"); int transit = mService.mAppTransition.getAppTransition(); if (mService.mSkipAppTransitionAnimation) { transit = AppTransition.TRANSIT_UNSET; @@ -1094,7 +1094,7 @@ class WindowSurfacePlacer { // example, when this transition is being done behind // the lock screen. if (!mService.mPolicy.allowAppAnimationsLw()) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Animations disallowed by keyguard or dream."); animLp = null; } @@ -1107,7 +1107,7 @@ class WindowSurfacePlacer { for (i = 0; i < appsCount; i++) { AppWindowToken wtoken = mService.mClosingApps.valueAt(i); final AppWindowAnimator appAnimator = wtoken.mAppAnimator; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Now closing app " + wtoken); appAnimator.clearThumbnail(); appAnimator.animation = null; @@ -1147,7 +1147,7 @@ class WindowSurfacePlacer { for (i = 0; i < appsCount; i++) { AppWindowToken wtoken = mService.mOpeningApps.valueAt(i); final AppWindowAnimator appAnimator = wtoken.mAppAnimator; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Now opening app" + wtoken); if (!appAnimator.usingTransferredAnimation) { @@ -1170,14 +1170,14 @@ class WindowSurfacePlacer { for (int j = 0; j < windowsCount; j++) { appAnimator.mAllAppWinAnimators.add(wtoken.allAppWindows.get(j).mWinAnimator); } - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, ">>> OPEN TRANSACTION handleAppTransitionReadyLocked()"); SurfaceControl.openTransaction(); try { mService.mAnimator.orAnimating(appAnimator.showAllWindowsLocked()); } finally { SurfaceControl.closeTransaction(); - if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, + if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG_WM, "<<< CLOSE TRANSACTION handleAppTransitionReadyLocked()"); } mService.mAnimator.mAppWindowAnimating |= appAnimator.isAnimating(); @@ -1237,14 +1237,14 @@ class WindowSurfacePlacer { } private boolean transitionGoodToGo(int appsCount) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Checking " + appsCount + " opening apps (frozen=" + mService.mDisplayFrozen + " timeout=" + mService.mAppTransition.isTimeout() + ")..."); if (!mService.mAppTransition.isTimeout()) { for (int i = 0; i < appsCount; i++) { AppWindowToken wtoken = mService.mOpeningApps.valueAt(i); - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Check opening app=" + wtoken + ": allDrawn=" + wtoken.allDrawn + " startingDisplayed=" + wtoken.startingDisplayed + " startingMoved=" @@ -1260,7 +1260,7 @@ class WindowSurfacePlacer { // We also need to wait for the specs to be fetched, if needed. if (mService.mAppTransition.isFetchingAppTransitionsSpecs()) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "isFetchingAppTransitionSpecs=true"); + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "isFetchingAppTransitionSpecs=true"); return false; } @@ -1281,7 +1281,7 @@ class WindowSurfacePlacer { ? null : wallpaperTarget; final ArraySet<AppWindowToken> openingApps = mService.mOpeningApps; final ArraySet<AppWindowToken> closingApps = mService.mClosingApps; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "New wallpaper target=" + wallpaperTarget + ", oldWallpaper=" + oldWallpaper + ", lower target=" + lowerWallpaperTarget @@ -1291,7 +1291,7 @@ class WindowSurfacePlacer { mService.mAnimateWallpaperWithTarget = false; if (closingAppHasWallpaper && openingAppHasWallpaper) { if (DEBUG_APP_TRANSITIONS) - Slog.v(TAG, "Wallpaper animation!"); + Slog.v(TAG_WM, "Wallpaper animation!"); switch (transit) { case AppTransition.TRANSIT_ACTIVITY_OPEN: case AppTransition.TRANSIT_TASK_OPEN: @@ -1304,14 +1304,14 @@ class WindowSurfacePlacer { transit = AppTransition.TRANSIT_WALLPAPER_INTRA_CLOSE; break; } - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "New transit: " + AppTransition.appTransitionToString(transit)); } else if (oldWallpaper != null && !mService.mOpeningApps.isEmpty() && !openingApps.contains(oldWallpaper.mAppToken) && closingApps.contains(oldWallpaper.mAppToken)) { // We are transitioning from an activity with a wallpaper to one without. transit = AppTransition.TRANSIT_WALLPAPER_CLOSE; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "New transit away from wallpaper: " + AppTransition.appTransitionToString(transit)); } else if (wallpaperTarget != null && wallpaperTarget.isVisibleLw() && @@ -1319,7 +1319,7 @@ class WindowSurfacePlacer { // We are transitioning from an activity without // a wallpaper to now showing the wallpaper transit = AppTransition.TRANSIT_WALLPAPER_OPEN; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, + if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "New transit into wallpaper: " + AppTransition.appTransitionToString(transit)); } else { @@ -1414,7 +1414,7 @@ class WindowSurfacePlacer { int numInteresting = wtoken.numInterestingWindows; if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) { if (DEBUG_VISIBILITY) - Slog.v(TAG, "allDrawn: " + wtoken + Slog.v(TAG_WM, "allDrawn: " + wtoken + " interesting=" + numInteresting + " drawn=" + wtoken.numDrawnWindows); wtoken.allDrawn = true; @@ -1443,7 +1443,7 @@ class WindowSurfacePlacer { final AppWindowToken wtoken = win.mAppToken; final AppWindowAnimator appAnimator = wtoken.mAppAnimator; if (DEBUG_APP_TRANSITIONS) - Slog.v(TAG, "Now animating app in place " + wtoken); + Slog.v(TAG_WM, "Now animating app in place " + wtoken); appAnimator.clearThumbnail(); appAnimator.animation = null; mService.updateTokenInPlaceLocked(wtoken, transit); @@ -1469,7 +1469,7 @@ class WindowSurfacePlacer { final int taskId = appToken.mTask.mTaskId; Bitmap thumbnailHeader = mService.mAppTransition.getAppTransitionThumbnailHeader(taskId); if (thumbnailHeader == null || thumbnailHeader.getConfig() == Bitmap.Config.ALPHA_8) { - if (DEBUG_APP_TRANSITIONS) Slog.d(TAG, "No thumbnail header bitmap for: " + taskId); + if (DEBUG_APP_TRANSITIONS) Slog.d(TAG_WM, "No thumbnail header bitmap for: " + taskId); return; } // This thumbnail animation is very special, we need to have @@ -1487,7 +1487,7 @@ class WindowSurfacePlacer { PixelFormat.TRANSLUCENT, SurfaceControl.HIDDEN); surfaceControl.setLayerStack(display.getLayerStack()); if (SHOW_TRANSACTIONS) { - Slog.i(TAG, " THUMBNAIL " + surfaceControl + ": CREATE"); + Slog.i(TAG_WM, " THUMBNAIL " + surfaceControl + ": CREATE"); } // Draw the thumbnail onto the surface @@ -1530,7 +1530,7 @@ class WindowSurfacePlacer { openingAppAnimator.thumbnailX = mTmpStartRect.left; openingAppAnimator.thumbnailY = mTmpStartRect.top; } catch (Surface.OutOfResourcesException e) { - Slog.e(TAG, "Can't allocate thumbnail/Canvas surface w=" + Slog.e(TAG_WM, "Can't allocate thumbnail/Canvas surface w=" + dirty.width() + " h=" + dirty.height(), e); openingAppAnimator.clearThumbnail(); } diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java index 4ac91353861e..7894ccfe09a1 100644 --- a/services/core/java/com/android/server/wm/WindowToken.java +++ b/services/core/java/com/android/server/wm/WindowToken.java @@ -16,6 +16,9 @@ package com.android.server.wm; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT; +import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; + import android.os.IBinder; import android.util.Slog; @@ -77,8 +80,7 @@ class WindowToken { void removeAllWindows() { for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) { WindowState win = windows.get(winNdx); - if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) Slog.w(WindowManagerService.TAG, - "removeAllWindows: removing win=" + win); + if (DEBUG_WINDOW_MOVEMENT) Slog.w(TAG_WM, "removeAllWindows: removing win=" + win); win.mService.removeWindowLocked(win); } windows.clear(); @@ -106,4 +108,4 @@ class WindowToken { } return stringName; } -}
\ No newline at end of file +} |