summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-06-01 19:01:30 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-01 19:01:30 -0700
commitf983ccb9bc134ea751d1114849f067c636fb04b5 (patch)
treea2759fe86f9929c514f1faba4879180a7d5519cc
parent57830506bf4fbd7e9093510223ae9b43e4047f7f (diff)
parent1fa57ee628a135dbbf34af43765ecf9d43c37cbc (diff)
downloadandroid_packages_apps_Trebuchet-f983ccb9bc134ea751d1114849f067c636fb04b5.zip
android_packages_apps_Trebuchet-f983ccb9bc134ea751d1114849f067c636fb04b5.tar.gz
android_packages_apps_Trebuchet-f983ccb9bc134ea751d1114849f067c636fb04b5.tar.bz2
am 1fa57ee6: Merge "Adding logging to track issue with apps pages. (Bug 6549598)" into jb-dev
* commit '1fa57ee628a135dbbf34af43765ecf9d43c37cbc': Adding logging to track issue with apps pages. (Bug 6549598)
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java28
-rw-r--r--src/com/android/launcher2/Launcher.java11
-rw-r--r--src/com/android/launcher2/PagedView.java3
3 files changed, 38 insertions, 4 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 71a4be2..3a41255 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -276,7 +276,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
private int mMaxAppCellCountX, mMaxAppCellCountY;
private int mWidgetCountX, mWidgetCountY;
private int mWidgetWidthGap, mWidgetHeightGap;
- private final int mWidgetPreviewIconPaddedDimension;
private final float sWidgetPreviewIconPaddingPercentage = 0.25f;
private PagedViewCellLayout mWidgetSpacingLayout;
private int mNumAppsPages;
@@ -354,14 +353,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// The padding on the non-matched dimension for the default widget preview icons
// (top + bottom)
- mWidgetPreviewIconPaddedDimension =
- (int) (mAppIconSize * (1 + (2 * sWidgetPreviewIconPaddingPercentage)));
mFadeInAdjacentScreens = false;
// Unless otherwise specified this view is important for accessibility.
if (getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
+
+ Log.d(TAG, "6549598 ctor mNumWidgetPages: " + mNumWidgetPages + " mNumAppsPages: " + mNumAppsPages);
}
@Override
@@ -372,6 +371,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
Context context = getContext();
Resources r = context.getResources();
setDragSlopeThreshold(r.getInteger(R.integer.config_appsCustomizeDragSlopeThreshold)/100f);
+ Log.d(TAG, "6549598 init mNumWidgetPages: " + mNumWidgetPages + " mNumAppsPages: " + mNumAppsPages);
}
@Override
@@ -452,9 +452,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mNumWidgetPages = (int) Math.ceil(mWidgets.size() /
(float) (mWidgetCountX * mWidgetCountY));
mNumAppsPages = (int) Math.ceil((float) mApps.size() / (mCellCountX * mCellCountY));
+ Log.d(TAG, "6549598 updatePageCounts mNumWidgetPages: " + mNumWidgetPages + " mNumAppsPages: " + mNumAppsPages);
+ Log.d(TAG, "6549598 mApps.size(): " + mApps.size() + " mWidgets.size(): " + mWidgets.size() + " mCellCountX: " + mCellCountX + " mCellCountY: " + mCellCountY);
}
protected void onDataReady(int width, int height) {
+ Log.d(TAG, "6549598 onDataReady");
// Note that we transpose the counts in portrait so that we get a similar layout
boolean isLandscape = getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE;
@@ -540,6 +543,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void onPackagesUpdated() {
+ Log.d(TAG, "6549598 onPackagesUpdated");
// TODO: this isn't ideal, but we actually need to delay here. This call is triggered
// by a broadcast receiver, and in order for it to work correctly, we need to know that
// the AppWidgetService has already received and processed the same broadcast. Since there
@@ -579,6 +583,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mWidgets.addAll(shortcuts);
Collections.sort(mWidgets,
new LauncherModel.WidgetAndShortcutNameComparator(mPackageManager));
+ Log.d(TAG, "6549598 updatePackages mWidgets.size(): " + mWidgets.size() + " wasEmpty: " + wasEmpty);
updatePageCounts();
if (wasEmpty) {
@@ -929,6 +934,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
@Override
public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) {
+ Log.d(TAG, "6549598 onLauncherTransitionEnd");
mInTransition = false;
for (AsyncTaskPageData d : mDeferredSyncWidgetPageItems) {
onSyncWidgetPageItems(d);
@@ -1020,6 +1026,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void setContentType(ContentType type) {
+ Log.d(TAG, "6549598 setContentType mNumAppsPages: " + mNumAppsPages);
if (type == ContentType.Widgets) {
invalidatePageData(mNumAppsPages, true);
} else if (type == ContentType.Applications) {
@@ -1046,6 +1053,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
private void updateCurrentTab(int currentPage) {
+ Log.d(TAG, "6549598 updateCurrentTab mNumAppsPages: " + mNumAppsPages);
AppsCustomizeTabHost tabHost = getTabHost();
if (tabHost != null) {
String tag = tabHost.getCurrentTabTag();
@@ -1089,6 +1097,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void syncAppsPageItems(int page, boolean immediate) {
+ Log.d(TAG, "6549598 syncAppsPageItems page: " + page);
// ensure that we have the right number of items on the pages
int numCells = mCellCountX * mCellCountY;
int startIndex = page * numCells;
@@ -1411,6 +1420,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void syncWidgetPageItems(final int page, final boolean immediate) {
+ Log.d(TAG, "6549598 syncWidgetPageItems page: " + page);
int numItemsPerPage = mWidgetCountX * mWidgetCountY;
// Calculate the dimensions of each cell we are giving to each widget
@@ -1602,10 +1612,13 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
setupPage(layout);
addView(layout);
}
+
+ Log.d(TAG, "6549598 syncPages mNumAppsPages: " + mNumAppsPages + " mNumWidgetPages: " + mNumWidgetPages);
}
@Override
public void syncPageItems(int page, boolean immediate) {
+ Log.d(TAG, "6549598 syncPageItems page: " + page + " immediate: " + immediate);
if (page < mNumAppsPages) {
syncAppsPageItems(page, immediate);
} else {
@@ -1739,6 +1752,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
public void setApps(ArrayList<ApplicationInfo> list) {
mApps = list;
Collections.sort(mApps, LauncherModel.APP_NAME_COMPARATOR);
+ Log.d(TAG, "6549598 setApps mApps.size(): " + mApps.size());
updatePageCounts();
// The next layout pass will trigger data-ready if both widgets and apps are set, so
@@ -1759,8 +1773,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
@Override
public void addApps(ArrayList<ApplicationInfo> list) {
addAppsWithoutInvalidate(list);
+ Log.d(TAG, "6549598 addApps mApps.size(): " + mApps.size() + " list.size(): " + list.size());
updatePageCounts();
invalidatePageData();
+ Log.d(TAG, "6549598 addApps mNumAppsPages: " + mNumAppsPages);
}
private int findAppByComponent(List<ApplicationInfo> list, ApplicationInfo item) {
ComponentName removeComponent = item.intent.getComponent();
@@ -1787,8 +1803,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
@Override
public void removeApps(ArrayList<ApplicationInfo> list) {
removeAppsWithoutInvalidate(list);
+ Log.d(TAG, "6549598 removeApps mApps.size(): " + mApps.size() + " list.size(): " + list.size());
updatePageCounts();
invalidatePageData();
+ Log.d(TAG, "6549598 removeApps mNumAppsPages: " + mNumAppsPages);
}
@Override
public void updateApps(ArrayList<ApplicationInfo> list) {
@@ -1797,13 +1815,15 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// place in the list.
removeAppsWithoutInvalidate(list);
addAppsWithoutInvalidate(list);
+ Log.d(TAG, "6549598 updateApps mApps.size(): " + mApps.size() + " list.size(): " + list.size());
updatePageCounts();
-
invalidatePageData();
+ Log.d(TAG, "6549598 updateApps mNumAppsPages: " + mNumAppsPages);
}
@Override
public void reset() {
+ Log.d(TAG, "6549598 reset");
// If we have reset, then we should not continue to restore the previous state
mSaveInstanceStateItemIndex = -1;
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 9fbf50e..b2f27b9 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -350,6 +350,7 @@ public final class Launcher extends Activity
// Update customization drawer _after_ restoring the states
if (mAppsCustomizeContent != null) {
+ Log.d(TAG, "6549598 Launcher.onCreate()");
mAppsCustomizeContent.onPackagesUpdated();
}
@@ -2227,6 +2228,11 @@ public final class Launcher extends Activity
}
private void dispatchOnLauncherTransitionStart(View v, boolean animated, boolean toWorkspace) {
+ if (toWorkspace) {
+ Log.d(TAG, "6549598 Start animation to workspace");
+ } else {
+ Log.d(TAG, "6549598 Start animation to all apps");
+ }
if (v instanceof LauncherTransitionable) {
((LauncherTransitionable) v).onLauncherTransitionStart(this, animated, toWorkspace);
}
@@ -2242,6 +2248,11 @@ public final class Launcher extends Activity
}
private void dispatchOnLauncherTransitionEnd(View v, boolean animated, boolean toWorkspace) {
+ if (toWorkspace) {
+ Log.d(TAG, "6549598 End animation to workspace");
+ } else {
+ Log.d(TAG, "6549598 End animation to all apps");
+ }
if (v instanceof LauncherTransitionable) {
((LauncherTransitionable) v).onLauncherTransitionEnd(this, animated, toWorkspace);
}
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 93725ce..c820264 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -1673,6 +1673,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
protected void invalidatePageData(int currentPage, boolean immediateAndOnly) {
if (!mIsDataReady) {
+ if (this instanceof AppsCustomizePagedView) Log.d(TAG, "6549598 invalidatePageData page: " + currentPage + " not data ready");
return;
}
@@ -1704,6 +1705,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// Load any pages that are necessary for the current window of views
loadAssociatedPages(mCurrentPage, immediateAndOnly);
requestLayout();
+
+ if (this instanceof AppsCustomizePagedView) Log.d(TAG, "6549598 invalidatePageData page: " + currentPage);
}
}