am 080d9b61: Adjust logging of launcher2 launch times, and make all apps loading wait a little longer, even though usually it happens later anyway.

Merge commit '080d9b614e609826dce2606f9e474af674ead933' into eclair-mr2

* commit '080d9b614e609826dce2606f9e474af674ead933':
  Adjust logging of launcher2 launch times, and make all apps loading wait a little longer,
This commit is contained in:
Joe Onorato
2009-11-02 10:06:20 -08:00
committed by Android Git Automerger
5 changed files with 40 additions and 16 deletions
+3 -2
View File
@@ -177,10 +177,11 @@ public class AllAppsView extends RSSurfaceView
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
super.surfaceChanged(holder, format, w, h);
Log.d(TAG, "starting surfaceChanged");
long startTime = SystemClock.uptimeMillis();
super.surfaceChanged(holder, format, w, h);
if (mRS != null) {
destroyRenderScript();
mRS = null;
+9 -6
View File
@@ -46,6 +46,7 @@ import android.os.MessageQueue;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.provider.LiveFolders;
import android.text.Selection;
import android.text.SpannableStringBuilder;
@@ -197,8 +198,12 @@ public final class Launcher extends Activity
private static HashMap<Long, FolderInfo> mFolders = new HashMap();
private ArrayList<ApplicationInfo> mAllAppsList = new ArrayList();
public static long lastStartTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
lastStartTime = SystemClock.uptimeMillis();
super.onCreate(savedInstanceState);
mModel = ((LauncherApplication)getApplication()).setLauncher(this);
@@ -394,6 +399,10 @@ public final class Launcher extends Activity
@Override
protected void onResume() {
if (lastStartTime == 0) {
lastStartTime = SystemClock.uptimeMillis();
}
super.onResume();
if (mRestoring) {
@@ -1926,12 +1935,6 @@ public final class Launcher extends Activity
mSavedInstanceState = null;
}
/* TODO
if (mAllAppsVisible && !mDrawer.hasFocus()) {
mDrawer.requestFocus();
}
*/
Log.d(TAG, "finishBindingItems done");
mWorkspaceLoading = false;
}
+1 -1
View File
@@ -505,7 +505,7 @@ public class LauncherModel extends BroadcastReceiver {
// This way we don't start loading all apps until the workspace has settled
// down.
synchronized (LoaderThread.this) {
mHandler.post(new Runnable() {
mHandler.postIdle(new Runnable() {
public void run() {
synchronized (LoaderThread.this) {
mWorkspaceDoneBinding = true;
+5 -5
View File
@@ -380,8 +380,6 @@ final class Utilities {
rectPaint.setColor(0xff000000);
rectPaint.setAntiAlias(true);
Log.d(TAG, "scale=" + scale + " textSize=" + (13*scale));
TextPaint textPaint = mTextPaint = new TextPaint();
textPaint.setTypeface(Typeface.DEFAULT);
textPaint.setTextSize(13*scale);
@@ -403,9 +401,11 @@ final class Utilities {
mBubbleRect.offsetTo((mBitmapWidth-mBubbleRect.width())/2, 0);
Log.d(TAG, "mBitmapWidth=" + mBitmapWidth + " mBitmapHeight="
+ mBitmapHeight + " w=" + ((int)(mBubbleRect.width() + 0.5f))
+ " h=" + ((int)((MAX_LINES * mLineHeight) + leading + 0.5f)));
if (false) {
Log.d(TAG, "mBitmapWidth=" + mBitmapWidth + " mBitmapHeight="
+ mBitmapHeight + " w=" + ((int)(mBubbleRect.width() + 0.5f))
+ " h=" + ((int)((MAX_LINES * mLineHeight) + leading + 0.5f)));
}
}
/** You own the bitmap after this and you must call recycle on it. */
+22 -2
View File
@@ -26,7 +26,11 @@ import android.graphics.Canvas;
import android.graphics.RectF;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Parcelable;
import android.os.Parcel;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
@@ -35,8 +39,6 @@ import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.Scroller;
import android.widget.TextView;
import android.os.Parcelable;
import android.os.Parcel;
import java.util.ArrayList;
@@ -468,6 +470,24 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
@Override
protected void dispatchDraw(Canvas canvas) {
if (Launcher.lastStartTime != 0) {
int itemCount = 0;
for (int i=0; i<getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof ViewGroup) {
itemCount += ((ViewGroup)child).getChildCount();
}
}
if (!mLauncher.isWorkspaceLocked()) {
Log.d(Launcher.TAG, "time from start to draw (" + itemCount + " items): "
+ (SystemClock.uptimeMillis() - Launcher.lastStartTime) + "ms");
Launcher.lastStartTime = 0;
} else {
Log.d(Launcher.TAG, "drawing but not ready yet (" + itemCount + " items): "
+ (SystemClock.uptimeMillis() - Launcher.lastStartTime) + "ms");
}
}
boolean restore = false;
int restoreCount = 0;