Loading core/java/android/app/ActivityThread.java +6 −3 Original line number Diff line number Diff line Loading @@ -4066,7 +4066,8 @@ public final class ActivityThread { // send up app name; do this *before* waiting for debugger Process.setArgV0(data.processName); android.ddm.DdmHandleAppName.setAppName(data.processName); android.ddm.DdmHandleAppName.setAppName(data.processName, UserHandle.myUserId()); if (data.persistent) { // Persistent processes on low-memory devices do not get to Loading Loading @@ -4792,7 +4793,8 @@ public final class ActivityThread { ensureJitEnabled(); } }); android.ddm.DdmHandleAppName.setAppName("<pre-initialized>"); android.ddm.DdmHandleAppName.setAppName("<pre-initialized>", UserHandle.myUserId()); RuntimeInit.setApplicationObject(mAppThread.asBinder()); IActivityManager mgr = ActivityManagerNative.getDefault(); try { Loading @@ -4803,7 +4805,8 @@ public final class ActivityThread { } else { // Don't set application object here -- if the system crashes, // we can't display an alert, we just want to die die die. android.ddm.DdmHandleAppName.setAppName("system_process"); android.ddm.DdmHandleAppName.setAppName("system_process", UserHandle.myUserId()); try { mInstrumentation = new Instrumentation(); ContextImpl context = new ContextImpl(); Loading core/java/android/ddm/DdmHandleAppName.java +8 −4 Original line number Diff line number Diff line Loading @@ -69,14 +69,14 @@ public class DdmHandleAppName extends ChunkHandler { * before or after DDMS connects. For the latter we need to send up * an APNM message. */ public static void setAppName(String name) { public static void setAppName(String name, int userId) { if (name == null || name.length() == 0) return; mAppName = name; // if DDMS is already connected, send the app name up sendAPNM(name); sendAPNM(name, userId); } public static String getAppName() { Loading @@ -86,14 +86,18 @@ public class DdmHandleAppName extends ChunkHandler { /* * Send an APNM (APplication NaMe) chunk. */ private static void sendAPNM(String appName) { private static void sendAPNM(String appName, int userId) { if (false) Log.v("ddm", "Sending app name"); ByteBuffer out = ByteBuffer.allocate(4 + appName.length()*2); 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); Loading core/java/android/ddm/DdmHandleHello.java +3 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import org.apache.harmony.dalvik.ddmc.ChunkHandler; import org.apache.harmony.dalvik.ddmc.DdmServer; import android.util.Log; import android.os.Debug; import android.os.UserHandle; import java.nio.ByteBuffer; Loading Loading @@ -119,7 +120,7 @@ public class DdmHandleHello extends ChunkHandler { // appName = "unknown"; String appName = DdmHandleAppName.getAppName(); ByteBuffer out = ByteBuffer.allocate(16 ByteBuffer out = ByteBuffer.allocate(20 + vmIdent.length()*2 + appName.length()*2); out.order(ChunkHandler.CHUNK_ORDER); out.putInt(DdmServer.CLIENT_PROTOCOL_VERSION); Loading @@ -128,6 +129,7 @@ public class DdmHandleHello extends ChunkHandler { out.putInt(appName.length()); putString(out, vmIdent); putString(out, appName); out.putInt(UserHandle.myUserId()); Chunk reply = new Chunk(CHUNK_HELO, out); Loading Loading
core/java/android/app/ActivityThread.java +6 −3 Original line number Diff line number Diff line Loading @@ -4066,7 +4066,8 @@ public final class ActivityThread { // send up app name; do this *before* waiting for debugger Process.setArgV0(data.processName); android.ddm.DdmHandleAppName.setAppName(data.processName); android.ddm.DdmHandleAppName.setAppName(data.processName, UserHandle.myUserId()); if (data.persistent) { // Persistent processes on low-memory devices do not get to Loading Loading @@ -4792,7 +4793,8 @@ public final class ActivityThread { ensureJitEnabled(); } }); android.ddm.DdmHandleAppName.setAppName("<pre-initialized>"); android.ddm.DdmHandleAppName.setAppName("<pre-initialized>", UserHandle.myUserId()); RuntimeInit.setApplicationObject(mAppThread.asBinder()); IActivityManager mgr = ActivityManagerNative.getDefault(); try { Loading @@ -4803,7 +4805,8 @@ public final class ActivityThread { } else { // Don't set application object here -- if the system crashes, // we can't display an alert, we just want to die die die. android.ddm.DdmHandleAppName.setAppName("system_process"); android.ddm.DdmHandleAppName.setAppName("system_process", UserHandle.myUserId()); try { mInstrumentation = new Instrumentation(); ContextImpl context = new ContextImpl(); Loading
core/java/android/ddm/DdmHandleAppName.java +8 −4 Original line number Diff line number Diff line Loading @@ -69,14 +69,14 @@ public class DdmHandleAppName extends ChunkHandler { * before or after DDMS connects. For the latter we need to send up * an APNM message. */ public static void setAppName(String name) { public static void setAppName(String name, int userId) { if (name == null || name.length() == 0) return; mAppName = name; // if DDMS is already connected, send the app name up sendAPNM(name); sendAPNM(name, userId); } public static String getAppName() { Loading @@ -86,14 +86,18 @@ public class DdmHandleAppName extends ChunkHandler { /* * Send an APNM (APplication NaMe) chunk. */ private static void sendAPNM(String appName) { private static void sendAPNM(String appName, int userId) { if (false) Log.v("ddm", "Sending app name"); ByteBuffer out = ByteBuffer.allocate(4 + appName.length()*2); 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); Loading
core/java/android/ddm/DdmHandleHello.java +3 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import org.apache.harmony.dalvik.ddmc.ChunkHandler; import org.apache.harmony.dalvik.ddmc.DdmServer; import android.util.Log; import android.os.Debug; import android.os.UserHandle; import java.nio.ByteBuffer; Loading Loading @@ -119,7 +120,7 @@ public class DdmHandleHello extends ChunkHandler { // appName = "unknown"; String appName = DdmHandleAppName.getAppName(); ByteBuffer out = ByteBuffer.allocate(16 ByteBuffer out = ByteBuffer.allocate(20 + vmIdent.length()*2 + appName.length()*2); out.order(ChunkHandler.CHUNK_ORDER); out.putInt(DdmServer.CLIENT_PROTOCOL_VERSION); Loading @@ -128,6 +129,7 @@ public class DdmHandleHello extends ChunkHandler { out.putInt(appName.length()); putString(out, vmIdent); putString(out, appName); out.putInt(UserHandle.myUserId()); Chunk reply = new Chunk(CHUNK_HELO, out); Loading