Adding some tracing sections around launcher startup

Bug: 29007436
Change-Id: I53afd9130a2dc70a2223f1623e862faf44370f26
This commit is contained in:
Sunny Goyal
2016-06-20 15:56:22 -07:00
parent 91f3b1c0b8
commit e26d1008eb
4 changed files with 39 additions and 8 deletions
+18 -8
View File
@@ -64,6 +64,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.StrictMode;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
import android.text.Selection;
import android.text.SpannableStringBuilder;
@@ -146,7 +147,6 @@ public class Launcher extends Activity
public static final String TAG = "Launcher";
static final boolean LOGD = false;
static final boolean PROFILE_STARTUP = false;
static final boolean DEBUG_WIDGETS = false;
static final boolean DEBUG_STRICT_MODE = false;
static final boolean DEBUG_RESUME_TIME = false;
@@ -398,6 +398,9 @@ public class Launcher extends Activity
.penaltyDeath()
.build());
}
if (LauncherAppState.PROFILE_STARTUP) {
Trace.beginSection("Launcher-onCreate");
}
if (mLauncherCallbacks != null) {
mLauncherCallbacks.preOnCreate();
@@ -433,11 +436,6 @@ public class Launcher extends Activity
// LauncherModel load.
mPaused = false;
if (PROFILE_STARTUP) {
android.os.Debug.startMethodTracing(
Environment.getExternalStorageDirectory() + "/launcher");
}
setContentView(R.layout.launcher);
setupViews();
@@ -453,8 +451,8 @@ public class Launcher extends Activity
mSavedState = savedInstanceState;
restoreState(mSavedState);
if (PROFILE_STARTUP) {
android.os.Debug.stopMethodTracing();
if (LauncherAppState.PROFILE_STARTUP) {
Trace.endSection();
}
if (!mRestoring) {
@@ -3587,6 +3585,9 @@ public class Launcher extends Activity
* Implementation of the method from LauncherModel.Callbacks.
*/
public void startBinding() {
if (LauncherAppState.PROFILE_STARTUP) {
Trace.beginSection("Starting page bind");
}
setWorkspaceLoading(true);
// Clear the workspace because it's going to be rebound
@@ -3597,6 +3598,9 @@ public class Launcher extends Activity
if (mHotseat != null) {
mHotseat.resetLayout();
}
if (LauncherAppState.PROFILE_STARTUP) {
Trace.endSection();
}
}
@Override
@@ -3962,6 +3966,9 @@ public class Launcher extends Activity
if (waitUntilResume(r)) {
return;
}
if (LauncherAppState.PROFILE_STARTUP) {
Trace.beginSection("Page bind completed");
}
if (mSavedState != null) {
if (!mWorkspace.hasFocus()) {
mWorkspace.getChildAt(mWorkspace.getCurrentPage()).requestFocus();
@@ -3996,6 +4003,9 @@ public class Launcher extends Activity
if (mLauncherCallbacks != null) {
mLauncherCallbacks.finishBindingItems(false);
}
if (LauncherAppState.PROFILE_STARTUP) {
Trace.endSection();
}
}
private boolean canRunNewAppsAnimation() {