Merge "Add protolog config as java resource" into sc-dev
This commit is contained in:
@@ -71,27 +71,6 @@ genrule {
|
||||
"$(locations :wm_shell-sources)",
|
||||
out: ["wm_shell_protolog.json"],
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "wm_shell_protolog.json",
|
||||
srcs: ["res/raw/wm_shell_protolog.json"],
|
||||
}
|
||||
|
||||
genrule {
|
||||
name: "checked-wm_shell_protolog.json",
|
||||
srcs: [
|
||||
":generate-wm_shell_protolog.json",
|
||||
":wm_shell_protolog.json",
|
||||
],
|
||||
cmd: "cp $(location :generate-wm_shell_protolog.json) $(out) && " +
|
||||
"{ ! (diff $(out) $(location :wm_shell_protolog.json) | grep -q '^<') || " +
|
||||
"{ echo -e '\\n\\n################################################################\\n#\\n" +
|
||||
"# ERROR: ProtoLog viewer config is stale. To update it, run:\\n#\\n" +
|
||||
"# cp $(location :generate-wm_shell_protolog.json) " +
|
||||
"$(location :wm_shell_protolog.json)\\n#\\n" +
|
||||
"################################################################\\n\\n' >&2 && false; } }",
|
||||
out: ["wm_shell_protolog.json"],
|
||||
}
|
||||
// End ProtoLog
|
||||
|
||||
java_library {
|
||||
@@ -115,6 +94,9 @@ android_library {
|
||||
resource_dirs: [
|
||||
"res",
|
||||
],
|
||||
java_resources: [
|
||||
":generate-wm_shell_protolog.json"
|
||||
],
|
||||
static_libs: [
|
||||
"androidx.appcompat_appcompat",
|
||||
"androidx.arch.core_core-runtime",
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"messages": {
|
||||
"-2076257741": {
|
||||
"message": "Transition requested: %s %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"-1683614271": {
|
||||
"message": "Existing task: id=%d component=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"-1671119352": {
|
||||
"message": " Delegate animation for %s to %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/RemoteTransitionHandler.java"
|
||||
},
|
||||
"-1501874464": {
|
||||
"message": "Fullscreen Task Appeared: #%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/FullscreenTaskListener.java"
|
||||
},
|
||||
"-1382704050": {
|
||||
"message": "Display removed: %d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragAndDropController.java"
|
||||
},
|
||||
"-1362429294": {
|
||||
"message": "%s onTaskAppeared Primary taskId=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/legacysplitscreen\/LegacySplitScreenTaskListener.java"
|
||||
},
|
||||
"-1340279385": {
|
||||
"message": "Remove listener=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"-1325223370": {
|
||||
"message": "Task appeared taskId=%d listener=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"-1312360667": {
|
||||
"message": "createRootTask() displayId=%d winMode=%d listener=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"-1308483871": {
|
||||
"message": " try handler %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"-1297259344": {
|
||||
"message": " animated by %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"-1269886472": {
|
||||
"message": "Transition %s doesn't have explicit remote, search filters for match for %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/RemoteTransitionHandler.java"
|
||||
},
|
||||
"-1006733970": {
|
||||
"message": "Display added: %d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragAndDropController.java"
|
||||
},
|
||||
"-1000962629": {
|
||||
"message": "Animate bounds: from=%s to=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DropOutlineDrawable.java"
|
||||
},
|
||||
"-880817403": {
|
||||
"message": "Task vanished taskId=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"-742394458": {
|
||||
"message": "pair task1=%d task2=%d in AppPair=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/apppairs\/AppPair.java"
|
||||
},
|
||||
"-710770147": {
|
||||
"message": "Add target: %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragLayout.java"
|
||||
},
|
||||
"-298656957": {
|
||||
"message": "%s onTaskAppeared unknown taskId=%d winMode=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/legacysplitscreen\/LegacySplitScreenTaskListener.java"
|
||||
},
|
||||
"-234284913": {
|
||||
"message": "unpair taskId=%d pair=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/apppairs\/AppPairsController.java"
|
||||
},
|
||||
"138343607": {
|
||||
"message": " try firstHandler %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"157713005": {
|
||||
"message": "Task info changed taskId=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"214412327": {
|
||||
"message": "RemoteTransition directly requested for %s: %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/RemoteTransitionHandler.java"
|
||||
},
|
||||
"274140888": {
|
||||
"message": "Animate alpha: from=%d to=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DropOutlineDrawable.java"
|
||||
},
|
||||
"325110414": {
|
||||
"message": "Transition animations finished, notifying core %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"375908576": {
|
||||
"message": "Clip description: handlingDrag=%b itemCount=%d mimeTypes=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragAndDropController.java"
|
||||
},
|
||||
"410592459": {
|
||||
"message": "Invalid root leash (%s): %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"473543554": {
|
||||
"message": "%s onTaskAppeared Supported",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/legacysplitscreen\/LegacySplitScreenTaskListener.java"
|
||||
},
|
||||
"481673835": {
|
||||
"message": "addListenerForTaskId taskId=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"564235578": {
|
||||
"message": "Fullscreen Task Vanished: #%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/FullscreenTaskListener.java"
|
||||
},
|
||||
"580605218": {
|
||||
"message": "Registering organizer",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"707170340": {
|
||||
"message": " animated by firstHandler",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"900599280": {
|
||||
"message": "Can't pair unresizeable tasks task1.isResizeable=%b task1.isResizeable=%b",
|
||||
"level": "ERROR",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/apppairs\/AppPair.java"
|
||||
},
|
||||
"950299522": {
|
||||
"message": "taskId %d isn't isn't in an app-pair.",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/apppairs\/AppPairsController.java"
|
||||
},
|
||||
"980952660": {
|
||||
"message": "Task root back pressed taskId=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"982027396": {
|
||||
"message": "%s onTaskAppeared Secondary taskId=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/legacysplitscreen\/LegacySplitScreenTaskListener.java"
|
||||
},
|
||||
"990371881": {
|
||||
"message": " Checking filter %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/RemoteTransitionHandler.java"
|
||||
},
|
||||
"1070270131": {
|
||||
"message": "onTransitionReady %s: %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TRANSITIONS",
|
||||
"at": "com\/android\/wm\/shell\/transition\/Transitions.java"
|
||||
},
|
||||
"1079041527": {
|
||||
"message": "incrementPool size=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/apppairs\/AppPairsPool.java"
|
||||
},
|
||||
"1184615936": {
|
||||
"message": "Set drop target window visibility: displayId=%d visibility=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragAndDropController.java"
|
||||
},
|
||||
"1481772149": {
|
||||
"message": "Current target: %s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragLayout.java"
|
||||
},
|
||||
"1862198614": {
|
||||
"message": "Drag event: action=%s x=%f y=%f xOffset=%f yOffset=%f",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragAndDropController.java"
|
||||
},
|
||||
"1891981945": {
|
||||
"message": "release entry.taskId=%s listener=%s size=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/apppairs\/AppPairsPool.java"
|
||||
},
|
||||
"1990759023": {
|
||||
"message": "addListenerForType types=%s listener=%s",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/ShellTaskOrganizer.java"
|
||||
},
|
||||
"2006473416": {
|
||||
"message": "acquire entry.taskId=%s listener=%s size=%d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_TASK_ORG",
|
||||
"at": "com\/android\/wm\/shell\/apppairs\/AppPairsPool.java"
|
||||
},
|
||||
"2057038970": {
|
||||
"message": "Display changed: %d",
|
||||
"level": "VERBOSE",
|
||||
"group": "WM_SHELL_DRAG_AND_DROP",
|
||||
"at": "com\/android\/wm\/shell\/draganddrop\/DragAndDropController.java"
|
||||
}
|
||||
},
|
||||
"groups": {
|
||||
"WM_SHELL_DRAG_AND_DROP": {
|
||||
"tag": "WindowManagerShell"
|
||||
},
|
||||
"WM_SHELL_TASK_ORG": {
|
||||
"tag": "WindowManagerShell"
|
||||
},
|
||||
"WM_SHELL_TRANSITIONS": {
|
||||
"tag": "WindowManagerShell"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,9 @@ import com.android.internal.protolog.common.IProtoLogGroup;
|
||||
public enum ShellProtoLogGroup implements IProtoLogGroup {
|
||||
// NOTE: Since we enable these from the same WM ShellCommand, these names should not conflict
|
||||
// with those in the framework ProtoLogGroup
|
||||
WM_SHELL_TASK_ORG(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
|
||||
WM_SHELL_TASK_ORG(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
|
||||
Consts.TAG_WM_SHELL),
|
||||
WM_SHELL_TRANSITIONS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
|
||||
WM_SHELL_TRANSITIONS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
|
||||
Consts.TAG_WM_SHELL),
|
||||
WM_SHELL_DRAG_AND_DROP(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
|
||||
Consts.TAG_WM_SHELL),
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.android.wm.shell.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import org.json.JSONException;
|
||||
@@ -109,10 +110,10 @@ public class ShellProtoLogImpl extends BaseProtoLogImpl {
|
||||
return sServiceInstance;
|
||||
}
|
||||
|
||||
public int startTextLogging(Context context, String[] groups, PrintWriter pw) {
|
||||
try {
|
||||
mViewerConfig.loadViewerConfig(
|
||||
context.getResources().openRawResource(R.raw.wm_shell_protolog));
|
||||
public int startTextLogging(String[] groups, PrintWriter pw) {
|
||||
try (InputStream is =
|
||||
getClass().getClassLoader().getResourceAsStream("wm_shell_protolog.json")){
|
||||
mViewerConfig.loadViewerConfig(is);
|
||||
return setLogging(true /* setTextLogging */, true, pw, groups);
|
||||
} catch (IOException e) {
|
||||
Log.i(TAG, "Unable to load log definitions: IOException while reading "
|
||||
|
||||
@@ -194,6 +194,5 @@ android_app {
|
||||
dxflags: ["--multi-dex"],
|
||||
required: [
|
||||
"privapp_whitelist_com.android.systemui",
|
||||
"checked-wm_shell_protolog.json",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ public final class WMShell extends SystemUI
|
||||
switch (args[i]) {
|
||||
case "enable-text": {
|
||||
String[] groups = Arrays.copyOfRange(args, i + 1, args.length);
|
||||
int result = protoLogImpl.startTextLogging(mContext, groups, pw);
|
||||
int result = protoLogImpl.startTextLogging(groups, pw);
|
||||
if (result == 0) {
|
||||
pw.println("Starting logging on groups: " + Arrays.toString(groups));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user