From 573fe8c72b96b8b4c61e2b44685b8b960e2569a2 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Tue, 11 Feb 2025 00:43:18 +0000 Subject: [PATCH] Add logs to components in AllApps to verify click. Adding logs for investigation to verify related bugs where work profile may seem inactive but is supposed to be active. This also helps verify if touch is being received. Bug: 383301695 Test: manually- screenshot in bug Flag: EXEMPT adding logs Change-Id: I9f42d7013c8a127767b5cbcfbe5c416cebb2adbd --- .../allapps/ActivityAllAppsContainerView.java | 3 +++ src/com/android/launcher3/allapps/WorkPausedCard.java | 3 +++ .../android/launcher3/allapps/WorkProfileManager.java | 1 + src/com/android/launcher3/allapps/WorkUtilityView.java | 10 +++++++--- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index b0001af5d3..bc3c5cd6ed 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -116,6 +116,7 @@ public class ActivityAllAppsContainerView ScrimView.ScrimDrawingController { + private static final String TAG = "ActivityAllAppsContainerView"; public static final float PULL_MULTIPLIER = .02f; public static final float FLING_VELOCITY_MULTIPLIER = 1200f; protected static final String BUNDLE_KEY_CURRENT_PAGE = "launcher.allapps.current_page"; @@ -605,6 +606,7 @@ public class ActivityAllAppsContainerView mViewPager.getPageIndicator().setActiveMarker(AdapterHolder.MAIN); findViewById(R.id.tab_personal) .setOnClickListener((View view) -> { + Log.d(TAG, "rebindAdapters: " + "Clicked personal tab."); if (mViewPager.snapToPage(AdapterHolder.MAIN)) { mActivityContext.getStatsLogManager().logger() .log(LAUNCHER_ALLAPPS_TAP_ON_PERSONAL_TAB); @@ -612,6 +614,7 @@ public class ActivityAllAppsContainerView }); findViewById(R.id.tab_work) .setOnClickListener((View view) -> { + Log.d(TAG, "rebindAdapters: " + "Clicked work tab."); if (mViewPager.snapToPage(AdapterHolder.WORK)) { mActivityContext.getStatsLogManager().logger() .log(LAUNCHER_ALLAPPS_TAP_ON_WORK_TAB); diff --git a/src/com/android/launcher3/allapps/WorkPausedCard.java b/src/com/android/launcher3/allapps/WorkPausedCard.java index a14ac9819a..864ede8840 100644 --- a/src/com/android/launcher3/allapps/WorkPausedCard.java +++ b/src/com/android/launcher3/allapps/WorkPausedCard.java @@ -20,6 +20,7 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH import android.content.Context; import android.content.res.Configuration; import android.util.AttributeSet; +import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; @@ -34,6 +35,7 @@ import com.android.launcher3.views.ActivityContext; */ public class WorkPausedCard extends LinearLayout implements View.OnClickListener { + private static final String TAG = "WorkPausedCard"; private final ActivityContext mActivityContext; private Button mBtn; @@ -79,6 +81,7 @@ public class WorkPausedCard extends LinearLayout implements View.OnClickListener @Override public void onClick(View view) { + Log.d(TAG, "WorkPausedCard clicked."); mActivityContext.getAppsView().getWorkManager().setWorkProfileEnabled(true); mActivityContext.getStatsLogManager().logger().log(LAUNCHER_TURN_ON_WORK_APPS_TAP); } diff --git a/src/com/android/launcher3/allapps/WorkProfileManager.java b/src/com/android/launcher3/allapps/WorkProfileManager.java index 6d7d1930fd..920efa4f64 100644 --- a/src/com/android/launcher3/allapps/WorkProfileManager.java +++ b/src/com/android/launcher3/allapps/WorkProfileManager.java @@ -200,6 +200,7 @@ public class WorkProfileManager extends UserProfileManager private void onWorkFabClicked(View view) { if (getCurrentState() == STATE_ENABLED && mWorkUtilityView.isEnabled()) { + Log.d(TAG, "Work FAB clicked."); logEvents(LAUNCHER_TURN_OFF_WORK_APPS_TAP); setWorkProfileEnabled(false); } diff --git a/src/com/android/launcher3/allapps/WorkUtilityView.java b/src/com/android/launcher3/allapps/WorkUtilityView.java index bccc279442..eb8f508ab6 100644 --- a/src/com/android/launcher3/allapps/WorkUtilityView.java +++ b/src/com/android/launcher3/allapps/WorkUtilityView.java @@ -25,6 +25,7 @@ import android.content.Intent; import android.graphics.Rect; import android.text.TextUtils; import android.util.AttributeSet; +import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.WindowInsets; @@ -57,6 +58,7 @@ import java.util.ArrayList; public class WorkUtilityView extends LinearLayout implements Insettable, KeyboardInsetAnimationCallback.KeyboardInsetListener { + private static final String TAG = "WorkUtilityView"; private static final int TEXT_EXPAND_OPACITY_DURATION = 300; private static final int TEXT_COLLAPSE_OPACITY_DURATION = 50; private static final int EXPAND_COLLAPSE_DURATION = 300; @@ -133,9 +135,11 @@ public class WorkUtilityView extends LinearLayout implements Insettable, mSchedulerButton.setOnClickListener(null); if (shouldUseScheduler()) { mSchedulerButton.setVisibility(VISIBLE); - mSchedulerButton.setOnClickListener(view -> - mActivityContext.startActivitySafely(view, - new Intent(mWorkSchedulerIntentAction), null /* itemInfo */)); + mSchedulerButton.setOnClickListener(view -> { + Log.d(TAG, "WorkScheduler button clicked."); + mActivityContext.startActivitySafely(view, + new Intent(mWorkSchedulerIntentAction), null /* itemInfo */); + }); } }