diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 8cabf42dadf82..130b440dfbbd1 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -125,6 +125,7 @@ public final class ViewRootImpl implements ViewParent, private static final boolean DEBUG_CONFIGURATION = false || LOCAL_LOGV; private static final boolean DEBUG_FPS = false; private static final boolean DEBUG_INPUT_STAGES = false || LOCAL_LOGV; + private static final boolean DEBUG_KEEP_SCREEN_ON = false || LOCAL_LOGV; /** * Set to false if we do not want to use the multi threaded renderer. Note that by disabling @@ -563,9 +564,10 @@ public final class ViewRootImpl implements ViewParent, attrs = mWindowAttributes; setTag(); - if ((mClientWindowLayoutFlags&WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0 + if (DEBUG_KEEP_SCREEN_ON && (mClientWindowLayoutFlags + & WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0 && (attrs.flags&WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) == 0) { - Slog.d(mTag, "setView: FLAG_KEEP_SCREEN_ON changed from true to false!!!"); + Slog.d(mTag, "setView: FLAG_KEEP_SCREEN_ON changed from true to false!"); } // Keep track of the actual window flags supplied by the client. mClientWindowLayoutFlags = attrs.flags; @@ -894,9 +896,11 @@ public final class ViewRootImpl implements ViewParent, final int oldInsetBottom = mWindowAttributes.surfaceInsets.bottom; final int oldSoftInputMode = mWindowAttributes.softInputMode; final boolean oldHasManualSurfaceInsets = mWindowAttributes.hasManualSurfaceInsets; - if ((mClientWindowLayoutFlags&WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0 + + if (DEBUG_KEEP_SCREEN_ON && (mClientWindowLayoutFlags + & WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0 && (attrs.flags&WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) == 0) { - Slog.d(mTag, "setLayoutParams: FLAG_KEEP_SCREEN_ON from true to false!!!"); + Slog.d(mTag, "setLayoutParams: FLAG_KEEP_SCREEN_ON from true to false!"); } // Keep track of the actual window flags supplied by the client. diff --git a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java index 5d3cc1694e29c..f11281e7692fe 100644 --- a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java +++ b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java @@ -75,5 +75,5 @@ public class WindowManagerDebugConfig { static final boolean DEBUG_WINDOW_CROP = false; static final String TAG_KEEP_SCREEN_ON = "DebugKeepScreenOn"; - static final boolean DEBUG_KEEP_SCREEN_ON = true; + static final boolean DEBUG_KEEP_SCREEN_ON = false; }