mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Fix NPE / add downX,Y location for all swipes/ add extra debugging info
Bug: 122700646 Bug: 127840207 Change-Id: I5862c8950565df172a933114e1fb2f9c4575593e
This commit is contained in:
@@ -41,7 +41,6 @@ import java.lang.reflect.Modifier;
|
||||
/**
|
||||
* Helper methods for logging.
|
||||
*/
|
||||
@Deprecated
|
||||
public class LoggerUtils {
|
||||
private static final ArrayMap<Class, SparseArray<String>> sNameCache = new ArrayMap<>();
|
||||
private static final String UNKNOWN = "UNKNOWN";
|
||||
@@ -77,10 +76,17 @@ public class LoggerUtils {
|
||||
if (action.touch == Action.Touch.SWIPE || action.touch == Action.Touch.FLING) {
|
||||
str += " direction=" + getFieldName(action.dir, Action.Direction.class);
|
||||
}
|
||||
return str;
|
||||
case Action.Type.COMMAND: return getFieldName(action.command, Action.Command.class);
|
||||
break;
|
||||
case Action.Type.COMMAND:
|
||||
str += getFieldName(action.command, Action.Command.class);
|
||||
break;
|
||||
default: return getFieldName(action.type, Action.Type.class);
|
||||
}
|
||||
if (action.touch == Action.Touch.SWIPE || action.touch == Action.Touch.FLING ||
|
||||
(action.command == Action.Command.BACK && action.dir != Action.Direction.NONE)) {
|
||||
str += " direction=" + getFieldName(action.dir, Action.Direction.class);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static String getTargetStr(Target t) {
|
||||
@@ -102,13 +108,17 @@ public class LoggerUtils {
|
||||
t.containerType == NAVBAR) {
|
||||
str += " id=" + t.pageIndex;
|
||||
} else if (t.containerType == ContainerType.FOLDER) {
|
||||
str += " grid(" + t.gridX + "," + t.gridY+ ")";
|
||||
str += " grid(" + t.gridX + "," + t.gridY + ")";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
str += "UNKNOWN TARGET TYPE";
|
||||
}
|
||||
|
||||
if (t.spanX != 1 || t.spanY != 1) {
|
||||
str += " span(" + t.spanX + "," + t.spanY + ")";
|
||||
}
|
||||
|
||||
if (t.tipType != TipType.DEFAULT_NONE) {
|
||||
str += " " + getFieldName(t.tipType, TipType.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user