OSDN Git Service

Fix issue #7184877: Calendar Locksceen Widget crashes and forces phone to reboot
authorDianne Hackborn <hackbod@google.com>
Sun, 23 Sep 2012 20:29:44 +0000 (13:29 -0700)
committerDianne Hackborn <hackbod@google.com>
Sun, 23 Sep 2012 20:29:44 +0000 (13:29 -0700)
Don't kill the system uid if we are running out of RAM.

Change-Id: Ie1818a3241fc80d4dfa19f8e8bdad22d164d7baa

core/java/android/view/ViewRootImpl.java

index 6bb8697..6db40ba 100644 (file)
@@ -52,6 +52,7 @@ import android.os.RemoteException;
 import android.os.SystemClock;
 import android.os.SystemProperties;
 import android.os.Trace;
+import android.os.UserHandle;
 import android.util.AndroidRuntimeException;
 import android.util.DisplayMetrics;
 import android.util.Log;
@@ -1493,7 +1494,8 @@ public final class ViewRootImpl implements ViewParent,
                             } catch (Surface.OutOfResourcesException e) {
                                 Log.e(TAG, "OutOfResourcesException initializing HW surface", e);
                                 try {
-                                    if (!mWindowSession.outOfMemory(mWindow)) {
+                                    if (!mWindowSession.outOfMemory(mWindow) &&
+                                            Process.myUid() != Process.SYSTEM_UID) {
                                         Slog.w(TAG, "No processes killed for memory; killing self");
                                         Process.killProcess(Process.myPid());
                                     }