Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2426514b authored by Alex Chau's avatar Alex Chau
Browse files

Put IDP.getDeviceProfile logging behind a feature flag

- To avoid memory regression in performance testse

Fix: 257359801
Test: manual
Change-Id: I5ed768d90dba149eeb8f7be7d1d229b0b599a485
parent 62b9f80d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
+3 −0
Original line number Diff line number Diff line
@@ -330,6 +330,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) {