Loading packages/SystemUI/src/com/android/systemui/recents/Constants.java +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class Constants { // For debugging, this defines the number of mock recents packages to create public static final int SystemServicesProxyMockPackageCount = 3; // For debugging, this defines the number of mock recents tasks to create public static final int SystemServicesProxyMockTaskCount = 75; public static final int SystemServicesProxyMockTaskCount = 100; } } Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +1 −6 Original line number Diff line number Diff line Loading @@ -605,14 +605,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } @Override public void onTaskLaunching(boolean isTaskInStackBounds) { public void onTaskLaunching() { mTaskLaunched = true; // Fade out the scrim if (!isTaskInStackBounds && mConfig.hasNavBarScrim()) { onExitAnimationTriggered(); } // Mark recents as no longer visible AlternateRecentsComponent.notifyVisibilityChanged(false); } Loading packages/SystemUI/src/com/android/systemui/recents/RecentsTaskLoader.java +15 −6 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ class TaskResourceLoader implements Runnable { TaskResourceLoadQueue mLoadQueue; DrawableLruCache mApplicationIconCache; BitmapLruCache mThumbnailCache; Bitmap mDefaultThumbnail; boolean mCancelled; boolean mWaitingOnLoadQueue; Loading @@ -125,10 +126,12 @@ class TaskResourceLoader implements Runnable { /** Constructor, creates a new loading thread that loads task resources in the background */ public TaskResourceLoader(TaskResourceLoadQueue loadQueue, DrawableLruCache applicationIconCache, BitmapLruCache thumbnailCache) { BitmapLruCache thumbnailCache, Bitmap defaultThumbnail) { mLoadQueue = loadQueue; mApplicationIconCache = applicationIconCache; mThumbnailCache = thumbnailCache; mDefaultThumbnail = defaultThumbnail; mMainThreadHandler = new Handler(); mLoadThread = new HandlerThread("Recents-TaskResourceLoader"); mLoadThread.setPriority(Thread.NORM_PRIORITY - 1); Loading Loading @@ -238,6 +241,7 @@ class TaskResourceLoader implements Runnable { loadThumbnail = thumbnail; mThumbnailCache.put(t.key, thumbnail); } else { loadThumbnail = mDefaultThumbnail; Console.logError(mContext, "Failed to load task top thumbnail for: " + t.key.baseIntent.getComponent().getPackageName()); Loading Loading @@ -330,6 +334,7 @@ public class RecentsTaskLoader { BitmapDrawable mDefaultApplicationIcon; Bitmap mDefaultThumbnail; Bitmap mLoadingThumbnail; /** Private Constructor */ private RecentsTaskLoader(Context context) { Loading @@ -356,18 +361,22 @@ public class RecentsTaskLoader { mLoadQueue = new TaskResourceLoadQueue(); mApplicationIconCache = new DrawableLruCache(iconCacheSize); mThumbnailCache = new BitmapLruCache(thumbnailCacheSize); mLoader = new TaskResourceLoader(mLoadQueue, mApplicationIconCache, mThumbnailCache); mLoader = new TaskResourceLoader(mLoadQueue, mApplicationIconCache, mThumbnailCache, mDefaultThumbnail); // Create the default assets Bitmap icon = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); icon.eraseColor(0x00000000); mDefaultThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); mDefaultThumbnail.eraseColor(0x00000000); mDefaultThumbnail.eraseColor(0xFFffffff); mLoadingThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); mLoadingThumbnail.eraseColor(0x00000000); mDefaultApplicationIcon = new BitmapDrawable(context.getResources(), icon); if (Console.Enabled) { Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|defaultBitmaps]", "icon: " + mDefaultApplicationIcon + " thumbnail: " + mDefaultThumbnail, Console.AnsiRed); "icon: " + mDefaultApplicationIcon + " default thumbnail: " + mDefaultThumbnail, Console.AnsiRed); } } Loading @@ -394,7 +403,7 @@ public class RecentsTaskLoader { SystemServicesProxy ssp = mSystemServicesProxy; List<ActivityManager.RecentTaskInfo> tasks = ssp.getRecentTasks(100, UserHandle.CURRENT.getIdentifier()); ssp.getRecentTasks(50, UserHandle.CURRENT.getIdentifier()); Collections.reverse(tasks); if (Console.Enabled) { Console.log(Constants.Log.App.TimeSystemCalls, Loading Loading @@ -544,7 +553,7 @@ public class RecentsTaskLoader { requiresLoad = true; } if (thumbnail == null) { thumbnail = mDefaultThumbnail; thumbnail = mLoadingThumbnail; requiresLoad = true; } if (requiresLoad) { Loading packages/SystemUI/src/com/android/systemui/recents/views/FullScreenTransitionView.java +5 −4 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; Loading @@ -49,8 +50,8 @@ public class FullScreenTransitionView extends FrameLayout { FullScreenTransitionViewCallbacks mCb; ImageView mScreenshotView; Rect mClipRect = new Rect(); Paint mLayerPaint = new Paint(); boolean mIsAnimating; AnimatorSet mEnterAnimation; Loading Loading @@ -159,7 +160,7 @@ public class FullScreenTransitionView extends FrameLayout { int clipBottom = mConfig.systemInsets.top + (int) (ctx.taskRect.height() / scale); // Enable the HW Layers on the screenshot view mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, null); mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, mLayerPaint); // Compose the animation mEnterAnimation = new AnimatorSet(); Loading @@ -173,7 +174,7 @@ public class FullScreenTransitionView extends FrameLayout { // Mark that we are no longer animating mIsAnimating = false; // Disable the HW Layers on this view setLayerType(View.LAYER_TYPE_NONE, null); setLayerType(View.LAYER_TYPE_NONE, mLayerPaint); if (Console.Enabled) { Console.logTraceTime(Constants.Log.App.TimeRecentsScreenshotTransition, Loading Loading @@ -217,7 +218,7 @@ public class FullScreenTransitionView extends FrameLayout { // Mark that we are no longer animating mIsAnimating = false; // Disable the HW Layers on the screenshot view mScreenshotView.setLayerType(View.LAYER_TYPE_NONE, null); mScreenshotView.setLayerType(View.LAYER_TYPE_NONE, mLayerPaint); } }); mEnterAnimation.setDuration(475); Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +2 −6 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV /** The RecentsView callbacks */ public interface RecentsViewCallbacks { public void onTaskLaunching(boolean isTaskInStackBounds); public void onTaskLaunching(); public void onExitAnimationTriggered(); } Loading Loading @@ -389,11 +389,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV final TaskStack stack, final Task task) { // Notify any callbacks of the launching of a new task if (mCb != null) { boolean isTaskInStackBounds = false; if (stackView != null && tv != null) { isTaskInStackBounds = stackView.isTaskInStackBounds(tv); } mCb.onTaskLaunching(isTaskInStackBounds); mCb.onTaskLaunching(); } final Runnable launchRunnable = new Runnable() { Loading Loading
packages/SystemUI/src/com/android/systemui/recents/Constants.java +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class Constants { // For debugging, this defines the number of mock recents packages to create public static final int SystemServicesProxyMockPackageCount = 3; // For debugging, this defines the number of mock recents tasks to create public static final int SystemServicesProxyMockTaskCount = 75; public static final int SystemServicesProxyMockTaskCount = 100; } } Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +1 −6 Original line number Diff line number Diff line Loading @@ -605,14 +605,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } @Override public void onTaskLaunching(boolean isTaskInStackBounds) { public void onTaskLaunching() { mTaskLaunched = true; // Fade out the scrim if (!isTaskInStackBounds && mConfig.hasNavBarScrim()) { onExitAnimationTriggered(); } // Mark recents as no longer visible AlternateRecentsComponent.notifyVisibilityChanged(false); } Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsTaskLoader.java +15 −6 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ class TaskResourceLoader implements Runnable { TaskResourceLoadQueue mLoadQueue; DrawableLruCache mApplicationIconCache; BitmapLruCache mThumbnailCache; Bitmap mDefaultThumbnail; boolean mCancelled; boolean mWaitingOnLoadQueue; Loading @@ -125,10 +126,12 @@ class TaskResourceLoader implements Runnable { /** Constructor, creates a new loading thread that loads task resources in the background */ public TaskResourceLoader(TaskResourceLoadQueue loadQueue, DrawableLruCache applicationIconCache, BitmapLruCache thumbnailCache) { BitmapLruCache thumbnailCache, Bitmap defaultThumbnail) { mLoadQueue = loadQueue; mApplicationIconCache = applicationIconCache; mThumbnailCache = thumbnailCache; mDefaultThumbnail = defaultThumbnail; mMainThreadHandler = new Handler(); mLoadThread = new HandlerThread("Recents-TaskResourceLoader"); mLoadThread.setPriority(Thread.NORM_PRIORITY - 1); Loading Loading @@ -238,6 +241,7 @@ class TaskResourceLoader implements Runnable { loadThumbnail = thumbnail; mThumbnailCache.put(t.key, thumbnail); } else { loadThumbnail = mDefaultThumbnail; Console.logError(mContext, "Failed to load task top thumbnail for: " + t.key.baseIntent.getComponent().getPackageName()); Loading Loading @@ -330,6 +334,7 @@ public class RecentsTaskLoader { BitmapDrawable mDefaultApplicationIcon; Bitmap mDefaultThumbnail; Bitmap mLoadingThumbnail; /** Private Constructor */ private RecentsTaskLoader(Context context) { Loading @@ -356,18 +361,22 @@ public class RecentsTaskLoader { mLoadQueue = new TaskResourceLoadQueue(); mApplicationIconCache = new DrawableLruCache(iconCacheSize); mThumbnailCache = new BitmapLruCache(thumbnailCacheSize); mLoader = new TaskResourceLoader(mLoadQueue, mApplicationIconCache, mThumbnailCache); mLoader = new TaskResourceLoader(mLoadQueue, mApplicationIconCache, mThumbnailCache, mDefaultThumbnail); // Create the default assets Bitmap icon = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); icon.eraseColor(0x00000000); mDefaultThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); mDefaultThumbnail.eraseColor(0x00000000); mDefaultThumbnail.eraseColor(0xFFffffff); mLoadingThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); mLoadingThumbnail.eraseColor(0x00000000); mDefaultApplicationIcon = new BitmapDrawable(context.getResources(), icon); if (Console.Enabled) { Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|defaultBitmaps]", "icon: " + mDefaultApplicationIcon + " thumbnail: " + mDefaultThumbnail, Console.AnsiRed); "icon: " + mDefaultApplicationIcon + " default thumbnail: " + mDefaultThumbnail, Console.AnsiRed); } } Loading @@ -394,7 +403,7 @@ public class RecentsTaskLoader { SystemServicesProxy ssp = mSystemServicesProxy; List<ActivityManager.RecentTaskInfo> tasks = ssp.getRecentTasks(100, UserHandle.CURRENT.getIdentifier()); ssp.getRecentTasks(50, UserHandle.CURRENT.getIdentifier()); Collections.reverse(tasks); if (Console.Enabled) { Console.log(Constants.Log.App.TimeSystemCalls, Loading Loading @@ -544,7 +553,7 @@ public class RecentsTaskLoader { requiresLoad = true; } if (thumbnail == null) { thumbnail = mDefaultThumbnail; thumbnail = mLoadingThumbnail; requiresLoad = true; } if (requiresLoad) { Loading
packages/SystemUI/src/com/android/systemui/recents/views/FullScreenTransitionView.java +5 −4 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.animation.ObjectAnimator; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; Loading @@ -49,8 +50,8 @@ public class FullScreenTransitionView extends FrameLayout { FullScreenTransitionViewCallbacks mCb; ImageView mScreenshotView; Rect mClipRect = new Rect(); Paint mLayerPaint = new Paint(); boolean mIsAnimating; AnimatorSet mEnterAnimation; Loading Loading @@ -159,7 +160,7 @@ public class FullScreenTransitionView extends FrameLayout { int clipBottom = mConfig.systemInsets.top + (int) (ctx.taskRect.height() / scale); // Enable the HW Layers on the screenshot view mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, null); mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, mLayerPaint); // Compose the animation mEnterAnimation = new AnimatorSet(); Loading @@ -173,7 +174,7 @@ public class FullScreenTransitionView extends FrameLayout { // Mark that we are no longer animating mIsAnimating = false; // Disable the HW Layers on this view setLayerType(View.LAYER_TYPE_NONE, null); setLayerType(View.LAYER_TYPE_NONE, mLayerPaint); if (Console.Enabled) { Console.logTraceTime(Constants.Log.App.TimeRecentsScreenshotTransition, Loading Loading @@ -217,7 +218,7 @@ public class FullScreenTransitionView extends FrameLayout { // Mark that we are no longer animating mIsAnimating = false; // Disable the HW Layers on the screenshot view mScreenshotView.setLayerType(View.LAYER_TYPE_NONE, null); mScreenshotView.setLayerType(View.LAYER_TYPE_NONE, mLayerPaint); } }); mEnterAnimation.setDuration(475); Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +2 −6 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV /** The RecentsView callbacks */ public interface RecentsViewCallbacks { public void onTaskLaunching(boolean isTaskInStackBounds); public void onTaskLaunching(); public void onExitAnimationTriggered(); } Loading Loading @@ -389,11 +389,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV final TaskStack stack, final Task task) { // Notify any callbacks of the launching of a new task if (mCb != null) { boolean isTaskInStackBounds = false; if (stackView != null && tv != null) { isTaskInStackBounds = stackView.isTaskInStackBounds(tv); } mCb.onTaskLaunching(isTaskInStackBounds); mCb.onTaskLaunching(); } final Runnable launchRunnable = new Runnable() { Loading