FileDocCategorySizeDatePackage
DdmHandleExit.javaAPI DocAndroid 5.1 API2124Thu Mar 12 22:22:10 GMT 2015android.ddm

DdmHandleExit

public class DdmHandleExit extends org.apache.harmony.dalvik.ddmc.ChunkHandler
Handle an EXIT chunk.

Fields Summary
public static final int
CHUNK_EXIT
private static DdmHandleExit
mInstance
Constructors Summary
private DdmHandleExit()



    /* singleton, do not instantiate */
      
Methods Summary
public voidconnected()
Called when the DDM server connects. The handler is allowed to send messages to the server.

public voiddisconnected()
Called when the DDM server disconnects. Can be used to disable periodic transmissions or clean up saved state.

public org.apache.harmony.dalvik.ddmc.ChunkhandleChunk(org.apache.harmony.dalvik.ddmc.Chunk request)
Handle a chunk of data. We're only registered for "EXIT".

        if (false)
            Log.v("ddm-exit", "Handling " + name(request.type) + " chunk");

        /*
         * Process the request.
         */
        ByteBuffer in = wrapChunk(request);

        int statusCode = in.getInt();

        Runtime.getRuntime().halt(statusCode);

        // if that doesn't work, return an empty message
        return null;
    
public static voidregister()
Register for the messages we're interested in.

        DdmServer.registerHandler(CHUNK_EXIT, mInstance);