Debug time spent in onResume
Bug: 8660324 Also, fix regression where new app icons didn't bounce/animate in Bug: 8707110
This commit is contained in:
1 parent
94dcefa435
commit
447bf84d24
2 files changed
+24
-1
No files matched your search
@@ -203,7 +203,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
|
|||||||
final int newAppsScreen = sharedPrefs.getInt(
|
final int newAppsScreen = sharedPrefs.getInt(
|
||||||
NEW_APPS_PAGE_KEY, screen);
|
NEW_APPS_PAGE_KEY, screen);
|
||||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
SharedPreferences.Editor editor = sharedPrefs.edit();
|
||||||
if (newAppsScreen == screen) {
|
if (newAppsScreen == -1 || newAppsScreen == screen) {
|
||||||
addToStringSet(sharedPrefs,
|
addToStringSet(sharedPrefs,
|
||||||
editor, NEW_APPS_LIST_KEY, intent.toUri(0));
|
editor, NEW_APPS_LIST_KEY, intent.toUri(0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ public final class Launcher extends Activity
|
|||||||
static final boolean PROFILE_STARTUP = false;
|
static final boolean PROFILE_STARTUP = false;
|
||||||
static final boolean DEBUG_WIDGETS = false;
|
static final boolean DEBUG_WIDGETS = false;
|
||||||
static final boolean DEBUG_STRICT_MODE = false;
|
static final boolean DEBUG_STRICT_MODE = false;
|
||||||
|
static final boolean DEBUG_RESUME_TIME = true;
|
||||||
|
|
||||||
private static final int MENU_GROUP_WALLPAPER = 1;
|
private static final int MENU_GROUP_WALLPAPER = 1;
|
||||||
private static final int MENU_WALLPAPER_SETTINGS = Menu.FIRST + 1;
|
private static final int MENU_WALLPAPER_SETTINGS = Menu.FIRST + 1;
|
||||||
@@ -730,6 +731,10 @@ public final class Launcher extends Activity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
long startTime = 0;
|
||||||
|
if (DEBUG_RESUME_TIME) {
|
||||||
|
startTime = System.currentTimeMillis();
|
||||||
|
}
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
// Restore the previous launcher state
|
// Restore the previous launcher state
|
||||||
@@ -756,10 +761,18 @@ public final class Launcher extends Activity
|
|||||||
}
|
}
|
||||||
// We might have postponed some bind calls until onResume (see waitUntilResume) --
|
// We might have postponed some bind calls until onResume (see waitUntilResume) --
|
||||||
// execute them here
|
// execute them here
|
||||||
|
long startTimeCallbacks = 0;
|
||||||
|
if (DEBUG_RESUME_TIME) {
|
||||||
|
startTimeCallbacks = System.currentTimeMillis();
|
||||||
|
}
|
||||||
for (int i = 0; i < mOnResumeCallbacks.size(); i++) {
|
for (int i = 0; i < mOnResumeCallbacks.size(); i++) {
|
||||||
mOnResumeCallbacks.get(i).run();
|
mOnResumeCallbacks.get(i).run();
|
||||||
}
|
}
|
||||||
mOnResumeCallbacks.clear();
|
mOnResumeCallbacks.clear();
|
||||||
|
if (DEBUG_RESUME_TIME) {
|
||||||
|
Log.d(TAG, "Time spent processing callbacks in onResume: " +
|
||||||
|
(System.currentTimeMillis() - startTimeCallbacks));
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the pressed state of icons that were locked in the press state while activities
|
// Reset the pressed state of icons that were locked in the press state while activities
|
||||||
// were launching
|
// were launching
|
||||||
@@ -780,6 +793,9 @@ public final class Launcher extends Activity
|
|||||||
// Again, as with the above scenario, it's possible that one or more of the global icons
|
// Again, as with the above scenario, it's possible that one or more of the global icons
|
||||||
// were updated in the wrong orientation.
|
// were updated in the wrong orientation.
|
||||||
updateGlobalIcons();
|
updateGlobalIcons();
|
||||||
|
if (DEBUG_RESUME_TIME) {
|
||||||
|
Log.d(TAG, "Time spent in onResume: " + (System.currentTimeMillis() - startTime));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1412,6 +1428,10 @@ public final class Launcher extends Activity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
|
long startTime = 0;
|
||||||
|
if (DEBUG_RESUME_TIME) {
|
||||||
|
startTime = System.currentTimeMillis();
|
||||||
|
}
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
|
|
||||||
// Close the menu
|
// Close the menu
|
||||||
@@ -1472,6 +1492,9 @@ public final class Launcher extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (DEBUG_RESUME_TIME) {
|
||||||
|
Log.d(TAG, "Time spent in onNewIntent: " + (System.currentTimeMillis() - startTime));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user