Fix issue #3485923: Gmail crash

Allow application to try to recover if a surface OOM error
happens on the client side.

Change-Id: I0308bd99647a35e4bcac448340b7fc6330a828f6
This commit is contained in:
Dianne Hackborn
2011-03-02 21:32:58 -08:00
parent cbf9cb35bb
commit 6482517101
11 changed files with 122 additions and 32 deletions

View File

@@ -594,7 +594,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
+ " / " + this);
} catch (Surface.OutOfResourcesException e) {
Slog.w(WindowManagerService.TAG, "OutOfResourcesException creating surface");
mService.reclaimSomeSurfaceMemoryLocked(this, "create");
mService.reclaimSomeSurfaceMemoryLocked(this, "create", true);
return null;
} catch (Exception e) {
Slog.e(WindowManagerService.TAG, "Exception creating surface", e);
@@ -628,7 +628,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
} catch (RuntimeException e) {
Slog.w(WindowManagerService.TAG, "Error creating surface in " + w, e);
mService.reclaimSomeSurfaceMemoryLocked(this, "create-init");
mService.reclaimSomeSurfaceMemoryLocked(this, "create-init", true);
}
mLastHidden = true;
} finally {