自 2026 年起,为了与我们的主干稳定开发模型保持一致,并确保生态系统的平台稳定性,我们将在第 2 季度和第 4 季度将源代码发布到 AOSP。对于构建 AOSP 和向 AOSP 贡献代码,我们建议使用 android-latest-release 而不是 aosp-main。android-latest-release 清单分支将始终引用推送到 AOSP 的最新版本。如需了解详情,请参阅 AOSP 变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HandleViewDebug
public
final
class
HandleViewDebug
extends ChunkHandler
摘要
公共方法 |
static
void
|
captureLayers(ClientImpl client, String viewRoot, DebugViewDumpHandler handler)
|
static
void
|
captureView(Client client, String viewRoot, String view, DebugViewDumpHandler handler)
|
void
|
clientDisconnected(ClientImpl client)
客户端已消失。
|
void
|
clientReady(ClientImpl client)
客户端已准备就绪。
|
static
void
|
dumpDisplayList(Client client, String viewRoot, String view)
|
static
void
|
dumpTheme(ClientImpl client, String viewRoot, DebugViewDumpHandler handler)
|
static
void
|
dumpViewHierarchy(Client client, String viewRoot, boolean skipChildren, boolean includeProperties, boolean useV2, DebugViewDumpHandler handler)
|
void
|
handleChunk(ClientImpl client, int type, ByteBuffer data, boolean isReply, int msgId)
处理传入的块。
|
static
void
|
invalidateView(ClientImpl client, String viewRoot, String view)
|
static
void
|
invokeMethod(ClientImpl client, String viewRoot, String view, String method, Object... args)
|
static
void
|
listViewRoots(Client client, DebugViewDumpHandler replyHandler)
|
static
void
|
profileView(ClientImpl client, String viewRoot, String view, DebugViewDumpHandler handler)
|
static
void
|
register(MonitorThread mt)
|
static
void
|
requestLayout(ClientImpl client, String viewRoot, String view)
|
static
void
|
sendStartGlTracing(ClientImpl client)
|
static
void
|
sendStopGlTracing(ClientImpl client)
|
static
void
|
setLayoutParameter(ClientImpl client, String viewRoot, String view, String parameter, int value)
|
公共方法
captureLayers
public static void captureLayers (ClientImpl client,
String viewRoot,
DebugViewDumpHandler handler)
| 参数 |
client |
ClientImpl |
viewRoot |
String |
handler |
DebugViewDumpHandler |
captureView
public static void captureView (Client client,
String viewRoot,
String view,
DebugViewDumpHandler handler)
| 参数 |
client |
Client |
viewRoot |
String |
view |
String |
handler |
DebugViewDumpHandler |
clientDisconnected
public void clientDisconnected (ClientImpl client)
客户端已消失。可用于清理与此客户端连接关联的任何资源。
clientReady
public void clientReady (ClientImpl client)
客户端已准备就绪。当客户端被确定为 DDM 感知型(通常是在收到 HELO 响应后)时,监控线程会在所有处理程序上调用此方法。
处理程序可以利用此机会初始化客户端 activity。由于我们很有可能会想向客户端发送消息,因此此方法可能会抛出 IOException。
dumpDisplayList
public static void dumpDisplayList (Client client,
String viewRoot,
String view)
| 参数 |
client |
Client |
viewRoot |
String |
view |
String |
dumpTheme
public static void dumpTheme (ClientImpl client,
String viewRoot,
DebugViewDumpHandler handler)
| 参数 |
client |
ClientImpl |
viewRoot |
String |
handler |
DebugViewDumpHandler |
dumpViewHierarchy
public static void dumpViewHierarchy (Client client,
String viewRoot,
boolean skipChildren,
boolean includeProperties,
boolean useV2,
DebugViewDumpHandler handler)
| 参数 |
client |
Client |
viewRoot |
String |
skipChildren |
boolean |
includeProperties |
boolean |
useV2 |
boolean |
handler |
DebugViewDumpHandler |
handleChunk
public void handleChunk (ClientImpl client,
int type,
ByteBuffer data,
boolean isReply,
int msgId)
处理传入的块。块类型为“type”的数据从“data”的开头开始,一直持续到 data.limit()。
如果设置了“isReply”,则“msgId”将是我们发送给客户端的请求的 ID。
否则,它是客户端为此事件生成的 ID。请注意,我们可能会收到未注册的回复数据块。
处理程序不得修改“data”的内容。
| 参数 |
client |
ClientImpl |
type |
int |
data |
ByteBuffer |
isReply |
boolean |
msgId |
int |
invalidateView
public static void invalidateView (ClientImpl client,
String viewRoot,
String view)
| 参数 |
client |
ClientImpl |
viewRoot |
String |
view |
String |
invokeMethod
public static void invokeMethod (ClientImpl client,
String viewRoot,
String view,
String method,
Object... args)
| 参数 |
client |
ClientImpl |
viewRoot |
String |
view |
String |
method |
String |
args |
Object |
listViewRoots
public static void listViewRoots (Client client,
DebugViewDumpHandler replyHandler)
| 参数 |
client |
Client |
replyHandler |
DebugViewDumpHandler |
profileView
public static void profileView (ClientImpl client,
String viewRoot,
String view,
DebugViewDumpHandler handler)
| 参数 |
client |
ClientImpl |
viewRoot |
String |
view |
String |
handler |
DebugViewDumpHandler |
requestLayout
public static void requestLayout (ClientImpl client,
String viewRoot,
String view)
| 参数 |
client |
ClientImpl |
viewRoot |
String |
view |
String |
sendStartGlTracing
public static void sendStartGlTracing (ClientImpl client)
sendStopGlTracing
public static void sendStopGlTracing (ClientImpl client)
setLayoutParameter
public static void setLayoutParameter (ClientImpl client,
String viewRoot,
String view,
String parameter,
int value)
| 参数 |
client |
ClientImpl |
viewRoot |
String |
view |
String |
parameter |
String |
value |
int |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-12-04。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-12-04。"],[],[]]