From 6079b05445e8ce09d7d2d37efe27cf569c853fbf Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 23 May 2011 12:56:50 -0700 Subject: [PATCH 01/11] Fix crash on phones --- .../app_market_generic.png | Bin .../app_market_generic.png | Bin 2 files changed, 0 insertions(+), 0 deletions(-) rename res/{drawable-large-hdpi => drawable-hdpi}/app_market_generic.png (100%) rename res/{drawable-large-mdpi => drawable-mdpi}/app_market_generic.png (100%) diff --git a/res/drawable-large-hdpi/app_market_generic.png b/res/drawable-hdpi/app_market_generic.png similarity index 100% rename from res/drawable-large-hdpi/app_market_generic.png rename to res/drawable-hdpi/app_market_generic.png diff --git a/res/drawable-large-mdpi/app_market_generic.png b/res/drawable-mdpi/app_market_generic.png similarity index 100% rename from res/drawable-large-mdpi/app_market_generic.png rename to res/drawable-mdpi/app_market_generic.png From 092338a6324eee812ed6c65e613cb87d9745f033 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 21 Jul 2011 11:22:13 -0700 Subject: [PATCH 02/11] Fix wallpaper picker crash --- res/values/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/res/values/strings.xml b/res/values/strings.xml index c0df443e..a3c263d7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -33,6 +33,12 @@ Android Core Apps + + Select wallpaper from + + Set wallpaper + + Wallpapers Application is not installed. From 7529fa2405fb64455d35f587cd145b2590e7baf8 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 21 Jul 2011 11:46:32 -0700 Subject: [PATCH 03/11] Fixing various issues with the dock. - Prevent crash due to no overlays in certain device configurations - Fixing kb crash and adding content description for Apps button Change-Id: Ie2a2bc29e7b9408a165f93d108fdd803193afc29 --- src/com/android/launcher2/BubbleTextView.java | 12 ------------ src/com/android/launcher2/FocusHelper.java | 17 +++++++++++++++-- src/com/android/launcher2/Hotseat.java | 8 ++++++-- src/com/android/launcher2/Launcher.java | 7 +++++++ src/com/android/launcher2/Workspace.java | 2 ++ 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java index 57a6584d..476d0637 100644 --- a/src/com/android/launcher2/BubbleTextView.java +++ b/src/com/android/launcher2/BubbleTextView.java @@ -330,16 +330,4 @@ protected boolean onSetAlpha(int alpha) { } return true; } - - @Override - public boolean onKeyDown(int keyCode, KeyEvent event) { - return FocusHelper.handleBubbleTextViewKeyEvent(this, keyCode, event) - || super.onKeyDown(keyCode, event); - } - - @Override - public boolean onKeyUp(int keyCode, KeyEvent event) { - return FocusHelper.handleBubbleTextViewKeyEvent(this, keyCode, event) - || super.onKeyUp(keyCode, event); - } } diff --git a/src/com/android/launcher2/FocusHelper.java b/src/com/android/launcher2/FocusHelper.java index 233fd6fb..3783d566 100644 --- a/src/com/android/launcher2/FocusHelper.java +++ b/src/com/android/launcher2/FocusHelper.java @@ -30,10 +30,20 @@ import java.util.Collections; import java.util.Comparator; +/** + * A keyboard listener we set on all the workspace icons. + */ +class BubbleTextViewKeyEventListener implements View.OnKeyListener { + @Override + public boolean onKey(View v, int keyCode, KeyEvent event) { + return FocusHelper.handleBubbleTextViewKeyEvent((BubbleTextView) v, keyCode, event); + } +} + /** * A keyboard listener we set on all the hotseat buttons. */ -class HotseatKeyEventListener implements View.OnKeyListener { +class HotseatBubbleTextViewKeyEventListener implements View.OnKeyListener { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { final Configuration configuration = v.getResources().getConfiguration(); @@ -612,6 +622,7 @@ static boolean handleBubbleTextViewKeyEvent(BubbleTextView v, int keyCode, KeyEv final Workspace workspace = (Workspace) layout.getParent(); final ViewGroup launcher = (ViewGroup) workspace.getParent(); final ViewGroup tabs = (ViewGroup) launcher.findViewById(R.id.qsb_bar); + final ViewGroup hotseat = (ViewGroup) launcher.findViewById(R.id.hotseat); int iconIndex = parent.indexOfChild(v); int iconCount = parent.getChildCount(); int pageIndex = workspace.indexOfChild(layout); @@ -678,11 +689,13 @@ static boolean handleBubbleTextViewKeyEvent(BubbleTextView v, int keyCode, KeyEv break; case KeyEvent.KEYCODE_DPAD_DOWN: if (handleKeyEvent) { - // Select the closest icon in the next line, otherwise select the tab bar + // Select the closest icon in the next line, otherwise select the button bar View newIcon = getClosestBubbleTextViewOnLine(layout, parent, v, 1); if (newIcon != null) { newIcon.requestFocus(); wasHandled = true; + } else if (hotseat != null) { + hotseat.requestFocus(); } } break; diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java index deab1317..491691eb 100644 --- a/src/com/android/launcher2/Hotseat.java +++ b/src/com/android/launcher2/Hotseat.java @@ -57,6 +57,7 @@ public Hotseat(Context context, AttributeSet attrs, int defStyle) { public void setup(Launcher launcher) { mLauncher = launcher; + setOnKeyListener(new HotseatBubbleTextViewKeyEventListener()); } CellLayout getLayout() { @@ -96,11 +97,14 @@ void resetLayout() { inflater.inflate(R.layout.application, mContent, false); allAppsButton.setCompoundDrawablesWithIntrinsicBounds(null, context.getResources().getDrawable(R.drawable.apps_hotseat_button), null, null); - // button.setText(context.getString(R.string.all_apps_button_label)); + // allAppsButton.setText(context.getString(R.string.all_apps_button_label)); + allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label)); allAppsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(android.view.View v) { - mLauncher.showAllApps(true); + if (mLauncher != null) { + mLauncher.showAllApps(true); + } } }); diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 0abdec09..3050be48 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2874,6 +2874,13 @@ public void bindItems(ArrayList shortcuts, int start, int end) { final Workspace workspace = mWorkspace; for (int i=start; i Date: Thu, 25 Aug 2011 13:51:25 -0700 Subject: [PATCH 04/11] Tweaking the logging in the fail case, adding additional cases for where the db icon cache should be updated. (5205131) Change-Id: If5bf8d959ba9af40dbe8c13e6ed352a345e1679a --- src/com/android/launcher2/LauncherModel.java | 29 ++++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index b7f92ca4..8f189249 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -209,11 +209,10 @@ public void run() { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to moveItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to moveItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } // Items are added/removed from the corresponding FolderInfo elsewhere, such @@ -258,11 +257,10 @@ public void run() { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to moveItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to resizeItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } } }); @@ -471,11 +469,10 @@ public void run() { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to updateItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to updateItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } } }); @@ -522,12 +519,14 @@ public void run() { cr.delete(LauncherSettings.Favorites.getContentUri(info.id, false), null, null); sItemsIdMap.remove(info.id); sFolders.remove(info.id); + sDbIconCache.remove(info); sWorkspaceItems.remove(info); cr.delete(LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION, LauncherSettings.Favorites.CONTAINER + "=" + info.id, null); for (ItemInfo childInfo : info.contents) { sItemsIdMap.remove(childInfo.id); + sDbIconCache.remove(childInfo); } } }); From 18362aa3755c281c236f0a47341e1fb0f0ab1f52 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 29 Aug 2011 11:24:45 -0700 Subject: [PATCH 05/11] Fix crash when package list is updated bug# 5224498 Change-Id: I8953589c21e97fee3f5c3b95fb4a46beb39562b3 --- src/com/android/launcher2/LauncherModel.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 7d620622..4ad8922f 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -605,9 +605,11 @@ public void onReceive(Context context, Intent intent) { startLoaderFromBackground(); } else if (SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED.equals(action) || SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED.equals(action)) { - Callbacks callbacks = mCallbacks.get(); - if (callbacks != null) { - callbacks.bindSearchablesChanged(); + if (mCallbacks != null) { + Callbacks callbacks = mCallbacks.get(); + if (callbacks != null) { + callbacks.bindSearchablesChanged(); + } } } } From c1a5188be0f31d37e0ad6320aa4fa039e3211732 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 29 Aug 2011 14:02:47 -0700 Subject: [PATCH 06/11] Tagging where ItemInfos are created for debug purposes Change-Id: Iad3ed8ef4f81f4990c027ab46fd25b03b089babb --- src/com/android/launcher2/AllAppsList.java | 4 +-- .../android/launcher2/ApplicationInfo.java | 12 ++++--- .../launcher2/AppsCustomizePagedView.java | 4 +-- src/com/android/launcher2/FolderInfo.java | 3 +- .../launcher2/InstallWidgetReceiver.java | 2 +- src/com/android/launcher2/ItemInfo.java | 11 +++++-- src/com/android/launcher2/Launcher.java | 6 ++-- .../launcher2/LauncherAppWidgetInfo.java | 6 ++-- src/com/android/launcher2/LauncherModel.java | 32 +++++++++++-------- .../android/launcher2/PendingAddItemInfo.java | 8 ++++- src/com/android/launcher2/ShortcutInfo.java | 12 ++++--- src/com/android/launcher2/Workspace.java | 4 +-- 12 files changed, 65 insertions(+), 39 deletions(-) diff --git a/src/com/android/launcher2/AllAppsList.java b/src/com/android/launcher2/AllAppsList.java index 051b0bd1..7c107a79 100644 --- a/src/com/android/launcher2/AllAppsList.java +++ b/src/com/android/launcher2/AllAppsList.java @@ -91,7 +91,7 @@ public void addPackage(Context context, String packageName) { if (matches.size() > 0) { for (ResolveInfo info : matches) { - add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null)); + add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null, "15")); } } } @@ -142,7 +142,7 @@ public void updatePackage(Context context, String packageName) { info.activityInfo.applicationInfo.packageName, info.activityInfo.name); if (applicationInfo == null) { - add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null)); + add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null, "16")); } else { mIconCache.remove(applicationInfo.componentName); mIconCache.getTitleAndIcon(applicationInfo, info, null); diff --git a/src/com/android/launcher2/ApplicationInfo.java b/src/com/android/launcher2/ApplicationInfo.java index 1fc1d1f5..bbca6644 100644 --- a/src/com/android/launcher2/ApplicationInfo.java +++ b/src/com/android/launcher2/ApplicationInfo.java @@ -60,7 +60,8 @@ class ApplicationInfo extends ItemInfo { int flags = 0; - ApplicationInfo() { + ApplicationInfo(String whereCreated) { + super(whereCreated); itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; } @@ -68,7 +69,8 @@ class ApplicationInfo extends ItemInfo { * Must not hold the Context. */ public ApplicationInfo(PackageManager pm, ResolveInfo info, IconCache iconCache, - HashMap labelCache) { + HashMap labelCache, String whereCreated) { + super(whereCreated); final String packageName = info.activityInfo.applicationInfo.packageName; this.componentName = new ComponentName(packageName, info.activityInfo.name); @@ -93,8 +95,8 @@ public ApplicationInfo(PackageManager pm, ResolveInfo info, IconCache iconCache, iconCache.getTitleAndIcon(this, info, labelCache); } - public ApplicationInfo(ApplicationInfo info) { - super(info); + public ApplicationInfo(ApplicationInfo info, String whereCreated) { + super(info, whereCreated); componentName = info.componentName; title = info.title.toString(); intent = new Intent(info.intent); @@ -133,6 +135,6 @@ public static void dumpApplicationInfoList(String tag, String label, } public ShortcutInfo makeShortcut() { - return new ShortcutInfo(this); + return new ShortcutInfo(this, "18"); } } diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 0e442eae..3adf404b 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -1016,7 +1016,7 @@ private void onSyncWidgetPageItems(AsyncTaskPageData data) { if (rawInfo instanceof AppWidgetProviderInfo) { // Fill in the widget information AppWidgetProviderInfo info = (AppWidgetProviderInfo) rawInfo; - createItemInfo = new PendingAddWidgetInfo(info, null, null); + createItemInfo = new PendingAddWidgetInfo(info, null, null, "13"); int[] cellSpans = CellLayout.rectToCell(getResources(), info.minWidth, info.minHeight, null); FastBitmapDrawable preview = new FastBitmapDrawable(data.generatedImages.get(i)); @@ -1026,7 +1026,7 @@ private void onSyncWidgetPageItems(AsyncTaskPageData data) { } else if (rawInfo instanceof ResolveInfo) { // Fill in the shortcuts information ResolveInfo info = (ResolveInfo) rawInfo; - createItemInfo = new PendingAddItemInfo(); + createItemInfo = new PendingAddItemInfo("14"); createItemInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT; createItemInfo.componentName = new ComponentName(info.activityInfo.packageName, info.activityInfo.name); diff --git a/src/com/android/launcher2/FolderInfo.java b/src/com/android/launcher2/FolderInfo.java index 3ae31d27..0f8b9e06 100644 --- a/src/com/android/launcher2/FolderInfo.java +++ b/src/com/android/launcher2/FolderInfo.java @@ -42,7 +42,8 @@ class FolderInfo extends ItemInfo { ArrayList listeners = new ArrayList(); - FolderInfo() { + FolderInfo(String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_FOLDER; } diff --git a/src/com/android/launcher2/InstallWidgetReceiver.java b/src/com/android/launcher2/InstallWidgetReceiver.java index 6b3763ce..1b54e908 100644 --- a/src/com/android/launcher2/InstallWidgetReceiver.java +++ b/src/com/android/launcher2/InstallWidgetReceiver.java @@ -187,7 +187,7 @@ public void onClick(DialogInterface dialog, int which) { final AppWidgetProviderInfo widgetInfo = mActivities.get(which).widgetInfo; final PendingAddWidgetInfo createInfo = new PendingAddWidgetInfo(widgetInfo, mMimeType, - mClipData); + mClipData, "4"); mLauncher.addAppWidgetFromDrop(createInfo, LauncherSettings.Favorites.CONTAINER_DESKTOP, mTargetLayoutScreen, null, mTargetLayoutPos); } diff --git a/src/com/android/launcher2/ItemInfo.java b/src/com/android/launcher2/ItemInfo.java index 8d466249..5c05f163 100644 --- a/src/com/android/launcher2/ItemInfo.java +++ b/src/com/android/launcher2/ItemInfo.java @@ -86,10 +86,16 @@ class ItemInfo { */ int[] dropPos = null; - ItemInfo() { + /* + * A tag to know where this item was created + */ + String whereCreated; + + ItemInfo(String whereCreated) { + this.whereCreated = whereCreated; } - ItemInfo(ItemInfo info) { + ItemInfo(ItemInfo info, String whereCreated) { id = info.id; cellX = info.cellX; cellY = info.cellY; @@ -98,6 +104,7 @@ class ItemInfo { screen = info.screen; itemType = info.itemType; container = info.container; + this.whereCreated = whereCreated; } /** diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 22a34e6c..eaa98c1b 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -175,7 +175,7 @@ private enum State { WORKSPACE, APPS_CUSTOMIZE, APPS_CUSTOMIZE_SPRING_LOADED }; private AppWidgetManager mAppWidgetManager; private LauncherAppWidgetHost mAppWidgetHost; - private ItemInfo mPendingAddInfo = new ItemInfo(); + private ItemInfo mPendingAddInfo = new ItemInfo("1"); private int[] mTmpAddItemCellCoordinates = new int[2]; private FolderInfo mFolderInfo; @@ -902,7 +902,7 @@ public void run() { } // Build Launcher-specific widget info and save to database - LauncherAppWidgetInfo launcherInfo = new LauncherAppWidgetInfo(appWidgetId); + LauncherAppWidgetInfo launcherInfo = new LauncherAppWidgetInfo(appWidgetId, "2"); launcherInfo.spanX = spanXY[0]; launcherInfo.spanY = spanXY[1]; @@ -1446,7 +1446,7 @@ void processWallpaper(Intent intent) { FolderIcon addFolder(CellLayout layout, long container, final int screen, int cellX, int cellY) { - final FolderInfo folderInfo = new FolderInfo(); + final FolderInfo folderInfo = new FolderInfo("3"); folderInfo.title = getText(R.string.folder_name); // Update the model diff --git a/src/com/android/launcher2/LauncherAppWidgetInfo.java b/src/com/android/launcher2/LauncherAppWidgetInfo.java index 844abb51..69eae178 100644 --- a/src/com/android/launcher2/LauncherAppWidgetInfo.java +++ b/src/com/android/launcher2/LauncherAppWidgetInfo.java @@ -51,7 +51,8 @@ class LauncherAppWidgetInfo extends ItemInfo { /** * Constructor for use with AppWidgets that haven't been instantiated yet. */ - LauncherAppWidgetInfo(ComponentName providerName) { + LauncherAppWidgetInfo(ComponentName providerName, String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; this.providerName = providerName; @@ -61,7 +62,8 @@ class LauncherAppWidgetInfo extends ItemInfo { spanY = -1; } - LauncherAppWidgetInfo(int appWidgetId) { + LauncherAppWidgetInfo(int appWidgetId, String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; this.appWidgetId = appWidgetId; } diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 4ad8922f..ea51d016 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -210,8 +210,10 @@ public void run() { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item String msg = "item: " + ((item != null) ? item.toString() : "null") + - "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + - "Error: ItemInfo passed to moveItemInDatabase doesn't match original"; + " modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + " creation tag of item: " + ((item != null) ? item.whereCreated : "null") + + " creation tag of modelItem: " + ((modelItem != null) ? modelItem.whereCreated : "null") + + " Error: ItemInfo passed to moveItemInDatabase doesn't match original"; throw new RuntimeException(msg); } @@ -258,8 +260,10 @@ public void run() { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item String msg = "item: " + ((item != null) ? item.toString() : "null") + - "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + - "Error: ItemInfo passed to resizeItemInDatabase doesn't match original"; + " modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + " creation tag of item: " + ((item != null) ? item.whereCreated : "null") + + " creation tag of modelItem: " + ((modelItem != null) ? modelItem.whereCreated : "null") + + " Error: ItemInfo passed to resizeItemInDatabase doesn't match original"; throw new RuntimeException(msg); } } @@ -306,7 +310,7 @@ static ArrayList getItemsInLocalCoordinates(Context context) { try { while (c.moveToNext()) { - ItemInfo item = new ItemInfo(); + ItemInfo item = new ItemInfo("17"); item.cellX = c.getInt(cellXIndex); item.cellY = c.getInt(cellYIndex); item.spanX = c.getInt(spanXIndex); @@ -470,8 +474,10 @@ public void run() { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item String msg = "item: " + ((item != null) ? item.toString() : "null") + - "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + - "Error: ItemInfo passed to updateItemInDatabase doesn't match original"; + " modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + " creation tag of item: " + ((item != null) ? item.whereCreated : "null") + + " creation tag of modelItem: " + ((modelItem != null) ? modelItem.whereCreated : "null") + + " Error: ItemInfo passed to updateItemInDatabase doesn't match original"; throw new RuntimeException(msg); } } @@ -1059,7 +1065,7 @@ private void loadWorkspace() { + id + " appWidgetId=" + appWidgetId); itemsToRemove.add(id); } else { - appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId); + appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId, "5"); appWidgetInfo.id = id; appWidgetInfo.screen = c.getInt(screenIndex); appWidgetInfo.cellX = c.getInt(cellXIndex); @@ -1345,7 +1351,7 @@ private void loadAllAppsByBatch() { for (int j=0; i labelCache) { Bitmap icon = null; - final ShortcutInfo info = new ShortcutInfo(); + final ShortcutInfo info = new ShortcutInfo("7"); ComponentName componentName = intent.getComponent(); if (componentName == null) { @@ -1606,7 +1612,7 @@ private ShortcutInfo getShortcutInfo(Cursor c, Context context, int titleIndex) { Bitmap icon = null; - final ShortcutInfo info = new ShortcutInfo(); + final ShortcutInfo info = new ShortcutInfo("8"); info.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT; // TODO: If there's an explicit component and we can't install that, delete it. @@ -1765,7 +1771,7 @@ ShortcutInfo infoFromShortcutIntent(Context context, Intent data, Bitmap fallbac } } - final ShortcutInfo info = new ShortcutInfo(); + final ShortcutInfo info = new ShortcutInfo("9"); if (icon == null) { if (fallbackIcon != null) { @@ -1833,7 +1839,7 @@ private static FolderInfo findOrMakeFolder(HashMap folders, lo FolderInfo folderInfo = folders.get(id); if (folderInfo == null) { // No placeholder -- create a new instance - folderInfo = new FolderInfo(); + folderInfo = new FolderInfo("10"); folders.put(id, folderInfo); } return folderInfo; diff --git a/src/com/android/launcher2/PendingAddItemInfo.java b/src/com/android/launcher2/PendingAddItemInfo.java index 7b564e05..6ee300bf 100644 --- a/src/com/android/launcher2/PendingAddItemInfo.java +++ b/src/com/android/launcher2/PendingAddItemInfo.java @@ -28,6 +28,10 @@ class PendingAddItemInfo extends ItemInfo { * The component that will be created. */ ComponentName componentName; + + public PendingAddItemInfo(String whereCreated) { + super(whereCreated); + } } class PendingAddWidgetInfo extends PendingAddItemInfo { @@ -39,7 +43,9 @@ class PendingAddWidgetInfo extends PendingAddItemInfo { String mimeType; Parcelable configurationData; - public PendingAddWidgetInfo(AppWidgetProviderInfo i, String dataMimeType, Parcelable data) { + public PendingAddWidgetInfo( + AppWidgetProviderInfo i, String dataMimeType, Parcelable data, String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; componentName = i.provider; minWidth = i.minWidth; diff --git a/src/com/android/launcher2/ShortcutInfo.java b/src/com/android/launcher2/ShortcutInfo.java index c0f80aee..6d4853ff 100644 --- a/src/com/android/launcher2/ShortcutInfo.java +++ b/src/com/android/launcher2/ShortcutInfo.java @@ -62,12 +62,14 @@ class ShortcutInfo extends ItemInfo { */ private Bitmap mIcon; - ShortcutInfo() { + ShortcutInfo(String whereCreated) { + super(whereCreated); itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; + this.whereCreated = whereCreated; } - public ShortcutInfo(ShortcutInfo info) { - super(info); + public ShortcutInfo(ShortcutInfo info, String whereCreated) { + super(info, whereCreated); title = info.title.toString(); intent = new Intent(info.intent); if (info.iconResource != null) { @@ -80,8 +82,8 @@ public ShortcutInfo(ShortcutInfo info) { } /** TODO: Remove this. It's only called by ApplicationInfo.makeShortcut. */ - public ShortcutInfo(ApplicationInfo info) { - super(info); + public ShortcutInfo(ApplicationInfo info, String whereCreated) { + super(info, whereCreated); title = info.title.toString(); intent = new Intent(info.intent); customIcon = false; diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 1c13f140..3e0b466e 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -2575,7 +2575,7 @@ public boolean onDragEvent(DragEvent event) { // that widget final AppWidgetProviderInfo widgetInfo = widgets.get(0).widgetInfo; final PendingAddWidgetInfo createInfo = - new PendingAddWidgetInfo(widgetInfo, mimeType, data); + new PendingAddWidgetInfo(widgetInfo, mimeType, data, "11"); mLauncher.addAppWidgetFromDrop(createInfo, LauncherSettings.Favorites.CONTAINER_DESKTOP, mCurrentPage, null, pos); } else { @@ -3091,7 +3091,7 @@ public void run() { case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT: if (info.container == NO_ID && info instanceof ApplicationInfo) { // Came from all apps -- make a copy - info = new ShortcutInfo((ApplicationInfo) info); + info = new ShortcutInfo((ApplicationInfo) info, "12"); } view = mLauncher.createShortcut(R.layout.application, cellLayout, (ShortcutInfo) info); From 925ae21058782accfb2340100b46595daefc1bfb Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 12 Sep 2011 11:47:18 -0700 Subject: [PATCH 07/11] Fix regression: QSB is not clickable Change-Id: I7e3d17d59237f4f3ad4820fa0a43bad7624c6b45 --- res/layout-port/launcher.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index 898e849e..b45800ef 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -46,10 +46,6 @@ android:layout_gravity="bottom" android:layout_marginBottom="@dimen/button_bar_height" /> - - + + Date: Wed, 14 Sep 2011 17:56:27 -0700 Subject: [PATCH 08/11] Fixing regression where scroll position would be offset when rotated. - Fixes the scrolling issue only in conjunction with framework measure fix - Updating the wallpaper gallery item background Change-Id: Id7ff602837dbe1d8a2aaec6ec49b667f11d01bc9 --- res/drawable-hdpi/grid_focused.9.png | Bin 0 -> 200 bytes res/drawable-hdpi/grid_pressed.9.png | Bin 0 -> 184 bytes res/drawable-hdpi/grid_selected.9.png | Bin 0 -> 202 bytes res/drawable-mdpi/grid_focused.9.png | Bin 0 -> 170 bytes res/drawable-mdpi/grid_pressed.9.png | Bin 0 -> 165 bytes res/drawable-mdpi/grid_selected.9.png | Bin 0 -> 165 bytes res/drawable-xhdpi/grid_focused.9.png | Bin 0 -> 193 bytes res/drawable-xhdpi/grid_pressed.9.png | Bin 0 -> 190 bytes res/drawable-xhdpi/grid_selected.9.png | Bin 0 -> 199 bytes res/drawable/wallpaper_gallery_item.xml | 22 ++++++++++++++++++++++ res/layout/wallpaper_item.xml | 1 + src/com/android/launcher2/PagedView.java | 19 ++++++++++--------- 12 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 res/drawable-hdpi/grid_focused.9.png create mode 100644 res/drawable-hdpi/grid_pressed.9.png create mode 100644 res/drawable-hdpi/grid_selected.9.png create mode 100644 res/drawable-mdpi/grid_focused.9.png create mode 100644 res/drawable-mdpi/grid_pressed.9.png create mode 100644 res/drawable-mdpi/grid_selected.9.png create mode 100644 res/drawable-xhdpi/grid_focused.9.png create mode 100644 res/drawable-xhdpi/grid_pressed.9.png create mode 100644 res/drawable-xhdpi/grid_selected.9.png create mode 100644 res/drawable/wallpaper_gallery_item.xml diff --git a/res/drawable-hdpi/grid_focused.9.png b/res/drawable-hdpi/grid_focused.9.png new file mode 100644 index 0000000000000000000000000000000000000000..cb5aea89aaa9af7df366fe1bd00c9165a34fdb22 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^+#t-s1|(OmDOUqhEX7WqAsj$Z!;#Vf2?p zbb>IW`N`93fr43{E{-7*Q|C@N$lGAR!+d_l<0;~o4HSh9IAa?v&oHwDYH}o=oc~1U z=s~loGBv!plT_L&_o_MxFnD?;Ze&<0c*22S;31O_Z-q@l`Pbb1SNodwC)BnkA3PJc qEG+Nf--qg++a{j#o@b|gJ0~$r>cgX73Y2?p zbb>IW`N`93fr3$HGMh}C>r7udal00HINpFyu({L;7m8$i(bl#);t_Cc*A~N^c|8)mX au$MOo$#y>fE`I}P3xlVtpUXO@geCxFi$FC1 literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/grid_selected.9.png b/res/drawable-hdpi/grid_selected.9.png new file mode 100644 index 0000000000000000000000000000000000000000..02ab90253406f667bef5dae196c4798c2a449716 GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^+#t-s1|(OmDOUqhEX7WqAsj$Z!;#Vf2?p zbb>IW`N`93fr2@nE{-7*Q|C@N$lIVGz*5c`8^Ol=VY^oMqkQIRj4nJ zaCd?*qxs3xYk`73o-U3d5>spYFLEAG5O5YQT>S20Vr$)O{Z@}`Qn*KOP*zQS|Slaq5#Y0hczcPPu4eW%MjQpbV$aI0i%Mfb-jpt%g5 Lu6{1-oD!M4nJ zaCd?*qxs3xYk`99o-U3d5>s3I5Aq&R;9)-B(JQfJ^S6T@XA4nJ zaCd?*qxs3xYk`99o-U3d5>spY4{{zb;5kyFC|&xk?~3IVcWDpbjt6qvT6+T{Kb(%% zu;sk|_s<$lRn7x`Gi-0~Dss2xT|Qy*h0|xfBJOQrnaWsoSHZZp>vc5HNCr<=KbLh* G2~7a9YBb6K literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/grid_focused.9.png b/res/drawable-xhdpi/grid_focused.9.png new file mode 100644 index 0000000000000000000000000000000000000000..20d4647df110c03fbafd2b966bfa540135417701 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xamSQK*5Dp-y;YjHK@;M7UB8wRq zxI00Z(fs7;wLrmSPZ!4!jfs0F1#&eQ@Hl@?G5;hdSN33{jr$(~_G_n7py+SNk)ZumAk~an`7!zI!*abT6EB*C)@4*d^7Crf~|48D|pDxR^+~l)weLeQ$ kc|!Dsb8jlUN^E~}?r)KpZojpy2523Fr>mdKI;Vst0Fll`r~m)} literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/grid_pressed.9.png b/res/drawable-xhdpi/grid_pressed.9.png new file mode 100644 index 0000000000000000000000000000000000000000..73a784b600adc633694aeae9f4938f378dfcdd13 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xamSQK*5Dp-y;YjHK@;M7UB8wRq zxI00Z(fs7;wLrlHPZ!4!jfqz$UF2*q;BmR{X;vhV{`K(0IgkHLT(r?qK(I!D!&dL@ z#e~^>ex+i$PC}12mEFw@aGumA?R@h4u?50%Gx(k}JzKJS*G1R+6}F4J_6hEuFn_Xf hEZhGV@|C-uNN;PB@4ZxgCl6>BgQu&X%Q~loCIDz8K}!Gt literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/grid_selected.9.png b/res/drawable-xhdpi/grid_selected.9.png new file mode 100644 index 0000000000000000000000000000000000000000..eb0f3dc2f19bf4c03e6bb7ac9e11310aff900808 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xamSQK*5Dp-y;YjHK@;M7UB8wRq zxI00Z(fs7;wLrm4PZ!4!jfs1MZu2%M2xN0c8?+@`tWUORE1try%vi*1tvC5@ZHU99M5hYZHS*8rS!k`ZnjCF-K%#Eyi?BcQE$%#d-gQ=1 pT;|Jx_cC5gk;mp}3hnTn$M_{lcB8So&LyCw44$rjF6*2UngH6sK864Q literal 0 HcmV?d00001 diff --git a/res/drawable/wallpaper_gallery_item.xml b/res/drawable/wallpaper_gallery_item.xml new file mode 100644 index 00000000..b7052bd3 --- /dev/null +++ b/res/drawable/wallpaper_gallery_item.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/res/layout/wallpaper_item.xml b/res/layout/wallpaper_item.xml index 0834ce68..bd3fa2bd 100644 --- a/res/layout/wallpaper_item.xml +++ b/res/layout/wallpaper_item.xml @@ -18,5 +18,6 @@ android:id="@+id/wallpaper_image" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/wallpaper_gallery_item" android:scaleType="fitXY" android:focusable="true" /> diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index dca4d144..9a105d10 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -539,15 +539,6 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto } if (DEBUG) Log.d(TAG, "PagedView.onLayout()"); - if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { - setHorizontalScrollBarEnabled(false); - int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage); - scrollTo(newX, 0); - mScroller.setFinalX(newX); - setHorizontalScrollBarEnabled(true); - mFirstLayout = false; - } - final int verticalPadding = mPaddingTop + mPaddingBottom; final int childCount = getChildCount(); int childLeft = 0; @@ -578,6 +569,16 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto childLeft += childWidth + mPageSpacing; } } + + if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { + setHorizontalScrollBarEnabled(false); + int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage); + scrollTo(newX, 0); + mScroller.setFinalX(newX); + setHorizontalScrollBarEnabled(true); + mFirstLayout = false; + } + if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { mFirstLayout = false; } From 50a729414db7d0319bd29dc809e2f9886f86a9f7 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 22 Sep 2011 13:59:02 -0700 Subject: [PATCH 09/11] Updating default workspace, fixing missing Browser icon. (5358657) Change-Id: Ibdfbc5084afacfa951355e2e7582d5a86fd742a5 --- res/xml/default_workspace.xml | 58 ++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml index 4ca51fa9..61e8f3fc 100644 --- a/res/xml/default_workspace.xml +++ b/res/xml/default_workspace.xml @@ -18,16 +18,32 @@ + + + - - - + - + launcher:packageName="com.google.android.talk" + launcher:className="com.google.android.talk.SigningInActivity" /> + launcher:packageName="com.google.android.youtube" + launcher:className="com.google.android.youtube.app.honeycomb.Shell$HomeActivity" /> @@ -86,6 +96,18 @@ launcher:y="1" launcher:spanX="2" launcher:spanY="2" /> + + @@ -112,7 +134,7 @@ launcher:x="3" launcher:y="0" /> Date: Wed, 2 Nov 2011 14:49:06 -0700 Subject: [PATCH 10/11] Tentative fix for monkey crash, issue 5556086 Change-Id: Iea6b39133b297dc809e64a20d22156f59950db74 --- src/com/android/launcher2/PagedView.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index d8a8bb26..de45bf50 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -490,11 +490,14 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { heightSize = maxChildHeight + verticalPadding; } - updateScrollingIndicatorPosition(); - setMeasuredDimension(widthSize, heightSize); - // We can't call getChildOffset/getRelativeChildOffset until we set the measured dimensions + // We can't call getChildOffset/getRelativeChildOffset until we set the measured dimensions. + // We also wait until we set the measured dimensions before flushing the cache as well, to + // ensure that the cache is filled with good values. + invalidateCachedOffsets(); + updateScrollingIndicatorPosition(); + if (childCount > 0) { mMaxScrollX = getChildOffset(childCount - 1) - getRelativeChildOffset(childCount - 1); } else { @@ -597,7 +600,6 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { mFirstLayout = false; } - invalidateCachedOffsets(); } protected void screenScrolled(int screenCenter) { @@ -626,11 +628,17 @@ protected void onViewAdded(View child) { // in accordance with any scroll effects. mForceScreenScrolled = true; invalidate(); + invalidateCachedOffsets(); } protected void invalidateCachedOffsets() { int count = getChildCount(); - if (count == 0) return; + if (count == 0) { + mChildOffsets = null; + mChildRelativeOffsets = null; + mChildOffsetsWithLayoutScale = null; + return; + } mChildOffsets = new int[count]; mChildRelativeOffsets = new int[count]; From 60988ea9a13c732060042c744496bff4329eb45b Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Tue, 15 Nov 2011 17:04:31 -0800 Subject: [PATCH 11/11] Fix bug where all apps didn't load sometimes Bug #5623281 --- .../launcher2/AppsCustomizeTabHost.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 07e66252..897a7fb5 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -355,19 +355,19 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto public boolean onLauncherTransitionStart(Launcher l, Animator animation, boolean toWorkspace) { mInTransition = true; boolean delayLauncherTransitionUntilLayout = false; + boolean animated = (animation != null); mLauncherTransition = null; - // if the content wasn't visible before, delay the launcher animation until after a cal + // if the content wasn't visible before, delay the launcher animation until after a call // to layout -- this prevents a blip - if (animation != null) { - if (mContent.getVisibility() == GONE) { - mLauncherTransition = animation; - delayLauncherTransitionUntilLayout = true; - } - mContent.setVisibility(VISIBLE); - if (!delayLauncherTransitionUntilLayout) { - enableAndBuildHardwareLayer(); - } + if (animated && mContent.getVisibility() == GONE) { + mLauncherTransition = animation; + delayLauncherTransitionUntilLayout = true; + } + mContent.setVisibility(VISIBLE); + + if (animated && !delayLauncherTransitionUntilLayout) { + enableAndBuildHardwareLayer(); } if (!toWorkspace && !LauncherApplication.isScreenLarge()) {