summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityThread.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-09-02 12:22:18 -0700
committerDianne Hackborn <hackbod@google.com>2011-09-02 12:22:18 -0700
commit5d927c2d8e832fcfcb0154c8741f896001141ef4 (patch)
tree7d162893e30019d24ec5a50cdc5566878e8d3a08 /core/java/android/app/ActivityThread.java
parenta55c369e73a8864cc34290625acd16c68956c58a (diff)
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
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
-rw-r--r--core/java/android/app/ActivityThread.java20
1 files changed, 16 insertions, 4 deletions
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<String, IBinder> services,
- Bundle coreSettings) {
+ int debugMode, boolean isRestrictedBackupMode, boolean persistent,
+ Configuration config, CompatibilityInfo compatInfo,
+ Map<String, IBinder> 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;