summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/jni/AndroidRuntime.cpp9
-rw-r--r--services/java/com/android/server/ConnectivityService.java11
2 files changed, 12 insertions, 8 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 6f6d91940a78..c9d7e7f88fe4 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -308,6 +308,8 @@ status_t AndroidRuntime::callMain(
jclass clazz;
jmethodID methodId;
+ LOGD("Calling main entry %s", className);
+
env = getJNIEnv();
if (env == NULL)
return UNKNOWN_ERROR;
@@ -914,7 +916,8 @@ bail:
*/
void AndroidRuntime::start(const char* className, const bool startSystemServer)
{
- LOGD("\n>>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<\n");
+ LOGD("\n>>>>>> AndroidRuntime START %s <<<<<<\n",
+ className != NULL ? className : "(unknown)");
char* slashClassName = NULL;
char* cp;
@@ -1029,7 +1032,7 @@ void AndroidRuntime::start()
void AndroidRuntime::onExit(int code)
{
- LOGI("AndroidRuntime onExit calling exit(%d)", code);
+ LOGV("AndroidRuntime onExit calling exit(%d)", code);
exit(code);
}
@@ -1334,7 +1337,7 @@ static const RegJNIRec gRegJNI[] = {
*/
androidSetCreateThreadFunc((android_create_thread_fn) javaCreateThreadEtc);
- LOGD("--- registering native functions ---\n");
+ LOGV("--- registering native functions ---\n");
/*
* Every "register" function calls one or more things that return
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 54ff69f60d90..c28a3733edb9 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -105,7 +105,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private int mNumDnsEntries;
private boolean mTestMode;
- private static volatile ConnectivityService sServiceInstance;
+ private static ConnectivityService sServiceInstance;
private Handler mHandler;
@@ -176,10 +176,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
Looper.loop();
}
- public static synchronized ConnectivityService getServiceInstance(Context context) {
- if (sServiceInstance == null) {
- ConnectivityThread thread = new ConnectivityThread(context);
- thread.start();
+ public static ConnectivityService getServiceInstance(Context context) {
+ ConnectivityThread thread = new ConnectivityThread(context);
+ thread.start();
+
+ synchronized (thread) {
while (sServiceInstance == null) {
try {
// Wait until sServiceInstance has been initialized.