Methods Summary |
---|
public void | connected()Called when the DDM server connects. The handler is allowed to
send messages to the server.
|
public void | disconnected()Called when the DDM server disconnects. Can be used to disable
periodic transmissions or clean up saved state.
|
public static java.lang.String | getAppName()
return mAppName;
|
public org.apache.harmony.dalvik.ddmc.Chunk | handleChunk(org.apache.harmony.dalvik.ddmc.Chunk request)Handle a chunk of data.
return null;
|
public static void | register()Register for the messages we're interested in.
|
private static void | sendAPNM(java.lang.String appName, int userId)
if (false)
Log.v("ddm", "Sending app name");
ByteBuffer out = ByteBuffer.allocate(
4 /* appName's length */
+ appName.length()*2 /* appName */
+ 4 /* userId */);
out.order(ChunkHandler.CHUNK_ORDER);
out.putInt(appName.length());
putString(out, appName);
out.putInt(userId);
Chunk chunk = new Chunk(CHUNK_APNM, out);
DdmServer.sendChunk(chunk);
|
public static void | setAppName(java.lang.String name, int userId)Set the application name. Called when we get named, which may be
before or after DDMS connects. For the latter we need to send up
an APNM message.
if (name == null || name.length() == 0)
return;
mAppName = name;
// if DDMS is already connected, send the app name up
sendAPNM(name, userId);
|