Merge "Put IDP.getDeviceProfile logging behind a feature flag" into tm-qpr-dev am: 0ea0b898a5 am: b1c09554cf

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20469953

Change-Id: Ie563332849a18f2ed6513dde9b66995ad73fdc84
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Chau
2022-11-16 20:00:27 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 1 deletions
@@ -17,6 +17,7 @@
package com.android.launcher3;
import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.config.FeatureFlags.ENABLE_DEVICE_PROFILE_LOGGING;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TWO_PANEL_HOME;
import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE;
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
@@ -648,7 +649,7 @@ public class InvariantDeviceProfile {
float screenHeight = config.screenHeightDp * res.getDisplayMetrics().density;
int rotation = WindowManagerProxy.INSTANCE.get(context).getRotation(context);
if (Utilities.IS_DEBUG_DEVICE) {
if (Utilities.IS_DEBUG_DEVICE && ENABLE_DEVICE_PROFILE_LOGGING.get()) {
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
DisplayController.INSTANCE.get(context).dump(printWriter);
@@ -347,6 +347,9 @@ public final class FeatureFlags {
public static final BooleanFlag ENABLE_TOAST_IMPRESSION_LOGGING = getDebugFlag(
"ENABLE_TOAST_IMPRESSION_LOGGING", false, "Enable toast impression logging");
public static final BooleanFlag ENABLE_DEVICE_PROFILE_LOGGING = new DeviceFlag(
"ENABLE_DEVICE_PROFILE_LOGGING", false, "Allows DeviceProfile logging");
public static void initialize(Context context) {
synchronized (sDebugFlags) {
for (DebugFlag flag : sDebugFlags) {