FileDocCategorySizeDatePackage
HandleAppName.javaAPI DocAndroid 1.5 API2463Wed May 06 22:41:08 BST 2009com.android.ddmlib

HandleAppName

public final class HandleAppName extends ChunkHandler
Handle the "app name" chunk (APNM).

Fields Summary
public static final int
CHUNK_APNM
private static final HandleAppName
mInst
Constructors Summary
private HandleAppName()



      
Methods Summary
public voidclientDisconnected(Client client)
Client went away.

public voidclientReady(Client client)
Client is ready.

private static voidhandleAPNM(Client client, java.nio.ByteBuffer data)

        int appNameLen;
        String appName;

        appNameLen = data.getInt();
        appName = getString(data, appNameLen);

        Log.i("ddm-appname", "APNM: app='" + appName + "'");

        ClientData cd = client.getClientData();
        synchronized (cd) {
            cd.setClientDescription(appName);
        }

        client = checkDebuggerPortForAppName(client, appName);

        if (client != null) {
            client.update(Client.CHANGE_NAME);
        }
    
public voidhandleChunk(Client client, int type, java.nio.ByteBuffer data, boolean isReply, int msgId)
Chunk handler entry point.


        Log.d("ddm-appname", "handling " + ChunkHandler.name(type));

        if (type == CHUNK_APNM) {
            assert !isReply;
            handleAPNM(client, data);
        } else {
            handleUnknownChunk(client, type, data, isReply, msgId);
        }
    
public static voidregister(MonitorThread mt)
Register for the packets we expect to get from the client.

        mt.registerChunkHandler(CHUNK_APNM, mInst);