diff options
Diffstat (limited to 'src/com/android/launcher3/util/DisplayController.java')
-rw-r--r-- | src/com/android/launcher3/util/DisplayController.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java index 3d455d8509..a3261b2623 100644 --- a/src/com/android/launcher3/util/DisplayController.java +++ b/src/com/android/launcher3/util/DisplayController.java @@ -23,6 +23,7 @@ import static com.android.launcher3.Utilities.dpiFromPx; import static com.android.launcher3.config.FeatureFlags.ENABLE_TRANSIENT_TASKBAR; import static com.android.launcher3.config.FeatureFlags.FORCE_PERSISTENT_TASKBAR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; +import static com.android.launcher3.util.FlagDebugUtils.appendFlag; import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH; import android.annotation.SuppressLint; @@ -55,6 +56,7 @@ import java.util.Collections; import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.StringJoiner; /** * Utility class to cache properties of default display to avoid a system RPC on every call. @@ -66,6 +68,9 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { private static final boolean DEBUG = false; private static boolean sTransientTaskbarStatusForTests; + // TODO(b/254119092) remove all logs with this tag + public static final String TASKBAR_NOT_DESTROYED_TAG = "b/254119092"; + public static final MainThreadInitializedObject<DisplayController> INSTANCE = new MainThreadInitializedObject<>(DisplayController::new); @@ -206,6 +211,7 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { @Override @TargetApi(Build.VERSION_CODES.S) public final void onConfigurationChanged(Configuration config) { + Log.d(TASKBAR_NOT_DESTROYED_TAG, "DisplayController#onConfigurationChanged: " + config); Display display = mWindowContext.getDisplay(); if (config.densityDpi != mInfo.densityDpi || config.fontScale != mInfo.fontScale @@ -272,7 +278,7 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { change |= CHANGE_SUPPORTED_BOUNDS; } if (DEBUG) { - Log.d(TAG, "handleInfoChange - change: 0b" + Integer.toBinaryString(change)); + Log.d(TAG, "handleInfoChange - change: " + getChangeFlagsString(change)); } if (change != 0) { @@ -392,6 +398,20 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable { } /** + * Returns the given binary flags as a human-readable string. + * @see #CHANGE_ALL + */ + public String getChangeFlagsString(int change) { + StringJoiner result = new StringJoiner("|"); + appendFlag(result, change, CHANGE_ACTIVE_SCREEN, "CHANGE_ACTIVE_SCREEN"); + appendFlag(result, change, CHANGE_ROTATION, "CHANGE_ROTATION"); + appendFlag(result, change, CHANGE_DENSITY, "CHANGE_DENSITY"); + appendFlag(result, change, CHANGE_SUPPORTED_BOUNDS, "CHANGE_SUPPORTED_BOUNDS"); + appendFlag(result, change, CHANGE_NAVIGATION_MODE, "CHANGE_NAVIGATION_MODE"); + return result.toString(); + } + + /** * Dumps the current state information */ public void dump(PrintWriter pw) { |