diff options
author | Adam Cohen <adamcohen@google.com> | 2012-05-10 14:44:38 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2012-05-10 15:52:28 -0700 |
commit | 311c79c3e93589c6fc720fe6c58ed522af591376 (patch) | |
tree | 93e8fc58d8a36dfbf3e17222a34aa2933bf8c848 /core | |
parent | a53de0629f3b94472c0f160f5bbe1090b020feab (diff) | |
download | frameworks_base-311c79c3e93589c6fc720fe6c58ed522af591376.zip frameworks_base-311c79c3e93589c6fc720fe6c58ed522af591376.tar.gz frameworks_base-311c79c3e93589c6fc720fe6c58ed522af591376.tar.bz2 |
Cap widget bitmap usage by screen size (issue 6464700)
Change-Id: I04e16223861a88d40ad757afa086a0f92e84493b
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/appwidget/AppWidgetManager.java | 8 | ||||
-rw-r--r-- | core/java/android/widget/RemoteViews.java | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java index 7a8c1fb..3aa5181 100644 --- a/core/java/android/appwidget/AppWidgetManager.java +++ b/core/java/android/appwidget/AppWidgetManager.java @@ -320,6 +320,10 @@ public class AppWidgetManager { * It is okay to call this method both inside an {@link #ACTION_APPWIDGET_UPDATE} broadcast, * and outside of the handler. * This method will only work when called from the uid that owns the AppWidget provider. + * + * <p> + * The total Bitmap memory used by the RemoteViews object cannot exceed that required to + * fill the screen once, ie. (screen width x screen height x 4) bytes. * * @param appWidgetIds The AppWidget instances for which to set the RemoteViews. * @param views The RemoteViews object to show. @@ -385,6 +389,10 @@ public class AppWidgetManager { * and outside of the handler. * This method will only work when called from the uid that owns the AppWidget provider. * + * <p> + * The total Bitmap memory used by the RemoteViews object cannot exceed that required to + * fill the screen once, ie. (screen width x screen height x 4) bytes. + * * @param appWidgetId The AppWidget instance for which to set the RemoteViews. * @param views The RemoteViews object to show. */ diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 56c4bd8..51c957a 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -1445,7 +1445,8 @@ public class RemoteViews implements Parcelable, Filter { /** * Returns an estimate of the bitmap heap memory usage for this RemoteViews. */ - int estimateMemoryUsage() { + /** @hide */ + public int estimateMemoryUsage() { return mMemoryUsageCounter.getMemoryUsage(); } |