Merge "Extending SysUI proto dump to WMShell"
This commit is contained in:
@@ -83,6 +83,16 @@ genrule {
|
||||
}
|
||||
// End ProtoLog
|
||||
|
||||
java_library {
|
||||
name: "WindowManager-Shell-proto",
|
||||
|
||||
srcs: ["proto/*.proto"],
|
||||
|
||||
proto: {
|
||||
type: "nano",
|
||||
},
|
||||
}
|
||||
|
||||
android_library {
|
||||
name: "WindowManager-Shell",
|
||||
srcs: [
|
||||
@@ -94,6 +104,7 @@ android_library {
|
||||
],
|
||||
static_libs: [
|
||||
"protolog-lib",
|
||||
"WindowManager-Shell-proto",
|
||||
],
|
||||
manifest: "AndroidManifest.xml",
|
||||
}
|
||||
27
libs/WindowManager/Shell/proto/wm_shell_trace.proto
Normal file
27
libs/WindowManager/Shell/proto/wm_shell_trace.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
package com.android.wm.shell;
|
||||
|
||||
option java_multiple_files = true;
|
||||
|
||||
message WmShellTraceProto {
|
||||
|
||||
// Not used, just a test value
|
||||
optional bool test_value = 1;
|
||||
}
|
||||
@@ -22,6 +22,10 @@ java_library {
|
||||
proto: {
|
||||
type: "nano",
|
||||
},
|
||||
|
||||
libs: [
|
||||
"WindowManager-Shell-proto",
|
||||
],
|
||||
}
|
||||
|
||||
java_library {
|
||||
|
||||
@@ -584,7 +584,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa
|
||||
}
|
||||
}
|
||||
|
||||
Dependency.get(ProtoTracer.class).update();
|
||||
Dependency.get(ProtoTracer.class).scheduleFrameUpdate();
|
||||
}
|
||||
|
||||
private void updateDisabledForQuickstep() {
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
import "frameworks/base/libs/WindowManager/Shell/proto/wm_shell_trace.proto";
|
||||
|
||||
package com.android.systemui.tracing;
|
||||
|
||||
option java_multiple_files = true;
|
||||
@@ -23,6 +25,7 @@ option java_multiple_files = true;
|
||||
message SystemUiTraceProto {
|
||||
|
||||
optional EdgeBackGestureHandlerProto edge_back_gesture_handler = 1;
|
||||
optional com.android.wm.shell.WmShellTraceProto wm_shell = 2;
|
||||
}
|
||||
|
||||
message EdgeBackGestureHandlerProto {
|
||||
|
||||
@@ -27,8 +27,12 @@ import com.android.systemui.SystemUI;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.shared.system.TaskStackChangeListener;
|
||||
import com.android.systemui.shared.tracing.ProtoTraceable;
|
||||
import com.android.systemui.stackdivider.SplitScreen;
|
||||
import com.android.systemui.tracing.ProtoTracer;
|
||||
import com.android.systemui.tracing.nano.SystemUiTraceProto;
|
||||
import com.android.wm.shell.common.DisplayImeController;
|
||||
import com.android.wm.shell.nano.WmShellTraceProto;
|
||||
import com.android.wm.shell.protolog.ShellProtoLogImpl;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -42,19 +46,23 @@ import javax.inject.Inject;
|
||||
* Proxy in SysUiScope to delegate events to controllers in WM Shell library.
|
||||
*/
|
||||
@SysUISingleton
|
||||
public final class WMShell extends SystemUI {
|
||||
public final class WMShell extends SystemUI implements ProtoTraceable<SystemUiTraceProto> {
|
||||
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
||||
private final DisplayImeController mDisplayImeController;
|
||||
private final Optional<SplitScreen> mSplitScreenOptional;
|
||||
private final ProtoTracer mProtoTracer;
|
||||
|
||||
@Inject
|
||||
WMShell(Context context, KeyguardUpdateMonitor keyguardUpdateMonitor,
|
||||
DisplayImeController displayImeController,
|
||||
Optional<SplitScreen> splitScreenOptional) {
|
||||
Optional<SplitScreen> splitScreenOptional,
|
||||
ProtoTracer protoTracer) {
|
||||
super(context);
|
||||
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
|
||||
mDisplayImeController = displayImeController;
|
||||
mSplitScreenOptional = splitScreenOptional;
|
||||
mProtoTracer = protoTracer;
|
||||
mProtoTracer.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,6 +121,15 @@ public final class WMShell extends SystemUI {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToProto(SystemUiTraceProto proto) {
|
||||
if (proto.wmShell == null) {
|
||||
proto.wmShell = new WmShellTraceProto();
|
||||
}
|
||||
// Dump to WMShell proto here
|
||||
// TODO: Figure out how we want to synchronize while dumping to proto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
// Handle commands if provided
|
||||
|
||||
Reference in New Issue
Block a user