Merge "Add more logging and commands to service dump" into ub-launcher3-qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d3b0e8ed61
@@ -22,6 +22,7 @@ import com.android.launcher3.util.Preconditions;
|
||||
import com.android.quickstep.util.RecentsAnimationListenerSet;
|
||||
import com.android.quickstep.util.SwipeAnimationTargetSet;
|
||||
import com.android.quickstep.util.SwipeAnimationTargetSet.SwipeAnimationListener;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* Utility class used to store state information shared across multiple transitions.
|
||||
@@ -134,4 +135,13 @@ public class SwipeSharedState implements SwipeAnimationListener {
|
||||
nextRunningTaskId = -1;
|
||||
goingToLauncher = false;
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "goingToLauncher=" + goingToLauncher);
|
||||
pw.println(prefix + "canGestureBeContinued=" + canGestureBeContinued);
|
||||
pw.println(prefix + "recentsAnimationFinishInterrupted=" + recentsAnimationFinishInterrupted);
|
||||
pw.println(prefix + "nextRunningTaskId=" + nextRunningTaskId);
|
||||
pw.println(prefix + "lastAnimationCancelled=" + mLastAnimationCancelled);
|
||||
pw.println(prefix + "lastAnimationRunning=" + mLastAnimationRunning);
|
||||
}
|
||||
}
|
||||
|
||||
+83
-6
@@ -84,8 +84,31 @@ import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Wrapper around a list for processing arguments.
|
||||
*/
|
||||
class ArgList extends LinkedList<String> {
|
||||
public ArgList(List<String> l) {
|
||||
super(l);
|
||||
}
|
||||
|
||||
public String peekArg() {
|
||||
return peekFirst();
|
||||
}
|
||||
|
||||
public String nextArg() {
|
||||
return pollFirst().toLowerCase();
|
||||
}
|
||||
|
||||
public String nextArgExact() {
|
||||
return pollFirst();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Service connected by system-UI for handling touch interaction.
|
||||
*/
|
||||
@@ -439,12 +462,18 @@ public class TouchInteractionService extends Service implements
|
||||
mUncheckedConsumer.onMotionEvent(event);
|
||||
}
|
||||
|
||||
private boolean validSystemUiFlags() {
|
||||
return (mSystemUiStateFlags & SYSUI_STATE_NAV_BAR_HIDDEN) == 0
|
||||
&& (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) == 0;
|
||||
}
|
||||
|
||||
private boolean topTaskLocked() {
|
||||
return ActivityManagerWrapper.getInstance().isLockToAppActive();
|
||||
}
|
||||
|
||||
private InputConsumer newConsumer(boolean useSharedState, MotionEvent event) {
|
||||
boolean validSystemUIFlags = (mSystemUiStateFlags & SYSUI_STATE_NAV_BAR_HIDDEN) == 0
|
||||
&& (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) == 0;
|
||||
boolean topTaskLocked = ActivityManagerWrapper.getInstance().isLockToAppActive();
|
||||
boolean isInValidSystemUiState = validSystemUIFlags && !topTaskLocked;
|
||||
boolean topTaskLocked = topTaskLocked();
|
||||
boolean isInValidSystemUiState = validSystemUiFlags() && !topTaskLocked;
|
||||
|
||||
if (!mIsUserUnlocked) {
|
||||
if (isInValidSystemUiState) {
|
||||
@@ -540,7 +569,55 @@ public class TouchInteractionService extends Service implements
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
TOUCH_INTERACTION_LOG.dump("", pw);
|
||||
protected void dump(FileDescriptor fd, PrintWriter pw, String[] rawArgs) {
|
||||
if (rawArgs.length > 0 && Utilities.IS_DEBUG_DEVICE) {
|
||||
ArgList args = new ArgList(Arrays.asList(rawArgs));
|
||||
switch (args.nextArg()) {
|
||||
case "cmd":
|
||||
if (args.peekArg() == null) {
|
||||
printAvailableCommands(pw);
|
||||
} else {
|
||||
onCommand(pw, args);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Dump everything
|
||||
pw.println("TouchState:");
|
||||
pw.println(" navMode=" + mMode);
|
||||
pw.println(" validSystemUiFlags=" + validSystemUiFlags()
|
||||
+ " flags=" + mSystemUiStateFlags);
|
||||
pw.println(" topTaskLocked=" + topTaskLocked());
|
||||
pw.println(" isDeviceLocked=" + mKM.isDeviceLocked());
|
||||
pw.println(" screenPinned=" +
|
||||
ActivityManagerWrapper.getInstance().isScreenPinningActive());
|
||||
pw.println(" assistantAvailable=" + mAssistantAvailable);
|
||||
pw.println(" a11yClickable="
|
||||
+ ((mSystemUiStateFlags & SYSUI_STATE_A11Y_BUTTON_CLICKABLE) != 0));
|
||||
pw.println(" a11yLongClickable="
|
||||
+ ((mSystemUiStateFlags & SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE) != 0));
|
||||
pw.println(" resumed="
|
||||
+ mOverviewComponentObserver.getActivityControlHelper().isResumed());
|
||||
pw.println(" useSharedState=" + mConsumer.useSharedSwipeState());
|
||||
if (mConsumer.useSharedSwipeState()) {
|
||||
mSwipeSharedState.dump(" ", pw);
|
||||
}
|
||||
pw.println(" mConsumer=" + mConsumer.getName());
|
||||
TOUCH_INTERACTION_LOG.dump("", pw);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void printAvailableCommands(PrintWriter pw) {
|
||||
pw.println("Available commands:");
|
||||
pw.println(" clear-touch-log: Clears the touch interaction log");
|
||||
}
|
||||
|
||||
private void onCommand(PrintWriter pw, ArgList args) {
|
||||
switch (args.nextArg()) {
|
||||
case "clear-touch-log":
|
||||
TOUCH_INTERACTION_LOG.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+19
@@ -63,4 +63,23 @@ public interface InputConsumer {
|
||||
onKeyEvent((KeyEvent) ev);
|
||||
}
|
||||
}
|
||||
|
||||
default String getName() {
|
||||
switch (getType()) {
|
||||
case TYPE_OVERVIEW:
|
||||
return "OVERVIEW";
|
||||
case TYPE_OTHER_ACTIVITY:
|
||||
return "OTHER_ACTIVITY";
|
||||
case TYPE_ASSISTANT:
|
||||
return "ASSISTANT";
|
||||
case TYPE_DEVICE_LOCKED:
|
||||
return "DEVICE_LOCKED";
|
||||
case TYPE_ACCESSIBILITY:
|
||||
return "ACCESSIBILITY";
|
||||
case TYPE_SCREEN_PINNED:
|
||||
return "SCREEN_PINNED";
|
||||
default:
|
||||
return "NO_OP";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.launcher3.logging;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -76,8 +77,12 @@ public class EventLogArray {
|
||||
nextIndex = (nextIndex + 1) % logs.length;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
Arrays.setAll(logs, (i) -> null);
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
writer.println(prefix + name + " event history:");
|
||||
writer.println(prefix + "EventLog (" + name + ") history:");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(" HH:mm:ss.SSSZ ", Locale.US);
|
||||
Date date = new Date();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user