Add additional logs when DisplayController detects unexpected bounds
Bug: 283944974 Test: manual Change-Id: I8f50c79e00be0a4be812634678e9e05a80343a07 Merged-In: I8f50c79e00be0a4be812634678e9e05a80343a07
This commit is contained in:
@@ -67,6 +67,26 @@ public final class FileLog {
|
|||||||
print(tag, msg);
|
print(tag, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void i(String tag, String msg, Exception e) {
|
||||||
|
Log.i(tag, msg, e);
|
||||||
|
print(tag, msg, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void i(String tag, String msg) {
|
||||||
|
Log.i(tag, msg);
|
||||||
|
print(tag, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void w(String tag, String msg, Exception e) {
|
||||||
|
Log.w(tag, msg, e);
|
||||||
|
print(tag, msg, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void w(String tag, String msg) {
|
||||||
|
Log.w(tag, msg);
|
||||||
|
print(tag, msg);
|
||||||
|
}
|
||||||
|
|
||||||
public static void e(String tag, String msg, Exception e) {
|
public static void e(String tag, String msg, Exception e) {
|
||||||
Log.e(tag, msg, e);
|
Log.e(tag, msg, e);
|
||||||
print(tag, msg, e);
|
print(tag, msg, e);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import androidx.annotation.VisibleForTesting;
|
|||||||
|
|
||||||
import com.android.launcher3.LauncherPrefs;
|
import com.android.launcher3.LauncherPrefs;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
|
import com.android.launcher3.logging.FileLog;
|
||||||
import com.android.launcher3.util.window.CachedDisplayInfo;
|
import com.android.launcher3.util.window.CachedDisplayInfo;
|
||||||
import com.android.launcher3.util.window.WindowManagerProxy;
|
import com.android.launcher3.util.window.WindowManagerProxy;
|
||||||
|
|
||||||
@@ -126,6 +127,8 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
|
|||||||
Context displayInfoContext = getDisplayInfoContext(display);
|
Context displayInfoContext = getDisplayInfoContext(display);
|
||||||
mInfo = new Info(displayInfoContext, wmProxy,
|
mInfo = new Info(displayInfoContext, wmProxy,
|
||||||
wmProxy.estimateInternalDisplayBounds(displayInfoContext));
|
wmProxy.estimateInternalDisplayBounds(displayInfoContext));
|
||||||
|
mInfo.mPerDisplayBounds.forEach((key, value) -> FileLog.i(TAG,
|
||||||
|
"(CTOR) perDisplayBounds - " + key + ": " + Arrays.deepToString(value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -283,6 +286,9 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
|
|||||||
if (!newInfo.supportedBounds.equals(oldInfo.supportedBounds)
|
if (!newInfo.supportedBounds.equals(oldInfo.supportedBounds)
|
||||||
|| !newInfo.mPerDisplayBounds.equals(oldInfo.mPerDisplayBounds)) {
|
|| !newInfo.mPerDisplayBounds.equals(oldInfo.mPerDisplayBounds)) {
|
||||||
change |= CHANGE_SUPPORTED_BOUNDS;
|
change |= CHANGE_SUPPORTED_BOUNDS;
|
||||||
|
newInfo.mPerDisplayBounds.forEach((key, value) -> FileLog.w(TAG,
|
||||||
|
"(CHANGE_SUPPORTED_BOUNDS) perDisplayBounds - " + key + ": "
|
||||||
|
+ Arrays.deepToString(value)));
|
||||||
}
|
}
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "handleInfoChange - change: " + getChangeFlagsString(change));
|
Log.d(TAG, "handleInfoChange - change: " + getChangeFlagsString(change));
|
||||||
@@ -353,12 +359,16 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
|
|||||||
realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
|
realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
|
||||||
if (cachedValue == null) {
|
if (cachedValue == null) {
|
||||||
// Unexpected normalizedDisplayInfo is found, recreate the cache
|
// Unexpected normalizedDisplayInfo is found, recreate the cache
|
||||||
Log.e(TAG, "Unexpected normalizedDisplayInfo found, invalidating cache");
|
FileLog.e(TAG, "Unexpected normalizedDisplayInfo found, invalidating cache: "
|
||||||
|
+ normalizedDisplayInfo);
|
||||||
|
mPerDisplayBounds.forEach((key, value) -> FileLog.e(TAG,
|
||||||
|
"(Invalid Cache) perDisplayBounds - " + key + ": " + Arrays.deepToString(
|
||||||
|
value)));
|
||||||
mPerDisplayBounds.clear();
|
mPerDisplayBounds.clear();
|
||||||
mPerDisplayBounds.putAll(wmProxy.estimateInternalDisplayBounds(displayInfoContext));
|
mPerDisplayBounds.putAll(wmProxy.estimateInternalDisplayBounds(displayInfoContext));
|
||||||
cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
|
cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
|
||||||
if (cachedValue == null) {
|
if (cachedValue == null) {
|
||||||
Log.e(TAG, "normalizedDisplayInfo not found in estimation: "
|
FileLog.e(TAG, "normalizedDisplayInfo not found in estimation: "
|
||||||
+ normalizedDisplayInfo);
|
+ normalizedDisplayInfo);
|
||||||
supportedBounds.add(realBounds);
|
supportedBounds.add(realBounds);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user