Add logging to quickstep onboarding tips.
Bug: 79391686
Test: N/A
Change-Id: Ic899ff09d7f911b8eeb31827c558eec53edde3a9
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsOnboarding.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsOnboarding.java
index 368fa67..ff0c11d 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsOnboarding.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsOnboarding.java
@@ -47,6 +47,7 @@
import android.os.SystemProperties;
import android.os.UserManager;
import android.os.RemoteException;
+import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.LayoutInflater;
@@ -65,6 +66,7 @@
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import java.io.PrintWriter;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -223,12 +225,15 @@
= new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {
+ Log.d(TAG, "View attached");
if (view == mLayout) {
mContext.registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
mLayoutAttachedToWindow = true;
if (view.getTag().equals(R.string.recents_swipe_up_onboarding)) {
+ Log.d(TAG, "recents_swipe_up_onboarding tip attached");
mHasDismissedSwipeUpTip = false;
} else {
+ Log.d(TAG, "recents_quick_scrub_onboarding tip attached");
mHasDismissedQuickScrubTip = false;
}
}
@@ -236,9 +241,11 @@
@Override
public void onViewDetachedFromWindow(View view) {
+ Log.d(TAG, "View detached");
if (view == mLayout) {
mLayoutAttachedToWindow = false;
if (view.getTag().equals(R.string.recents_quick_scrub_onboarding)) {
+ Log.d(TAG, "recents_quick_scrub_onboarding tip detached");
mHasDismissedQuickScrubTip = true;
if (hasDismissedQuickScrubOnboardingOnce()) {
// If user dismisses the quick scrub tip twice, we consider user has seen it
@@ -321,22 +328,29 @@
return;
}
+ Log.d(TAG, "Connecting to launcher");
if (!mOverviewProxyListenerRegistered) {
+ Log.d(TAG, "Registering mOverviewProxyListener");
mOverviewProxyService.addCallback(mOverviewProxyListener);
mOverviewProxyListenerRegistered = true;
}
if (!mTaskListenerRegistered) {
+ Log.d(TAG, "Registering mTaskListener");
ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskListener);
mTaskListenerRegistered = true;
}
}
public void onDisconnectedFromLauncher() {
+ Log.d(TAG, "Disconnecting to launcher");
+
if (mOverviewProxyListenerRegistered) {
+ Log.d(TAG, "Unregistering mOverviewProxyListener");
mOverviewProxyService.removeCallback(mOverviewProxyListener);
mOverviewProxyListenerRegistered = false;
}
if (mTaskListenerRegistered) {
+ Log.d(TAG, "Unregistering mTaskListener");
ActivityManagerWrapper.getInstance().unregisterTaskStackListener(mTaskListener);
mTaskListenerRegistered = false;
}
@@ -364,6 +378,8 @@
// Only show in portrait.
int orientation = mContext.getResources().getConfiguration().orientation;
if (!mLayoutAttachedToWindow && orientation == Configuration.ORIENTATION_PORTRAIT) {
+ Log.d(TAG, "Show " + (stringRes == R.string.recents_swipe_up_onboarding
+ ? "recents_swipe_up_onboarding" : "recents_quick_scrub_onboarding") + " tip");
mLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
mWindowManager.addView(mLayout, getWindowLayoutParams());
@@ -392,6 +408,7 @@
public void hide(boolean animate) {
if (mLayoutAttachedToWindow) {
+ Log.d(TAG, "Hide tip, animated: " + animate);
if (animate) {
mLayout.animate()
.alpha(0f)
@@ -412,6 +429,24 @@
mNavBarHeight = navBarHeight;
}
+ public void dump(PrintWriter pw) {
+ pw.println("RecentsOnboarding {");
+ pw.println(" mTaskListenerRegistered: " + mTaskListenerRegistered);
+ pw.println(" mOverviewProxyListenerRegistered: " + mOverviewProxyListenerRegistered);
+ pw.println(" mLayoutAttachedToWindow: " + mLayoutAttachedToWindow);
+ pw.println(" mHasDismissedSwipeUpTip: " + mHasDismissedSwipeUpTip);
+ pw.println(" mHasDismissedQuickScrubTip: " + mHasDismissedQuickScrubTip);
+ pw.println(" mNumAppsLaunchedSinceSwipeUpTipDismiss: "
+ + mNumAppsLaunchedSinceSwipeUpTipDismiss);
+ pw.println(" hasSeenSwipeUpOnboarding: " + hasSeenSwipeUpOnboarding());
+ pw.println(" hasSeenQuickScrubOnboarding: " + hasSeenQuickScrubOnboarding());
+ pw.println(" hasDismissedQuickScrubOnboardingOnce: "
+ + hasDismissedQuickScrubOnboardingOnce());
+ pw.println(" getOpenedOverviewCount: " + getOpenedOverviewCount());
+ pw.println(" getOpenedOverviewFromHomeCount: " + getOpenedOverviewFromHomeCount());
+ pw.println(" }");
+ }
+
private WindowManager.LayoutParams getWindowLayoutParams() {
int flags = WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
@@ -433,6 +468,7 @@
}
private void setHasSeenSwipeUpOnboarding(boolean hasSeenSwipeUpOnboarding) {
+ Log.d(TAG, "setHasSeenSwipeUpOnboarding: " + hasSeenSwipeUpOnboarding);
Prefs.putBoolean(mContext, HAS_SEEN_RECENTS_SWIPE_UP_ONBOARDING, hasSeenSwipeUpOnboarding);
if (hasSeenSwipeUpOnboarding && hasSeenQuickScrubOnboarding()) {
onDisconnectedFromLauncher();
@@ -444,6 +480,7 @@
}
private void setHasSeenQuickScrubOnboarding(boolean hasSeenQuickScrubOnboarding) {
+ Log.d(TAG, "setHasSeenQuickScrubOnboarding: " + hasSeenQuickScrubOnboarding);
Prefs.putBoolean(mContext, HAS_SEEN_RECENTS_QUICK_SCRUB_ONBOARDING,
hasSeenQuickScrubOnboarding);
if (hasSeenQuickScrubOnboarding && hasSeenSwipeUpOnboarding()) {
@@ -457,6 +494,8 @@
private void setHasDismissedQuickScrubOnboardingOnce(
boolean hasDismissedQuickScrubOnboardingOnce) {
+ Log.d(TAG,
+ "setHasDismissedQuickScrubOnboardingOnce: " + hasDismissedQuickScrubOnboardingOnce);
Prefs.putBoolean(mContext, HAS_DISMISSED_RECENTS_QUICK_SCRUB_ONBOARDING_ONCE,
hasDismissedQuickScrubOnboardingOnce);
}
@@ -466,6 +505,7 @@
}
private void setOpenedOverviewFromHomeCount(int openedOverviewFromHomeCount) {
+ Log.d(TAG, "setOpenedOverviewFromHomeCount: " + openedOverviewFromHomeCount);
Prefs.putInt(mContext, OVERVIEW_OPENED_FROM_HOME_COUNT, openedOverviewFromHomeCount);
}
@@ -474,6 +514,7 @@
}
private void setOpenedOverviewCount(int openedOverviewCount) {
+ Log.d(TAG, "setOpenedOverviewCount: " + openedOverviewCount);
Prefs.putInt(mContext, OVERVIEW_OPENED_COUNT, openedOverviewCount);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 98f9f1a..28bbf5b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -1177,6 +1177,8 @@
dumpButton(pw, "menu", getMenuButton());
dumpButton(pw, "a11y", getAccessibilityButton());
+ mRecentsOnboarding.dump(pw);
+
pw.println(" }");
}