Temporarily enable screen wakelock logging in WM

Enable DEBUG_KEEP_SCREEN_ON flag to get additional wakelock logs
to investigate b/38416971.

Bug: 38416971
Test: No change in logic
Change-Id: I83c45a26befb6a767b5d9fc30b1cde07a2432ebe
This commit is contained in:
Andrii Kulian
2017-05-26 14:51:47 -07:00
parent 76926df97e
commit efe1b94acd
2 changed files with 9 additions and 3 deletions

View File

@@ -858,14 +858,20 @@ class RootWindowContainer extends WindowContainer<DisplayContent> {
final int privateflags = attrs.privateFlags;
boolean displayHasContent = false;
if (DEBUG_KEEP_SCREEN_ON && (attrFlags & FLAG_KEEP_SCREEN_ON) != 0
&& w != mService.mLastWakeLockHoldingWindow) {
Slog.d(TAG_KEEP_SCREEN_ON, "handleNotObscuredLocked: " + w
+ " has FLAG_KEEP_SCREEN_ON set, hasSurface=" + w.mHasSurface
+ ", canBeSeen=" + canBeSeen);
}
if (w.mHasSurface && canBeSeen) {
if ((attrFlags & FLAG_KEEP_SCREEN_ON) != 0) {
mHoldScreen = w.mSession;
mHoldScreenWindow = w;
} else if (DEBUG_KEEP_SCREEN_ON && w == mService.mLastWakeLockHoldingWindow) {
Slog.d(TAG_KEEP_SCREEN_ON, "handleNotObscuredLocked: " + w + " was holding "
+ "screen wakelock but no longer has FLAG_KEEP_SCREEN_ON!!! called by"
+ Debug.getCallers(10));
+ "screen wakelock but no longer has FLAG_KEEP_SCREEN_ON!!!");
}
if (!syswin && w.mAttrs.screenBrightness >= 0 && mScreenBrightness < 0) {
mScreenBrightness = w.mAttrs.screenBrightness;

View File

@@ -77,5 +77,5 @@ public class WindowManagerDebugConfig {
static final boolean DEBUG_UNKNOWN_APP_VISIBILITY = false;
static final String TAG_KEEP_SCREEN_ON = "DebugKeepScreenOn";
static final boolean DEBUG_KEEP_SCREEN_ON = false;
static final boolean DEBUG_KEEP_SCREEN_ON = true;
}