From 5d927c2d8e832fcfcb0154c8741f896001141ef4 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 2 Sep 2011 12:22:18 -0700 Subject: Fix issue #5150899: Call activity takes 15MB we never get back. Persistent process can no longer use hardware acclerated drawing when running on a low-memory device. Change-Id: I3110335617af1c98fcede9bf41f4a1d0c20d0e87 --- core/java/android/app/ActivityThread.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'core/java/android/app/ActivityThread.java') diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 8275cbd6152c..2c2a493f85e2 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -372,6 +372,7 @@ public final class ActivityThread { IInstrumentationWatcher instrumentationWatcher; int debugMode; boolean restrictedBackupMode; + boolean persistent; Configuration config; CompatibilityInfo compatInfo; boolean handlingProfiling; @@ -644,9 +645,9 @@ public final class ActivityThread { ComponentName instrumentationName, String profileFile, ParcelFileDescriptor profileFd, boolean autoStopProfiler, Bundle instrumentationArgs, IInstrumentationWatcher instrumentationWatcher, - int debugMode, boolean isRestrictedBackupMode, Configuration config, - CompatibilityInfo compatInfo, Map services, - Bundle coreSettings) { + int debugMode, boolean isRestrictedBackupMode, boolean persistent, + Configuration config, CompatibilityInfo compatInfo, + Map services, Bundle coreSettings) { if (services != null) { // Setup the service cache in the ServiceManager @@ -666,6 +667,7 @@ public final class ActivityThread { data.instrumentationWatcher = instrumentationWatcher; data.debugMode = debugMode; data.restrictedBackupMode = isRestrictedBackupMode; + data.persistent = persistent; data.config = config; data.compatInfo = compatInfo; queueOrSendMessage(H.BIND_APPLICATION, data); @@ -3687,6 +3689,16 @@ public final class ActivityThread { Process.setArgV0(data.processName); android.ddm.DdmHandleAppName.setAppName(data.processName); + if (data.persistent) { + // Persistent processes on low-memory devices do not get to + // use hardware accelerated drawing, since this can add too much + // overhead to the process. + Display display = WindowManagerImpl.getDefault().getDefaultDisplay(); + if (!ActivityManager.isHighEndGfx(display)) { + HardwareRenderer.disable(false); + } + } + if (data.profileFd != null) { data.startProfiling(); } @@ -4242,7 +4254,7 @@ public final class ActivityThread { } public static final ActivityThread systemMain() { - HardwareRenderer.disable(); + HardwareRenderer.disable(true); ActivityThread thread = new ActivityThread(); thread.attach(true); return thread; -- cgit v1.2.3