summaryrefslogtreecommitdiffstats
path: root/include/android_runtime
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-04-13 15:39:37 -0700
committerElliott Hughes <enh@google.com>2011-04-13 16:43:15 -0700
commitd195e5ab401432ddac659791640a2927fc668699 (patch)
tree61169b923b4d530a097ac8ff9e3029dfe468b7cd /include/android_runtime
parent966f9e558d714d9d41189e989b21e6d5fec35047 (diff)
downloadframeworks_base-d195e5ab401432ddac659791640a2927fc668699.zip
frameworks_base-d195e5ab401432ddac659791640a2927fc668699.tar.gz
frameworks_base-d195e5ab401432ddac659791640a2927fc668699.tar.bz2
Replace a custom AndroidRuntime::findClass with a more targeted fix.
This seems simpler and more contained, and I think the comment explaining why hoop-jumping is necessary is a bit clearer now. Change-Id: Ief4afd7cbb42188ed835fce23e497520bdb753a8
Diffstat (limited to 'include/android_runtime')
-rw-r--r--include/android_runtime/AndroidRuntime.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h
index de2d50b..b02a057 100644
--- a/include/android_runtime/AndroidRuntime.h
+++ b/include/android_runtime/AndroidRuntime.h
@@ -46,14 +46,10 @@ public:
const char* className, const JNINativeMethod* gMethods, int numMethods);
/**
- * Call a static Java function that takes no arguments and returns void.
- */
- status_t callStatic(const char* className, const char* methodName);
-
- /**
* Call a class's static main method with the given arguments,
*/
- status_t callMain(const char* className, int argc, const char* const argv[]);
+ status_t callMain(const char* className, jclass clazz, int argc,
+ const char* const argv[]);
/**
* Find a class, with the input either of the form
@@ -69,6 +65,13 @@ public:
static AndroidRuntime* getRuntime();
/**
+ * This gets called after the VM has been created, but before we
+ * run any code. Override it to make any FindClass calls that need
+ * to use CLASSPATH.
+ */
+ virtual void onVmCreated(JNIEnv* env);
+
+ /**
* This gets called after the JavaVM has initialized. Override it
* with the system's native entry point.
*/
@@ -98,6 +101,9 @@ public:
/** return a pointer to the JNIEnv pointer for this thread */
static JNIEnv* getJNIEnv();
+ /** return a new string corresponding to 'className' with all '.'s replaced by '/'s. */
+ static char* toSlashClassName(const char* className);
+
private:
static int startReg(JNIEnv* env);
void parseExtraOpts(char* extraOptsBuf);