summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Chau <alexchau@google.com>2023-05-25 12:30:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-05-25 12:30:50 +0000
commit4f1602796a9112e42f7b24d562f9de5b39ca5dc7 (patch)
tree7b2baf28366135e4d2592ff416fd469f84dbfb6e /src
parentfe3d51365068f973c826ab49f594c8dcf4cf3307 (diff)
parentff2a8382fc90b4495f58c525e8dd234e750c9b48 (diff)
downloadLauncher3-4f1602796a9112e42f7b24d562f9de5b39ca5dc7.tar.gz
Merge "Add additional logs when DisplayController detects unexpected bounds" into udc-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/logging/FileLog.java20
-rw-r--r--src/com/android/launcher3/util/DisplayController.java14
2 files changed, 32 insertions, 2 deletions
diff --git a/src/com/android/launcher3/logging/FileLog.java b/src/com/android/launcher3/logging/FileLog.java
index cdd0bda49e..924a44062c 100644
--- a/src/com/android/launcher3/logging/FileLog.java
+++ b/src/com/android/launcher3/logging/FileLog.java
@@ -67,6 +67,26 @@ public final class FileLog {
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) {
Log.e(tag, msg, e);
print(tag, msg, e);
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 776fe40f05..6647d0db7c 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -48,6 +48,7 @@ import androidx.annotation.VisibleForTesting;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.Utilities;
+import com.android.launcher3.logging.FileLog;
import com.android.launcher3.util.window.CachedDisplayInfo;
import com.android.launcher3.util.window.WindowManagerProxy;
@@ -126,6 +127,8 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
Context displayInfoContext = getDisplayInfoContext(display);
mInfo = new Info(displayInfoContext, wmProxy,
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)
|| !newInfo.mPerDisplayBounds.equals(oldInfo.mPerDisplayBounds)) {
change |= CHANGE_SUPPORTED_BOUNDS;
+ newInfo.mPerDisplayBounds.forEach((key, value) -> FileLog.w(TAG,
+ "(CHANGE_SUPPORTED_BOUNDS) perDisplayBounds - " + key + ": "
+ + Arrays.deepToString(value)));
}
if (DEBUG) {
Log.d(TAG, "handleInfoChange - change: " + getChangeFlagsString(change));
@@ -353,12 +359,16 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
if (cachedValue == null) {
// 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.putAll(wmProxy.estimateInternalDisplayBounds(displayInfoContext));
cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
if (cachedValue == null) {
- Log.e(TAG, "normalizedDisplayInfo not found in estimation: "
+ FileLog.e(TAG, "normalizedDisplayInfo not found in estimation: "
+ normalizedDisplayInfo);
supportedBounds.add(realBounds);
}