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

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

Change-Id: I881889a298e38881781d7a8015790fb6b291d059
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Chau
2022-11-16 19:26:49 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 1 deletions

View File

@@ -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);

View File

@@ -339,6 +339,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) {