Wrapping console logs.

This commit is contained in:
Winson Chung
2014-05-20 16:21:31 -07:00
parent 3fff22173c
commit 10f8139d3b
11 changed files with 369 additions and 201 deletions

View File

@@ -64,10 +64,12 @@ public class AlternateRecentsComponent {
mSingleCountFirstTaskRect.offset(0, (int) statusBarHeight);
mMultipleCountFirstTaskRect = replyData.getParcelable(KEY_MULTIPLE_TASK_STACK_RECT);
mMultipleCountFirstTaskRect.offset(0, (int) statusBarHeight);
Console.log(Constants.Log.App.RecentsComponent,
"[RecentsComponent|RecentsMessageHandler|handleMessage]",
"singleTaskRect: " + mSingleCountFirstTaskRect +
" multipleTaskRect: " + mMultipleCountFirstTaskRect);
if (Console.Enabled) {
Console.log(Constants.Log.App.RecentsComponent,
"[RecentsComponent|RecentsMessageHandler|handleMessage]",
"singleTaskRect: " + mSingleCountFirstTaskRect +
" multipleTaskRect: " + mMultipleCountFirstTaskRect);
}
// If we had the update the animation rects as a result of onServiceConnected, then
// we check for whether we need to toggle the recents here.
@@ -83,9 +85,11 @@ public class AlternateRecentsComponent {
class RecentsServiceConnection implements ServiceConnection {
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
Console.log(Constants.Log.App.RecentsComponent,
"[RecentsComponent|ServiceConnection|onServiceConnected]",
"toggleRecents: " + mToggleRecentsUponServiceBound);
if (Console.Enabled) {
Console.log(Constants.Log.App.RecentsComponent,
"[RecentsComponent|ServiceConnection|onServiceConnected]",
"toggleRecents: " + mToggleRecentsUponServiceBound);
}
mService = new Messenger(service);
mServiceIsBound = true;
@@ -103,8 +107,10 @@ public class AlternateRecentsComponent {
@Override
public void onServiceDisconnected(ComponentName className) {
Console.log(Constants.Log.App.RecentsComponent,
"[RecentsComponent|ServiceConnection|onServiceDisconnected]");
if (Console.Enabled) {
Console.log(Constants.Log.App.RecentsComponent,
"[RecentsComponent|ServiceConnection|onServiceDisconnected]");
}
mService = null;
mServiceIsBound = false;
}
@@ -159,7 +165,9 @@ public class AlternateRecentsComponent {
}
public void onStart() {
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|start]");
if (Console.Enabled) {
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|start]");
}
// Try to create a long-running connection to the recents service
bindToRecentsService(false);
@@ -167,7 +175,9 @@ public class AlternateRecentsComponent {
/** Shows the recents */
public void onShowRecents(boolean triggeredFromAltTab, View statusBarView) {
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|showRecents]");
if (Console.Enabled) {
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|showRecents]");
}
mStatusBarView = statusBarView;
mTriggeredFromAltTab = triggeredFromAltTab;
if (!mServiceIsBound) {
@@ -186,7 +196,9 @@ public class AlternateRecentsComponent {
/** Hides the recents */
public void onHideRecents(boolean triggeredFromAltTab) {
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|hideRecents]");
if (Console.Enabled) {
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|hideRecents]");
}
if (mServiceIsBound) {
// Notify recents to close it
try {
@@ -202,12 +214,14 @@ public class AlternateRecentsComponent {
/** Toggles the alternate recents activity */
public void onToggleRecents(View statusBarView) {
Console.logStartTracingTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey);
Console.logStartTracingTime(Constants.Log.App.TimeRecentsLaunchTask,
Constants.Log.App.TimeRecentsLaunchKey);
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|toggleRecents]",
"serviceIsBound: " + mServiceIsBound);
if (Console.Enabled) {
Console.logStartTracingTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey);
Console.logStartTracingTime(Constants.Log.App.TimeRecentsLaunchTask,
Constants.Log.App.TimeRecentsLaunchKey);
Console.log(Constants.Log.App.RecentsComponent, "[RecentsComponent|toggleRecents]",
"serviceIsBound: " + mServiceIsBound);
}
mStatusBarView = statusBarView;
mTriggeredFromAltTab = false;
if (!mServiceIsBound) {

View File

@@ -42,6 +42,9 @@ public class Console {
public static final String AnsiCyan = "\u001B[36m"; // ClickEvents
public static final String AnsiWhite = "\u001B[37m";
// Console enabled state
public static final boolean Enabled = false;
/** Logs a key */
public static void log(String key) {
log(true, key, "", AnsiReset);

View File

@@ -80,8 +80,10 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|serviceBroadcast]", action, Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|serviceBroadcast]", action, Console.AnsiRed);
}
if (action.equals(RecentsService.ACTION_HIDE_RECENTS_ACTIVITY)) {
if (intent.getBooleanExtra(RecentsService.EXTRA_TRIGGERED_FROM_ALT_TAB, false)) {
// Dismiss recents, launching the focused task
@@ -164,10 +166,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
ssp.unbindSearchAppWidget(mAppWidgetHost, appWidgetId);
appWidgetId = -1;
}
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onCreate|settings|appWidgetId]",
"Id: " + appWidgetId,
Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onCreate|settings|appWidgetId]",
"Id: " + appWidgetId,
Console.AnsiBlue);
}
}
// If there is no id, then bind a new search app widget
@@ -175,10 +179,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
Pair<Integer, AppWidgetProviderInfo> widgetInfo =
ssp.bindSearchAppWidget(mAppWidgetHost);
if (widgetInfo != null) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onCreate|searchWidget]",
"Id: " + widgetInfo.first + " Info: " + widgetInfo.second,
Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onCreate|searchWidget]",
"Id: " + widgetInfo.first + " Info: " + widgetInfo.second,
Console.AnsiBlue);
}
// Save the app widget id into the settings
config.updateSearchBarAppWidgetId(this, widgetInfo.first);
@@ -194,10 +200,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
RecentsConfiguration config = RecentsConfiguration.getInstance();
int appWidgetId = config.searchBarAppWidgetId;
if (appWidgetId >= 0) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onCreate|addSearchAppWidgetView]",
"Id: " + appWidgetId,
Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onCreate|addSearchAppWidgetView]",
"Id: " + appWidgetId,
Console.AnsiBlue);
}
mSearchAppWidgetHostView = mAppWidgetHost.createView(this, appWidgetId,
mSearchAppWidgetInfo);
Bundle opts = new Bundle();
@@ -230,11 +238,13 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Console.logDivider(Constants.Log.App.SystemUIHandshake);
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onCreate]",
getIntent().getAction() + " visible: " + mVisible, Console.AnsiRed);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "onCreate");
if (Console.Enabled) {
Console.logDivider(Constants.Log.App.SystemUIHandshake);
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onCreate]",
getIntent().getAction() + " visible: " + mVisible, Console.AnsiRed);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "onCreate");
}
// Initialize the loader and the configuration
RecentsTaskLoader.initialize(this);
@@ -277,11 +287,13 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
// Reset the task launched flag if we encounter an onNewIntent() before onStop()
mTaskLaunched = false;
Console.logDivider(Constants.Log.App.SystemUIHandshake);
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onNewIntent]",
intent.getAction() + " visible: " + mVisible, Console.AnsiRed);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "onNewIntent");
if (Console.Enabled) {
Console.logDivider(Constants.Log.App.SystemUIHandshake);
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onNewIntent]",
intent.getAction() + " visible: " + mVisible, Console.AnsiRed);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "onNewIntent");
}
// Initialize the loader and the configuration
RecentsTaskLoader.initialize(this);
@@ -296,8 +308,10 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
protected void onStart() {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onStart]", "",
Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onStart]", "",
Console.AnsiRed);
}
super.onStart();
mAppWidgetHost.startListening();
mVisible = true;
@@ -305,16 +319,20 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
protected void onResume() {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onResume]", "",
Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onResume]", "",
Console.AnsiRed);
}
super.onResume();
}
@Override
public void onAttachedToWindow() {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onAttachedToWindow]", "",
Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onAttachedToWindow]", "",
Console.AnsiRed);
}
super.onAttachedToWindow();
// Register the broadcast receiver to handle messages from our service
@@ -334,9 +352,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
public void onDetachedFromWindow() {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onDetachedFromWindow]", "",
Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsActivity|onDetachedFromWindow]", "",
Console.AnsiRed);
}
super.onDetachedFromWindow();
// Unregister any broadcast receivers we have registered
@@ -347,15 +367,19 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
protected void onPause() {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onPause]", "",
Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onPause]", "",
Console.AnsiRed);
}
super.onPause();
}
@Override
protected void onStop() {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onStop]", "",
Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onStop]", "",
Console.AnsiRed);
}
super.onStop();
mAppWidgetHost.stopListening();
@@ -365,8 +389,10 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
@Override
protected void onDestroy() {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onDestroy]", "",
Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsActivity|onDestroy]", "",
Console.AnsiRed);
}
super.onDestroy();
}

View File

@@ -95,9 +95,11 @@ public class RecentsConfiguration {
Configuration.ORIENTATION_LANDSCAPE;
transposeSearchLayoutWithOrientation =
res.getBoolean(R.bool.recents_transpose_search_layout_with_orientation);
Console.log(Constants.Log.UI.MeasureAndLayout,
"[RecentsConfiguration|orientation]", isLandscape ? "Landscape" : "Portrait",
Console.AnsiGreen);
if (Console.Enabled) {
Console.log(Constants.Log.UI.MeasureAndLayout,
"[RecentsConfiguration|orientation]", isLandscape ? "Landscape" : "Portrait",
Console.AnsiGreen);
}
displayRect.set(0, 0, dm.widthPixels, dm.heightPixels);
animationPxMovementPerSecond =

View File

@@ -45,8 +45,10 @@ class SystemUIMessageHandler extends Handler {
@Override
public void handleMessage(Message msg) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsService|handleMessage]", msg);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake,
"[RecentsService|handleMessage]", msg);
}
Context context = mContext.get();
if (context == null) return;
@@ -139,31 +141,41 @@ public class RecentsService extends Service {
@Override
public void onCreate() {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onCreate]");
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onCreate]");
}
super.onCreate();
}
@Override
public IBinder onBind(Intent intent) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onBind]");
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onBind]");
}
return mSystemUIMessenger.getBinder();
}
@Override
public boolean onUnbind(Intent intent) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onUnbind]");
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onUnbind]");
}
return super.onUnbind(intent);
}
@Override
public void onRebind(Intent intent) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onRebind]");
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onRebind]");
}
super.onRebind(intent);
}
@Override
public void onDestroy() {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onDestroy]");
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsService|onDestroy]");
}
super.onDestroy();
}

View File

@@ -50,7 +50,9 @@ class TaskResourceLoadQueue {
/** Adds a new task to the load queue */
void addTask(Task t, boolean forceLoad) {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|addTask]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|addTask]");
}
if (!mQueue.contains(t)) {
mQueue.add(t);
}
@@ -67,7 +69,9 @@ class TaskResourceLoadQueue {
* force reloaded.
*/
Pair<Task, Boolean> nextTask() {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|nextTask]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|nextTask]");
}
Task task = mQueue.poll();
Boolean forceLoadTask = null;
if (task != null) {
@@ -81,14 +85,18 @@ class TaskResourceLoadQueue {
/** Removes a task from the load queue */
void removeTask(Task t) {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|removeTask]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|removeTask]");
}
mQueue.remove(t);
mForceLoadSet.remove(t.key);
}
/** Clears all the tasks from the load queue */
void clearTasks() {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|clearTasks]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, " [TaskResourceLoadQueue|clearTasks]");
}
mQueue.clear();
mForceLoadSet.clear();
}
@@ -131,7 +139,9 @@ class TaskResourceLoader implements Runnable {
/** Restarts the loader thread */
void start(Context context) {
Console.log(Constants.Log.App.TaskDataLoader, "[TaskResourceLoader|start]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, "[TaskResourceLoader|start]");
}
mContext = context;
mCancelled = false;
mSystemServicesProxy = new SystemServicesProxy(context);
@@ -143,7 +153,9 @@ class TaskResourceLoader implements Runnable {
/** Requests the loader thread to stop after the current iteration */
void stop() {
Console.log(Constants.Log.App.TaskDataLoader, "[TaskResourceLoader|stop]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, "[TaskResourceLoader|stop]");
}
// Mark as cancelled for the thread to pick up
mCancelled = true;
mSystemServicesProxy = null;
@@ -157,19 +169,25 @@ class TaskResourceLoader implements Runnable {
@Override
public void run() {
while (true) {
Console.log(Constants.Log.App.TaskDataLoader,
"[TaskResourceLoader|run|" + Thread.currentThread().getId() + "]");
if (mCancelled) {
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[TaskResourceLoader|cancel|" + Thread.currentThread().getId() + "]");
"[TaskResourceLoader|run|" + Thread.currentThread().getId() + "]");
}
if (mCancelled) {
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[TaskResourceLoader|cancel|" + Thread.currentThread().getId() + "]");
}
// We have to unset the context here, since the background thread may be using it
// when we call stop()
mContext = null;
// If we are cancelled, then wait until we are started again
synchronized(mLoadThread) {
try {
Console.log(Constants.Log.App.TaskDataLoader,
"[TaskResourceLoader|waitOnLoadThreadCancelled]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[TaskResourceLoader|waitOnLoadThreadCancelled]");
}
mLoadThread.wait();
} catch (InterruptedException ie) {
ie.printStackTrace();
@@ -185,10 +203,12 @@ class TaskResourceLoader implements Runnable {
if (t != null) {
Drawable loadIcon = mApplicationIconCache.get(t.key);
Bitmap loadThumbnail = mThumbnailCache.get(t.key);
Console.log(Constants.Log.App.TaskDataLoader,
" [TaskResourceLoader|load]",
t + " icon: " + loadIcon + " thumbnail: " + loadThumbnail +
" forceLoad: " + forceLoadTask);
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
" [TaskResourceLoader|load]",
t + " icon: " + loadIcon + " thumbnail: " + loadThumbnail +
" forceLoad: " + forceLoadTask);
}
// Load the application icon
if (loadIcon == null || forceLoadTask) {
ActivityInfo info = ssp.getActivityInfo(t.key.baseIntent.getComponent(),
@@ -196,9 +216,10 @@ class TaskResourceLoader implements Runnable {
Drawable icon = ssp.getActivityIcon(info, t.userId);
if (!mCancelled) {
if (icon != null) {
Console.log(Constants.Log.App.TaskDataLoader,
" [TaskResourceLoader|loadIcon]",
icon);
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
" [TaskResourceLoader|loadIcon]", icon);
}
loadIcon = icon;
mApplicationIconCache.put(t.key, icon);
}
@@ -209,9 +230,10 @@ class TaskResourceLoader implements Runnable {
Bitmap thumbnail = ssp.getTaskThumbnail(t.key.id);
if (!mCancelled) {
if (thumbnail != null) {
Console.log(Constants.Log.App.TaskDataLoader,
" [TaskResourceLoader|loadThumbnail]",
thumbnail);
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
" [TaskResourceLoader|loadThumbnail]", thumbnail);
}
thumbnail.setHasAlpha(false);
loadThumbnail = thumbnail;
mThumbnailCache.put(t.key, thumbnail);
@@ -239,8 +261,10 @@ class TaskResourceLoader implements Runnable {
if (!mCancelled && mLoadQueue.isEmpty()) {
synchronized(mLoadQueue) {
try {
Console.log(Constants.Log.App.TaskDataLoader,
"[TaskResourceLoader|waitOnLoadQueue]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[TaskResourceLoader|waitOnLoadQueue]");
}
mWaitingOnLoadQueue = true;
mLoadQueue.wait();
mWaitingOnLoadQueue = false;
@@ -320,9 +344,11 @@ public class RecentsTaskLoader {
int thumbnailCacheSize = Constants.DebugFlags.App.DisableBackgroundCache ? 1 :
mMaxThumbnailCacheSize;
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|init]", "thumbnailCache: " + thumbnailCacheSize +
" iconCache: " + iconCacheSize);
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|init]", "thumbnailCache: " + thumbnailCacheSize +
" iconCache: " + iconCacheSize);
}
// Initialize the proxy, cache and loaders
mSystemServicesProxy = new SystemServicesProxy(context);
@@ -338,9 +364,11 @@ public class RecentsTaskLoader {
mDefaultThumbnail = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
mDefaultThumbnail.eraseColor(0x00000000);
mDefaultApplicationIcon = new BitmapDrawable(context.getResources(), icon);
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|defaultBitmaps]",
"icon: " + mDefaultApplicationIcon + " thumbnail: " + mDefaultThumbnail, Console.AnsiRed);
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|defaultBitmaps]",
"icon: " + mDefaultApplicationIcon + " thumbnail: " + mDefaultThumbnail, Console.AnsiRed);
}
}
/** Initializes the recents task loader */
@@ -368,11 +396,13 @@ public class RecentsTaskLoader {
List<ActivityManager.RecentTaskInfo> tasks =
ssp.getRecentTasks(25, UserHandle.CURRENT.getIdentifier());
Collections.reverse(tasks);
Console.log(Constants.Log.App.TimeSystemCalls,
"[RecentsTaskLoader|getRecentTasks]",
"" + (System.currentTimeMillis() - t1) + "ms");
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|tasks]", "" + tasks.size());
if (Console.Enabled) {
Console.log(Constants.Log.App.TimeSystemCalls,
"[RecentsTaskLoader|getRecentTasks]",
"" + (System.currentTimeMillis() - t1) + "ms");
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|tasks]", "" + tasks.size());
}
return tasks;
}
@@ -381,7 +411,9 @@ public class RecentsTaskLoader {
SpaceNode reload(Context context, int preloadCount) {
long t1 = System.currentTimeMillis();
Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|reload]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|reload]");
}
Resources res = context.getResources();
ArrayList<Task> tasksToForceLoad = new ArrayList<Task>();
TaskStack stack = new TaskStack(context);
@@ -419,9 +451,11 @@ public class RecentsTaskLoader {
// Preload the specified number of apps
if (i >= (taskCount - preloadCount)) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|preloadTask]",
"i: " + i + " task: " + t.baseIntent.getComponent().getPackageName());
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|preloadTask]",
"i: " + i + " task: " + t.baseIntent.getComponent().getPackageName());
}
// Load the icon (if possible and not the foremost task, from the cache)
if (!isForemostTask) {
@@ -451,8 +485,10 @@ public class RecentsTaskLoader {
}
}
if (task.thumbnail == null) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|loadingTaskThumbnail]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|loadingTaskThumbnail]");
}
task.thumbnail = ssp.getTaskThumbnail(task.key.id);
if (task.thumbnail != null) {
task.thumbnail.setHasAlpha(false);
@@ -464,13 +500,17 @@ public class RecentsTaskLoader {
}
// Add the task to the stack
Console.log(Constants.Log.App.TaskDataLoader,
" [RecentsTaskLoader|task]", t.baseIntent.getComponent().getPackageName());
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
" [RecentsTaskLoader|task]", t.baseIntent.getComponent().getPackageName());
}
stack.addTask(task);
}
Console.log(Constants.Log.App.TimeSystemCalls,
"[RecentsTaskLoader|getAllTaskTopThumbnail]",
"" + (System.currentTimeMillis() - t1) + "ms");
if (Console.Enabled) {
Console.log(Constants.Log.App.TimeSystemCalls,
"[RecentsTaskLoader|getAllTaskTopThumbnail]",
"" + (System.currentTimeMillis() - t1) + "ms");
}
/*
// Get all the stacks
@@ -505,9 +545,11 @@ public class RecentsTaskLoader {
Drawable applicationIcon = mApplicationIconCache.get(t.key);
Bitmap thumbnail = mThumbnailCache.get(t.key);
Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|loadTask]",
t + " applicationIcon: " + applicationIcon + " thumbnail: " + thumbnail +
" thumbnailCacheSize: " + mThumbnailCache.size());
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|loadTask]",
t + " applicationIcon: " + applicationIcon + " thumbnail: " + thumbnail +
" thumbnailCacheSize: " + mThumbnailCache.size());
}
boolean requiresLoad = false;
if (applicationIcon == null) {
@@ -526,9 +568,11 @@ public class RecentsTaskLoader {
/** Releases the task resource data back into the pool. */
public void unloadTaskData(Task t) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|unloadTask]", t +
" thumbnailCacheSize: " + mThumbnailCache.size());
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|unloadTask]", t +
" thumbnailCacheSize: " + mThumbnailCache.size());
}
mLoadQueue.removeTask(t);
t.notifyTaskDataUnloaded(mDefaultThumbnail, mDefaultApplicationIcon);
@@ -536,8 +580,10 @@ public class RecentsTaskLoader {
/** Completely removes the resource data from the pool. */
public void deleteTaskData(Task t, boolean notifyTaskDataUnloaded) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|deleteTask]", t);
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader,
"[RecentsTaskLoader|deleteTask]", t);
}
mLoadQueue.removeTask(t);
mThumbnailCache.remove(t.key);
@@ -549,7 +595,9 @@ public class RecentsTaskLoader {
/** Stops the task loader and clears all pending tasks */
void stopLoader() {
Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|stopLoader]");
if (Console.Enabled) {
Console.log(Constants.Log.App.TaskDataLoader, "[RecentsTaskLoader|stopLoader]");
}
mLoader.stop();
mLoadQueue.clearTasks();
}
@@ -570,8 +618,10 @@ public class RecentsTaskLoader {
* out of memory.
*/
void onTrimMemory(int level) {
Console.log(Constants.Log.App.Memory, "[RecentsTaskLoader|onTrimMemory]",
Console.trimMemoryLevelToString(level));
if (Console.Enabled) {
Console.log(Constants.Log.App.Memory, "[RecentsTaskLoader|onTrimMemory]",
Console.trimMemoryLevelToString(level));
}
switch (level) {
case ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN:

View File

@@ -106,7 +106,8 @@ public class SystemServicesProxy {
rti.description = description;
if (i % 2 == 0) {
rti.taskDescription = new ActivityManager.TaskDescription(description,
Bitmap.createBitmap(mDummyIcon), new Random().nextInt());
Bitmap.createBitmap(mDummyIcon),
0xFF000000 | (0xFFFFFF & new Random().nextInt()));
} else {
rti.taskDescription = new ActivityManager.TaskDescription();
}

View File

@@ -110,16 +110,20 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
TaskView tv = (TaskView) stackView.getChildAt(j);
Task task = tv.getTask();
if (tv.isFocusedTask()) {
Console.log(Constants.Log.UI.Focus, "[RecentsView|launchFocusedTask]",
"Found focused Task");
if (Console.Enabled) {
Console.log(Constants.Log.UI.Focus, "[RecentsView|launchFocusedTask]",
"Found focused Task");
}
onTaskLaunched(stackView, tv, stack, task);
return true;
}
}
}
}
Console.log(Constants.Log.UI.Focus, "[RecentsView|launchFocusedTask]",
"No Tasks focused");
if (Console.Enabled) {
Console.log(Constants.Log.UI.Focus, "[RecentsView|launchFocusedTask]",
"No Tasks focused");
}
return false;
}
@@ -168,9 +172,11 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
mSearchBar.setVisibility(mHasTasks ? View.VISIBLE : View.GONE);
addView(mSearchBar);
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsView|setSearchBar]",
"" + (mSearchBar.getVisibility() == View.VISIBLE),
Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.App.SystemUIHandshake, "[RecentsView|setSearchBar]",
"" + (mSearchBar.getVisibility() == View.VISIBLE),
Console.AnsiBlue);
}
}
}
}
@@ -185,10 +191,12 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
int height = MeasureSpec.getSize(heightMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
Console.log(Constants.Log.UI.MeasureAndLayout, "[RecentsView|measure]",
"width: " + width + " height: " + height, Console.AnsiGreen);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "RecentsView.onMeasure");
if (Console.Enabled) {
Console.log(Constants.Log.UI.MeasureAndLayout, "[RecentsView|measure]",
"width: " + width + " height: " + height, Console.AnsiGreen);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "RecentsView.onMeasure");
}
// Get the search bar bounds and measure the search bar layout
RecentsConfiguration config = RecentsConfiguration.getInstance();
@@ -227,10 +235,12 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
*/
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
Console.log(Constants.Log.UI.MeasureAndLayout, "[RecentsView|layout]",
new Rect(left, top, right, bottom) + " changed: " + changed, Console.AnsiGreen);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "RecentsView.onLayout");
if (Console.Enabled) {
Console.log(Constants.Log.UI.MeasureAndLayout, "[RecentsView|layout]",
new Rect(left, top, right, bottom) + " changed: " + changed, Console.AnsiGreen);
Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,
Constants.Log.App.TimeRecentsStartupKey, "RecentsView.onLayout");
}
// Get the search bar bounds so that we lay it out
RecentsConfiguration config = RecentsConfiguration.getInstance();
@@ -283,15 +293,19 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
@Override
protected void dispatchDraw(Canvas canvas) {
Console.log(Constants.Log.UI.Draw, "[RecentsView|dispatchDraw]", "",
Console.AnsiPurple);
if (Console.Enabled) {
Console.log(Constants.Log.UI.Draw, "[RecentsView|dispatchDraw]", "",
Console.AnsiPurple);
}
super.dispatchDraw(canvas);
}
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
Console.log(Constants.Log.UI.MeasureAndLayout,
"[RecentsView|fitSystemWindows]", "insets: " + insets, Console.AnsiGreen);
if (Console.Enabled) {
Console.log(Constants.Log.UI.MeasureAndLayout,
"[RecentsView|fitSystemWindows]", "insets: " + insets, Console.AnsiGreen);
}
// Update the configuration with the latest system insets and trigger a relayout
RecentsConfiguration config = RecentsConfiguration.getInstance();

View File

@@ -178,9 +178,11 @@ public class SwipeHelper {
}
public boolean onInterceptTouchEvent(MotionEvent ev) {
Console.log(Constants.Log.UI.TouchEvents,
"[SwipeHelper|interceptTouchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.UI.TouchEvents,
"[SwipeHelper|interceptTouchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
}
final int action = ev.getAction();
switch (action) {
@@ -291,9 +293,11 @@ public class SwipeHelper {
}
public boolean onTouchEvent(MotionEvent ev) {
Console.log(Constants.Log.UI.TouchEvents,
"[SwipeHelper|touchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.UI.TouchEvents,
"[SwipeHelper|touchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
}
if (!mDragging) {
if (!onInterceptTouchEvent(ev)) {

View File

@@ -114,8 +114,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
requestSynchronizeStackViewsWithModel(0);
}
void requestSynchronizeStackViewsWithModel(int duration) {
Console.log(Constants.Log.TaskStack.SynchronizeViewsWithModel,
"[TaskStackView|requestSynchronize]", "" + duration + "ms", Console.AnsiYellow);
if (Console.Enabled) {
Console.log(Constants.Log.TaskStack.SynchronizeViewsWithModel,
"[TaskStackView|requestSynchronize]", "" + duration + "ms", Console.AnsiYellow);
}
if (!mStackViewsDirty) {
invalidate();
}
@@ -222,9 +224,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
/** Synchronizes the views with the model */
void synchronizeStackViewsWithModel() {
Console.log(Constants.Log.TaskStack.SynchronizeViewsWithModel,
"[TaskStackView|synchronizeViewsWithModel]",
"mStackViewsDirty: " + mStackViewsDirty, Console.AnsiYellow);
if (Console.Enabled) {
Console.log(Constants.Log.TaskStack.SynchronizeViewsWithModel,
"[TaskStackView|synchronizeViewsWithModel]",
"mStackViewsDirty: " + mStackViewsDirty, Console.AnsiYellow);
}
if (mStackViewsDirty) {
// XXX: Consider using TaskViewTransform pool to prevent allocations
// XXX: Iterate children views, update transforms and remove all that are not visible
@@ -278,8 +282,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
}
Console.log(Constants.Log.TaskStack.SynchronizeViewsWithModel,
" [TaskStackView|viewChildren]", "" + getChildCount());
if (Console.Enabled) {
Console.log(Constants.Log.TaskStack.SynchronizeViewsWithModel,
" [TaskStackView|viewChildren]", "" + getChildCount());
}
mStackViewsAnimationDuration = 0;
mStackViewsDirty = false;
@@ -472,7 +478,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
/** Focuses the task at the specified index in the stack */
void focusTask(int taskIndex, boolean scrollToNewPosition) {
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusTask]", "" + taskIndex);
if (Console.Enabled) {
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusTask]", "" + taskIndex);
}
if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) {
mFocusedTaskIndex = taskIndex;
@@ -482,7 +490,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
Runnable postScrollRunnable = null;
if (tv != null) {
tv.setFocusedTask();
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusTask]", "Requesting focus");
if (Console.Enabled) {
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusTask]", "Requesting focus");
}
} else {
postScrollRunnable = new Runnable() {
@Override
@@ -491,8 +501,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
TaskView tv = getChildViewForTask(t);
if (tv != null) {
tv.setFocusedTask();
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusTask]",
"Requesting focus after scroll animation");
if (Console.Enabled) {
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusTask]",
"Requesting focus after scroll animation");
}
}
}
};
@@ -514,7 +526,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
/** Focuses the next task in the stack */
void focusNextTask(boolean forward) {
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusNextTask]", "" + mFocusedTaskIndex);
if (Console.Enabled) {
Console.log(Constants.Log.UI.Focus, "[TaskStackView|focusNextTask]", "" +
mFocusedTaskIndex);
}
// Find the next index to focus
int numTasks = mStack.getTaskCount();
@@ -530,9 +545,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
/** Enables the hw layers and increments the hw layer requirement ref count */
void addHwLayersRefCount(String reason) {
Console.log(Constants.Log.UI.HwLayers,
"[TaskStackView|addHwLayersRefCount] refCount: " +
mHwLayersRefCount + "->" + (mHwLayersRefCount + 1) + " " + reason);
if (Console.Enabled) {
Console.log(Constants.Log.UI.HwLayers,
"[TaskStackView|addHwLayersRefCount] refCount: " +
mHwLayersRefCount + "->" + (mHwLayersRefCount + 1) + " " + reason);
}
if (mHwLayersRefCount == 0) {
// Enable hw layers on each of the children
int childCount = getChildCount();
@@ -547,9 +564,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
/** Decrements the hw layer requirement ref count and disables the hw layers when we don't
need them anymore. */
void decHwLayersRefCount(String reason) {
Console.log(Constants.Log.UI.HwLayers,
"[TaskStackView|decHwLayersRefCount] refCount: " +
mHwLayersRefCount + "->" + (mHwLayersRefCount - 1) + " " + reason);
if (Console.Enabled) {
Console.log(Constants.Log.UI.HwLayers,
"[TaskStackView|decHwLayersRefCount] refCount: " +
mHwLayersRefCount + "->" + (mHwLayersRefCount - 1) + " " + reason);
}
mHwLayersRefCount--;
if (mHwLayersRefCount == 0) {
// Disable hw layers on each of the children
@@ -589,8 +608,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
@Override
public void dispatchDraw(Canvas canvas) {
Console.log(Constants.Log.UI.Draw, "[TaskStackView|dispatchDraw]", "",
Console.AnsiPurple);
if (Console.Enabled) {
Console.log(Constants.Log.UI.Draw, "[TaskStackView|dispatchDraw]", "",
Console.AnsiPurple);
}
synchronizeStackViewsWithModel();
super.dispatchDraw(canvas);
}
@@ -674,9 +695,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
Console.log(Constants.Log.UI.MeasureAndLayout, "[TaskStackView|measure]",
"width: " + width + " height: " + height +
" awaitingFirstLayout: " + mAwaitingFirstLayout, Console.AnsiGreen);
if (Console.Enabled) {
Console.log(Constants.Log.UI.MeasureAndLayout, "[TaskStackView|measure]",
"width: " + width + " height: " + height +
" awaitingFirstLayout: " + mAwaitingFirstLayout, Console.AnsiGreen);
}
// Compute our stack/task rects
RecentsConfiguration config = RecentsConfiguration.getInstance();
@@ -731,8 +754,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
*/
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
Console.log(Constants.Log.UI.MeasureAndLayout, "[TaskStackView|layout]",
"" + new Rect(left, top, right, bottom), Console.AnsiGreen);
if (Console.Enabled) {
Console.log(Constants.Log.UI.MeasureAndLayout, "[TaskStackView|layout]",
"" + new Rect(left, top, right, bottom), Console.AnsiGreen);
}
// Debug logging
if (Constants.Log.UI.MeasureAndLayout) {
@@ -1004,7 +1029,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
@Override
public TaskView createView(Context context) {
Console.log(Constants.Log.ViewPool.PoolCallbacks, "[TaskStackView|createPoolView]");
if (Console.Enabled) {
Console.log(Constants.Log.ViewPool.PoolCallbacks, "[TaskStackView|createPoolView]");
}
return (TaskView) mInflater.inflate(R.layout.recents_task_view, this, false);
}
@@ -1012,8 +1039,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
public void prepareViewToEnterPool(TaskView tv) {
Task task = tv.getTask();
tv.resetViewProperties();
Console.log(Constants.Log.ViewPool.PoolCallbacks, "[TaskStackView|returnToPool]",
tv.getTask() + " tv: " + tv);
if (Console.Enabled) {
Console.log(Constants.Log.ViewPool.PoolCallbacks, "[TaskStackView|returnToPool]",
tv.getTask() + " tv: " + tv);
}
// Report that this tasks's data is no longer being used
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
@@ -1028,8 +1057,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
@Override
public void prepareViewToLeavePool(TaskView tv, Task prepareData, boolean isNewView) {
Console.log(Constants.Log.ViewPool.PoolCallbacks, "[TaskStackView|leavePool]",
"isNewView: " + isNewView);
if (Console.Enabled) {
Console.log(Constants.Log.ViewPool.PoolCallbacks, "[TaskStackView|leavePool]",
"isNewView: " + isNewView);
}
// Setup and attach the view to the window
Task task = prepareData;
@@ -1051,8 +1082,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
// Add/attach the view to the hierarchy
Console.log(Constants.Log.ViewPool.PoolCallbacks, " [TaskStackView|insertIndex]",
"" + insertIndex);
if (Console.Enabled) {
Console.log(Constants.Log.ViewPool.PoolCallbacks, " [TaskStackView|insertIndex]",
"" + insertIndex);
}
if (isNewView) {
addView(tv, insertIndex);
@@ -1081,9 +1114,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
@Override
public void onTaskIconClicked(TaskView tv) {
Console.log(Constants.Log.UI.ClickEvents, "[TaskStack|Clicked|Icon]",
tv.getTask() + " is currently filtered: " + mStack.hasFilteredTasks(),
Console.AnsiCyan);
if (Console.Enabled) {
Console.log(Constants.Log.UI.ClickEvents, "[TaskStack|Clicked|Icon]",
tv.getTask() + " is currently filtered: " + mStack.hasFilteredTasks(),
Console.AnsiCyan);
}
if (Constants.DebugFlags.App.EnableTaskFiltering) {
if (mStack.hasFilteredTasks()) {
mStack.unfilterTasks();
@@ -1126,8 +1161,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
public void onClick(View v) {
TaskView tv = (TaskView) v;
Task task = tv.getTask();
Console.log(Constants.Log.UI.ClickEvents, "[TaskStack|Clicked|Thumbnail]",
task + " cb: " + mCb);
if (Console.Enabled) {
Console.log(Constants.Log.UI.ClickEvents, "[TaskStack|Clicked|Thumbnail]",
task + " cb: " + mCb);
}
// Close any open info panes if the user taps on another task
if (closeOpenInfoPanes()) {
@@ -1278,9 +1315,11 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
/** Touch preprocessing for handling below */
public boolean onInterceptTouchEvent(MotionEvent ev) {
Console.log(Constants.Log.UI.TouchEvents,
"[TaskStackViewTouchHandler|interceptTouchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.UI.TouchEvents,
"[TaskStackViewTouchHandler|interceptTouchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
}
// Return early if we have no children
boolean hasChildren = (mSv.getChildCount() > 0);
@@ -1362,9 +1401,11 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
/** Handles touch events once we have intercepted them */
public boolean onTouchEvent(MotionEvent ev) {
Console.log(Constants.Log.UI.TouchEvents,
"[TaskStackViewTouchHandler|touchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
if (Console.Enabled) {
Console.log(Constants.Log.UI.TouchEvents,
"[TaskStackViewTouchHandler|touchEvent]",
Console.motionEventActionToString(ev.getAction()), Console.AnsiBlue);
}
// Short circuit if we have no children
boolean hasChildren = (mSv.getChildCount() > 0);
@@ -1465,12 +1506,14 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
Math.abs((float) velocity / mMaximumVelocity)) *
Constants.Values.TaskStackView.TaskStackOverscrollRange);
Console.log(Constants.Log.UI.TouchEvents,
"[TaskStackViewTouchHandler|fling]",
"scroll: " + mSv.getStackScroll() + " velocity: " + velocity +
" maxVelocity: " + mMaximumVelocity +
" overscrollRange: " + overscrollRange,
Console.AnsiGreen);
if (Console.Enabled) {
Console.log(Constants.Log.UI.TouchEvents,
"[TaskStackViewTouchHandler|fling]",
"scroll: " + mSv.getStackScroll() + " velocity: " + velocity +
" maxVelocity: " + mMaximumVelocity +
" overscrollRange: " + overscrollRange,
Console.AnsiGreen);
}
// Fling scroll
mSv.mScroller.fling(0, mSv.getStackScroll(),

View File

@@ -354,7 +354,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.On
float dim = (1f - getScaleX()) / scaleRange;
dim = mDimInterpolator.getInterpolation(Math.min(dim, 1f));
mDim = Math.max(0, Math.min(mMaxDim, (int) (dim * 255)));
invalidate();
}
@Override