summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-05-15 13:35:22 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-15 13:35:22 -0700
commit43b596b4b96b7cba7164291b52787e5c62098fd8 (patch)
tree7216f1b921c36dc9fd95a821d1f6a8e630644209
parent659784dc297e6062a7c1cfb6b0c5c200bf809ad1 (diff)
parent447bf84d2454ac28ac26d70feea8139ed986c321 (diff)
downloadandroid_packages_apps_Trebuchet-43b596b4b96b7cba7164291b52787e5c62098fd8.tar.gz
android_packages_apps_Trebuchet-43b596b4b96b7cba7164291b52787e5c62098fd8.tar.bz2
android_packages_apps_Trebuchet-43b596b4b96b7cba7164291b52787e5c62098fd8.zip
am 447bf84d: Debug time spent in onResume
* commit '447bf84d2454ac28ac26d70feea8139ed986c321': Debug time spent in onResume
-rw-r--r--src/com/android/launcher2/InstallShortcutReceiver.java2
-rw-r--r--src/com/android/launcher2/Launcher.java23
2 files changed, 24 insertions, 1 deletions
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java
index 23c896418..337097e4b 100644
--- a/src/com/android/launcher2/InstallShortcutReceiver.java
+++ b/src/com/android/launcher2/InstallShortcutReceiver.java
@@ -203,7 +203,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
final int newAppsScreen = sharedPrefs.getInt(
NEW_APPS_PAGE_KEY, screen);
SharedPreferences.Editor editor = sharedPrefs.edit();
- if (newAppsScreen == screen) {
+ if (newAppsScreen == -1 || newAppsScreen == screen) {
addToStringSet(sharedPrefs,
editor, NEW_APPS_LIST_KEY, intent.toUri(0));
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index d9d20da49..473a3d158 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -126,6 +126,7 @@ public final class Launcher extends Activity
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 = true;
private static final int MENU_GROUP_WALLPAPER = 1;
private static final int MENU_WALLPAPER_SETTINGS = Menu.FIRST + 1;
@@ -730,6 +731,10 @@ public final class Launcher extends Activity
@Override
protected void onResume() {
+ long startTime = 0;
+ if (DEBUG_RESUME_TIME) {
+ startTime = System.currentTimeMillis();
+ }
super.onResume();
// 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) --
// execute them here
+ long startTimeCallbacks = 0;
+ if (DEBUG_RESUME_TIME) {
+ startTimeCallbacks = System.currentTimeMillis();
+ }
for (int i = 0; i < mOnResumeCallbacks.size(); i++) {
mOnResumeCallbacks.get(i).run();
}
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
// 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
// were updated in the wrong orientation.
updateGlobalIcons();
+ if (DEBUG_RESUME_TIME) {
+ Log.d(TAG, "Time spent in onResume: " + (System.currentTimeMillis() - startTime));
+ }
}
@Override
@@ -1412,6 +1428,10 @@ public final class Launcher extends Activity
@Override
protected void onNewIntent(Intent intent) {
+ long startTime = 0;
+ if (DEBUG_RESUME_TIME) {
+ startTime = System.currentTimeMillis();
+ }
super.onNewIntent(intent);
// 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