From 57e4d44f095fbcec7c614a45181d3e531e1bda26 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 15 Sep 2011 17:43:34 -0700 Subject: Speeding up Recent Apps - removing unused calls on startup - no longer compositing bitmaps against a background bitmap Change-Id: If26812ef475d5d972d98dd1cb9f7f741eeb99dae --- .../res/layout-land/status_bar_recent_item.xml | 4 ++-- .../res/layout-port/status_bar_recent_item.xml | 4 ++-- .../res/layout-sw600dp/status_bar_recent_item.xml | 4 ++-- .../android/systemui/recent/RecentsPanelView.java | 24 ++++------------------ 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml index 167d362f3840..c6966f9b64a1 100644 --- a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml +++ b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml @@ -40,8 +40,8 @@ android:background="@drawable/recents_thumbnail_bg" android:foreground="@drawable/recents_thumbnail_fg"> diff --git a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml index de80a51adb52..586712f0cea9 100644 --- a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml +++ b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml @@ -38,8 +38,8 @@ android:background="@drawable/recents_thumbnail_bg" android:foreground="@drawable/recents_thumbnail_fg"> diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml index 07088d54546a..cd8ccd56e782 100644 --- a/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml +++ b/packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml @@ -33,8 +33,8 @@ android:background="@drawable/recents_thumbnail_bg" android:foreground="@drawable/recents_thumbnail_fg"> diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java index 0621b2203a80..9bda158d5f35 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java @@ -128,7 +128,7 @@ public class RecentsPanelView extends RelativeLayout } public void setThumbnail(Bitmap thumbnail) { - mThumbnail = compositeBitmap(mDefaultThumbnailBackground, thumbnail); + mThumbnail = thumbnail; } public Bitmap getThumbnail() { @@ -478,13 +478,10 @@ public class RecentsPanelView extends RelativeLayout if (resolveInfo != null) { final ActivityInfo info = resolveInfo.activityInfo; final String title = info.loadLabel(pm).toString(); - // Drawable icon = info.loadIcon(pm); Drawable icon = getFullResIcon(resolveInfo, pm); if (title != null && title.length() > 0 && icon != null) { if (DEBUG) Log.v(TAG, "creating activity desc for id=" + recentInfo.id + ", label=" + title); - ActivityManager.TaskThumbnails thumbs = am.getTaskThumbnails( - recentInfo.persistentId); ActivityDescription item = new ActivityDescription(recentInfo, resolveInfo, intent, index, info.packageName); activityDescriptions.add(item); @@ -523,7 +520,9 @@ public class RecentsPanelView extends RelativeLayout synchronized (ad) { ad.mLabel = label; ad.mIcon = icon; - ad.setThumbnail(thumbs != null ? thumbs.mainThumbnail : mDefaultThumbnailBackground); + if (thumbs != null && thumbs.mainThumbnail != null) { + ad.setThumbnail(thumbs.mainThumbnail); + } } } @@ -651,21 +650,6 @@ public class RecentsPanelView extends RelativeLayout } } - private Bitmap compositeBitmap(Bitmap background, Bitmap thumbnail) { - Bitmap outBitmap = background.copy(background.getConfig(), true); - if (thumbnail != null) { - Canvas canvas = new Canvas(outBitmap); - Paint paint = new Paint(); - paint.setAntiAlias(true); - paint.setFilterBitmap(true); - paint.setAlpha(255); - canvas.drawBitmap(thumbnail, null, - new RectF(0, 0, outBitmap.getWidth(), outBitmap.getHeight()), paint); - canvas.setBitmap(null); - } - return outBitmap; - } - private void updateUiElements(Configuration config) { final int items = mActivityDescriptions.size(); -- cgit v1.2.3-59-g8ed1b