From 6f86c0e64bcca300f650871c0a84456a7813432d Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 11 May 2010 14:20:52 -0700 Subject: [PATCH] Fix issue #2676378: Activity Manager Crash on FRF40 D'oh! Change-Id: If1b43ff5f230f9bf0de0887deb1b25dcf6aa6e66 --- .../android/server/am/ActivityManagerService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 948d2926156f6..022eccff19b13 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -7858,18 +7858,18 @@ public final class ActivityManagerService extends ActivityManagerNative implemen r.conProviders.put(cpr, new Integer(cnt.intValue()+1)); } cpr.clients.add(r); - } else { - cpr.externals++; - } - - if (cpr.app != null) { - if (r.setAdj >= VISIBLE_APP_ADJ) { + if (cpr.app != null && r.setAdj >= VISIBLE_APP_ADJ) { // If this is a visible app accessing the provider, // make sure to count it as being accessed and thus // back up on the LRU list. This is good because // content providers are often expensive to start. updateLruProcessLocked(cpr.app, false, true); } + } else { + cpr.externals++; + } + + if (cpr.app != null) { updateOomAdjLocked(cpr.app); }