Loading core/java/android/app/ActivityThread.java +25 −4 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import android.view.Display; import android.view.View; import android.view.ViewDebug; import android.view.ViewManager; import android.view.ViewRoot; import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerImpl; Loading Loading @@ -1813,6 +1814,7 @@ public final class ActivityThread { public static final int DESTROY_BACKUP_AGENT = 129; public static final int SUICIDE = 130; public static final int REMOVE_PROVIDER = 131; public static final int ENABLE_JIT = 132; String codeToString(int code) { if (localLOGV) { switch (code) { Loading Loading @@ -1848,6 +1850,7 @@ public final class ActivityThread { case DESTROY_BACKUP_AGENT: return "DESTROY_BACKUP_AGENT"; case SUICIDE: return "SUICIDE"; case REMOVE_PROVIDER: return "REMOVE_PROVIDER"; case ENABLE_JIT: return "ENABLE_JIT"; } } return "(unknown)"; Loading Loading @@ -1965,6 +1968,9 @@ public final class ActivityThread { case REMOVE_PROVIDER: completeRemoveProvider((IContentProvider)msg.obj); break; case ENABLE_JIT: ensureJitEnabled(); break; } } Loading Loading @@ -2000,6 +2006,7 @@ public final class ActivityThread { prev.nextIdle = null; } while (a != null); } ensureJitEnabled(); return false; } } Loading Loading @@ -2064,6 +2071,7 @@ public final class ActivityThread { String mInstrumentationAppPackage = null; String mInstrumentedAppDir = null; boolean mSystemThread = false; boolean mJitEnabled = false; /** * Activities that are enqueued to be relaunched. This list is accessed Loading Loading @@ -2269,6 +2277,13 @@ public final class ActivityThread { } } void ensureJitEnabled() { if (!mJitEnabled) { mJitEnabled = true; dalvik.system.VMRuntime.getRuntime().startJitCompilation(); } } void scheduleGcIdler() { if (!mGcIdlerScheduled) { mGcIdlerScheduled = true; Loading Loading @@ -2808,6 +2823,7 @@ public final class ActivityThread { ActivityManagerNative.getDefault().serviceDoneExecuting( data.token, 0, 0, 0); } ensureJitEnabled(); } catch (RemoteException ex) { } } catch (Exception e) { Loading Loading @@ -2876,6 +2892,7 @@ public final class ActivityThread { } catch (RemoteException e) { // nothing to do. } ensureJitEnabled(); } catch (Exception e) { if (!mInstrumentation.onException(s, e)) { throw new RuntimeException( Loading Loading @@ -3864,10 +3881,6 @@ public final class ActivityThread { mBoundApplication = data; mConfiguration = new Configuration(data.config); // We now rely on this being set by zygote. //Process.setGid(data.appInfo.gid); //Process.setUid(data.appInfo.uid); // send up app name; do this *before* waiting for debugger Process.setArgV0(data.processName); android.ddm.DdmHandleAppName.setAppName(data.processName); Loading Loading @@ -3998,6 +4011,9 @@ public final class ActivityThread { List<ProviderInfo> providers = data.providers; if (providers != null) { installContentProviders(app, providers); // For process that contain content providers, we want to // ensure that the JIT is enabled "at some point". mH.sendEmptyMessageDelayed(H.ENABLE_JIT, 10*1000); } try { Loading Loading @@ -4303,6 +4319,11 @@ public final class ActivityThread { sThreadLocal.set(this); mSystemThread = system; if (!system) { ViewRoot.addFirstDrawHandler(new Runnable() { public void run() { ensureJitEnabled(); } }); android.ddm.DdmHandleAppName.setAppName("<pre-initialized>"); RuntimeInit.setApplicationObject(mAppThread.asBinder()); IActivityManager mgr = ActivityManagerNative.getDefault(); Loading core/java/android/view/ViewRoot.java +20 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ public final class ViewRoot extends Handler implements ViewParent, static final ThreadLocal<RunQueue> sRunQueues = new ThreadLocal<RunQueue>(); static final ArrayList<Runnable> sFirstDrawHandlers = new ArrayList<Runnable>(); static boolean sFirstDrawComplete = false; private static int sDrawTime; long mLastTrackballTime = 0; Loading Loading @@ -254,6 +257,14 @@ public final class ViewRoot extends Handler implements ViewParent, return sInstanceCount; } public static void addFirstDrawHandler(Runnable callback) { synchronized (sFirstDrawHandlers) { if (!sFirstDrawComplete) { sFirstDrawHandlers.add(callback); } } } // FIXME for perf testing only private boolean mProfile = false; Loading Loading @@ -1189,6 +1200,15 @@ public final class ViewRoot extends Handler implements ViewParent, return; } if (!sFirstDrawComplete) { synchronized (sFirstDrawHandlers) { sFirstDrawComplete = true; for (int i=0; i<sFirstDrawHandlers.size(); i++) { post(sFirstDrawHandlers.get(i)); } } } scrollToRectOrFocus(null, false); if (mAttachInfo.mViewScrollChanged) { Loading services/java/com/android/server/SystemServer.java +2 −1 Original line number Diff line number Diff line Loading @@ -529,6 +529,7 @@ public class SystemServer // The system server has to run all of the time, so it needs to be // as efficient as possible with its memory usage. VMRuntime.getRuntime().setTargetHeapUtilization(0.8f); VMRuntime.getRuntime().startJitCompilation(); System.loadLibrary("android_servers"); init1(args); Loading Loading
core/java/android/app/ActivityThread.java +25 −4 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import android.view.Display; import android.view.View; import android.view.ViewDebug; import android.view.ViewManager; import android.view.ViewRoot; import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerImpl; Loading Loading @@ -1813,6 +1814,7 @@ public final class ActivityThread { public static final int DESTROY_BACKUP_AGENT = 129; public static final int SUICIDE = 130; public static final int REMOVE_PROVIDER = 131; public static final int ENABLE_JIT = 132; String codeToString(int code) { if (localLOGV) { switch (code) { Loading Loading @@ -1848,6 +1850,7 @@ public final class ActivityThread { case DESTROY_BACKUP_AGENT: return "DESTROY_BACKUP_AGENT"; case SUICIDE: return "SUICIDE"; case REMOVE_PROVIDER: return "REMOVE_PROVIDER"; case ENABLE_JIT: return "ENABLE_JIT"; } } return "(unknown)"; Loading Loading @@ -1965,6 +1968,9 @@ public final class ActivityThread { case REMOVE_PROVIDER: completeRemoveProvider((IContentProvider)msg.obj); break; case ENABLE_JIT: ensureJitEnabled(); break; } } Loading Loading @@ -2000,6 +2006,7 @@ public final class ActivityThread { prev.nextIdle = null; } while (a != null); } ensureJitEnabled(); return false; } } Loading Loading @@ -2064,6 +2071,7 @@ public final class ActivityThread { String mInstrumentationAppPackage = null; String mInstrumentedAppDir = null; boolean mSystemThread = false; boolean mJitEnabled = false; /** * Activities that are enqueued to be relaunched. This list is accessed Loading Loading @@ -2269,6 +2277,13 @@ public final class ActivityThread { } } void ensureJitEnabled() { if (!mJitEnabled) { mJitEnabled = true; dalvik.system.VMRuntime.getRuntime().startJitCompilation(); } } void scheduleGcIdler() { if (!mGcIdlerScheduled) { mGcIdlerScheduled = true; Loading Loading @@ -2808,6 +2823,7 @@ public final class ActivityThread { ActivityManagerNative.getDefault().serviceDoneExecuting( data.token, 0, 0, 0); } ensureJitEnabled(); } catch (RemoteException ex) { } } catch (Exception e) { Loading Loading @@ -2876,6 +2892,7 @@ public final class ActivityThread { } catch (RemoteException e) { // nothing to do. } ensureJitEnabled(); } catch (Exception e) { if (!mInstrumentation.onException(s, e)) { throw new RuntimeException( Loading Loading @@ -3864,10 +3881,6 @@ public final class ActivityThread { mBoundApplication = data; mConfiguration = new Configuration(data.config); // We now rely on this being set by zygote. //Process.setGid(data.appInfo.gid); //Process.setUid(data.appInfo.uid); // send up app name; do this *before* waiting for debugger Process.setArgV0(data.processName); android.ddm.DdmHandleAppName.setAppName(data.processName); Loading Loading @@ -3998,6 +4011,9 @@ public final class ActivityThread { List<ProviderInfo> providers = data.providers; if (providers != null) { installContentProviders(app, providers); // For process that contain content providers, we want to // ensure that the JIT is enabled "at some point". mH.sendEmptyMessageDelayed(H.ENABLE_JIT, 10*1000); } try { Loading Loading @@ -4303,6 +4319,11 @@ public final class ActivityThread { sThreadLocal.set(this); mSystemThread = system; if (!system) { ViewRoot.addFirstDrawHandler(new Runnable() { public void run() { ensureJitEnabled(); } }); android.ddm.DdmHandleAppName.setAppName("<pre-initialized>"); RuntimeInit.setApplicationObject(mAppThread.asBinder()); IActivityManager mgr = ActivityManagerNative.getDefault(); Loading
core/java/android/view/ViewRoot.java +20 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ public final class ViewRoot extends Handler implements ViewParent, static final ThreadLocal<RunQueue> sRunQueues = new ThreadLocal<RunQueue>(); static final ArrayList<Runnable> sFirstDrawHandlers = new ArrayList<Runnable>(); static boolean sFirstDrawComplete = false; private static int sDrawTime; long mLastTrackballTime = 0; Loading Loading @@ -254,6 +257,14 @@ public final class ViewRoot extends Handler implements ViewParent, return sInstanceCount; } public static void addFirstDrawHandler(Runnable callback) { synchronized (sFirstDrawHandlers) { if (!sFirstDrawComplete) { sFirstDrawHandlers.add(callback); } } } // FIXME for perf testing only private boolean mProfile = false; Loading Loading @@ -1189,6 +1200,15 @@ public final class ViewRoot extends Handler implements ViewParent, return; } if (!sFirstDrawComplete) { synchronized (sFirstDrawHandlers) { sFirstDrawComplete = true; for (int i=0; i<sFirstDrawHandlers.size(); i++) { post(sFirstDrawHandlers.get(i)); } } } scrollToRectOrFocus(null, false); if (mAttachInfo.mViewScrollChanged) { Loading
services/java/com/android/server/SystemServer.java +2 −1 Original line number Diff line number Diff line Loading @@ -529,6 +529,7 @@ public class SystemServer // The system server has to run all of the time, so it needs to be // as efficient as possible with its memory usage. VMRuntime.getRuntime().setTargetHeapUtilization(0.8f); VMRuntime.getRuntime().startJitCompilation(); System.loadLibrary("android_servers"); init1(args); Loading