Merge "Add logging to quickstep onboarding tips." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ab2988fd6b
@@ -47,6 +47,7 @@ import android.os.Build;
|
||||
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.recents.misc.SysUiTaskStackChangeListener;
|
||||
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 @@ public class RecentsOnboarding {
|
||||
= 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 @@ public class RecentsOnboarding {
|
||||
|
||||
@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 @@ public class RecentsOnboarding {
|
||||
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 @@ public class RecentsOnboarding {
|
||||
// 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 class RecentsOnboarding {
|
||||
|
||||
public void hide(boolean animate) {
|
||||
if (mLayoutAttachedToWindow) {
|
||||
Log.d(TAG, "Hide tip, animated: " + animate);
|
||||
if (animate) {
|
||||
mLayout.animate()
|
||||
.alpha(0f)
|
||||
@@ -412,6 +429,24 @@ public class RecentsOnboarding {
|
||||
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 @@ public class RecentsOnboarding {
|
||||
}
|
||||
|
||||
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 @@ public class RecentsOnboarding {
|
||||
}
|
||||
|
||||
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 @@ public class RecentsOnboarding {
|
||||
|
||||
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 @@ public class RecentsOnboarding {
|
||||
}
|
||||
|
||||
private void setOpenedOverviewFromHomeCount(int openedOverviewFromHomeCount) {
|
||||
Log.d(TAG, "setOpenedOverviewFromHomeCount: " + openedOverviewFromHomeCount);
|
||||
Prefs.putInt(mContext, OVERVIEW_OPENED_FROM_HOME_COUNT, openedOverviewFromHomeCount);
|
||||
}
|
||||
|
||||
@@ -474,6 +514,7 @@ public class RecentsOnboarding {
|
||||
}
|
||||
|
||||
private void setOpenedOverviewCount(int openedOverviewCount) {
|
||||
Log.d(TAG, "setOpenedOverviewCount: " + openedOverviewCount);
|
||||
Prefs.putInt(mContext, OVERVIEW_OPENED_COUNT, openedOverviewCount);
|
||||
}
|
||||
|
||||
|
||||
@@ -1177,6 +1177,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
|
||||
dumpButton(pw, "menu", getMenuButton());
|
||||
dumpButton(pw, "a11y", getAccessibilityButton());
|
||||
|
||||
mRecentsOnboarding.dump(pw);
|
||||
|
||||
pw.println(" }");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user