為配合主幹穩定開發模型,並確保生態系統的平台穩定性,我們將於 2026 年起,在第 2 季和第 4 季將原始碼發布至 AOSP。如要建構及貢獻 AOSP,建議使用 android-latest-release,而非 aosp-main。android-latest-release 資訊清單分支版本一律會參照推送至 AOSP 的最新版本。詳情請參閱「Android 開放原始碼計畫變更」一文。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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 回應後),監控執行緒會在所有處理常式上呼叫這個方法。
處理常式可利用這個機會初始化用戶端活動。因為我們很有可能想傳送訊息給用戶端,所以這個方法可能會擲回 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 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間:2025-12-04 (世界標準時間)。"],[],[]]