Loading core/java/android/app/ActivityThread.java +10 −3 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.net.InetAddress; import java.nio.file.DirectoryStream; Loading Loading @@ -2268,10 +2269,16 @@ public final class ActivityThread extends ClientTransactionHandler public void getExecutableMethodFileOffsets( @NonNull MethodDescriptor methodDescriptor, @NonNull IOffsetCallback resultCallback) { Method method = MethodDescriptorParser.parseMethodDescriptor( Executable executable = MethodDescriptorParser.parseMethodDescriptor( getClass().getClassLoader(), methodDescriptor); VMDebug.ExecutableMethodFileOffsets location = VMDebug.getExecutableMethodFileOffsets(method); VMDebug.ExecutableMethodFileOffsets location; if (com.android.art.flags.Flags.executableMethodFileOffsetsV2()) { location = VMDebug.getExecutableMethodFileOffsets(executable); } else if (executable instanceof Method) { location = VMDebug.getExecutableMethodFileOffsets((Method) executable); } else { throw new UnsupportedOperationException(); } try { if (location == null) { resultCallback.onResult(null); Loading core/java/android/os/instrumentation/MethodDescriptorParser.java +7 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package android.os.instrumentation; import android.annotation.NonNull; import java.lang.reflect.Method; import java.lang.reflect.Executable; /** * A utility class for dynamic instrumentation / uprobestats. Loading @@ -28,9 +28,9 @@ import java.lang.reflect.Method; public final class MethodDescriptorParser { /** * Parses a {@link MethodDescriptor} (in string representation) into a {@link Method}. * Parses a {@link MethodDescriptor} (in string representation) into a {@link Executable}. */ public static Method parseMethodDescriptor(ClassLoader classLoader, public static Executable parseMethodDescriptor(ClassLoader classLoader, @NonNull MethodDescriptor descriptor) { try { Class<?> javaClass = classLoader.loadClass(descriptor.fullyQualifiedClassName); Loading Loading @@ -72,6 +72,10 @@ public final class MethodDescriptorParser { } } if (com.android.art.flags.Flags.executableMethodFileOffsetsV2() && descriptor.methodName.equals("<init>")) { return javaClass.getDeclaredConstructor(parameters); } return javaClass.getDeclaredMethod(descriptor.methodName, parameters); } catch (ClassNotFoundException | NoSuchMethodException e) { throw new IllegalArgumentException( Loading services/core/java/com/android/server/os/instrumentation/DynamicInstrumentationManagerService.java +10 −3 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.server.SystemService; import dalvik.system.VMDebug; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.util.NoSuchElementException; import java.util.Objects; Loading Loading @@ -95,10 +96,16 @@ public class DynamicInstrumentationManagerService extends SystemService { } } Method method = MethodDescriptorParser.parseMethodDescriptor( Executable executable = MethodDescriptorParser.parseMethodDescriptor( getClass().getClassLoader(), methodDescriptor); VMDebug.ExecutableMethodFileOffsets location = VMDebug.getExecutableMethodFileOffsets(method); VMDebug.ExecutableMethodFileOffsets location; if (com.android.art.flags.Flags.executableMethodFileOffsetsV2()) { location = VMDebug.getExecutableMethodFileOffsets(executable); } else if (executable instanceof Method) { location = VMDebug.getExecutableMethodFileOffsets((Method) executable); } else { throw new UnsupportedOperationException(); } try { if (location == null) { Loading services/tests/DynamicInstrumentationManagerServiceTests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ android_test { static_libs: [ "androidx.test.core", "androidx.test.runner", "flag-junit", "hamcrest-library", "platform-test-annotations", "services.core", Loading services/tests/DynamicInstrumentationManagerServiceTests/src/com/android/server/TestClass.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ package com.android.server; public class TestClass { TestClass() { } void primitiveParams(boolean a, boolean[] b, byte c, byte[] d, char e, char[] f, short g, short[] h, int i, int[] j, long k, long[] l, float m, float[] n, double o, double[] p) { } Loading Loading
core/java/android/app/ActivityThread.java +10 −3 Original line number Diff line number Diff line Loading @@ -273,6 +273,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.net.InetAddress; import java.nio.file.DirectoryStream; Loading Loading @@ -2268,10 +2269,16 @@ public final class ActivityThread extends ClientTransactionHandler public void getExecutableMethodFileOffsets( @NonNull MethodDescriptor methodDescriptor, @NonNull IOffsetCallback resultCallback) { Method method = MethodDescriptorParser.parseMethodDescriptor( Executable executable = MethodDescriptorParser.parseMethodDescriptor( getClass().getClassLoader(), methodDescriptor); VMDebug.ExecutableMethodFileOffsets location = VMDebug.getExecutableMethodFileOffsets(method); VMDebug.ExecutableMethodFileOffsets location; if (com.android.art.flags.Flags.executableMethodFileOffsetsV2()) { location = VMDebug.getExecutableMethodFileOffsets(executable); } else if (executable instanceof Method) { location = VMDebug.getExecutableMethodFileOffsets((Method) executable); } else { throw new UnsupportedOperationException(); } try { if (location == null) { resultCallback.onResult(null); Loading
core/java/android/os/instrumentation/MethodDescriptorParser.java +7 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package android.os.instrumentation; import android.annotation.NonNull; import java.lang.reflect.Method; import java.lang.reflect.Executable; /** * A utility class for dynamic instrumentation / uprobestats. Loading @@ -28,9 +28,9 @@ import java.lang.reflect.Method; public final class MethodDescriptorParser { /** * Parses a {@link MethodDescriptor} (in string representation) into a {@link Method}. * Parses a {@link MethodDescriptor} (in string representation) into a {@link Executable}. */ public static Method parseMethodDescriptor(ClassLoader classLoader, public static Executable parseMethodDescriptor(ClassLoader classLoader, @NonNull MethodDescriptor descriptor) { try { Class<?> javaClass = classLoader.loadClass(descriptor.fullyQualifiedClassName); Loading Loading @@ -72,6 +72,10 @@ public final class MethodDescriptorParser { } } if (com.android.art.flags.Flags.executableMethodFileOffsetsV2() && descriptor.methodName.equals("<init>")) { return javaClass.getDeclaredConstructor(parameters); } return javaClass.getDeclaredMethod(descriptor.methodName, parameters); } catch (ClassNotFoundException | NoSuchMethodException e) { throw new IllegalArgumentException( Loading
services/core/java/com/android/server/os/instrumentation/DynamicInstrumentationManagerService.java +10 −3 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.server.SystemService; import dalvik.system.VMDebug; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.util.NoSuchElementException; import java.util.Objects; Loading Loading @@ -95,10 +96,16 @@ public class DynamicInstrumentationManagerService extends SystemService { } } Method method = MethodDescriptorParser.parseMethodDescriptor( Executable executable = MethodDescriptorParser.parseMethodDescriptor( getClass().getClassLoader(), methodDescriptor); VMDebug.ExecutableMethodFileOffsets location = VMDebug.getExecutableMethodFileOffsets(method); VMDebug.ExecutableMethodFileOffsets location; if (com.android.art.flags.Flags.executableMethodFileOffsetsV2()) { location = VMDebug.getExecutableMethodFileOffsets(executable); } else if (executable instanceof Method) { location = VMDebug.getExecutableMethodFileOffsets((Method) executable); } else { throw new UnsupportedOperationException(); } try { if (location == null) { Loading
services/tests/DynamicInstrumentationManagerServiceTests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ android_test { static_libs: [ "androidx.test.core", "androidx.test.runner", "flag-junit", "hamcrest-library", "platform-test-annotations", "services.core", Loading
services/tests/DynamicInstrumentationManagerServiceTests/src/com/android/server/TestClass.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ package com.android.server; public class TestClass { TestClass() { } void primitiveParams(boolean a, boolean[] b, byte c, byte[] d, char e, char[] f, short g, short[] h, int i, int[] j, long k, long[] l, float m, float[] n, double o, double[] p) { } Loading