summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-01-13 19:51:55 (GMT)
committerArtem Shvadskiy <ashvadskiy@cyngn.com>2016-01-13 19:51:55 (GMT)
commit68226b79c50f8c726785286dbf80c44dda123ffb (patch)
tree8f3c2e80832e49c9d085d22945d057570185df0b
parent3c30f3ec6006c429e8751c0d0dfe7631fb161005 (diff)
downloadandroid_packages_apps_Trebuchet-68226b79c50f8c726785286dbf80c44dda123ffb.zip
android_packages_apps_Trebuchet-68226b79c50f8c726785286dbf80c44dda123ffb.tar.gz
android_packages_apps_Trebuchet-68226b79c50f8c726785286dbf80c44dda123ffb.tar.bz2
Fix a crash when moving from overlay to non-overlay installation.staging/remote-folder
Change-Id: Ia41f230078333e1ac67c360a6a4030550380e522
-rw-r--r--src/com/android/launcher3/FolderIcon.java4
-rw-r--r--src/com/android/launcher3/Launcher.java8
2 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index a166b18..c9f7556 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -173,6 +173,10 @@ public class FolderIcon extends FrameLayout implements FolderListener {
Folder folder;
if (folderInfo.isRemote()) {
folder = launcher.getRemoteFolderManager().createRemoteFolder(icon, launcher.getDragLayer());
+ if (folder == null) {
+ LauncherModel.deleteItemFromDatabase(launcher, folderInfo);
+ return null;
+ }
} else {
folder = Folder.fromXml(launcher, launcher.getDragLayer());
}
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 6618c75..43da261 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -4948,9 +4948,11 @@ public class Launcher extends Activity
final FolderIcon newFolder = FolderIcon.fromXml(R.layout.folder_icon, this,
(ViewGroup) workspace.getChildAt(workspace.getCurrentPage()),
(FolderInfo) item, mIconCache);
- newFolder.setTextVisible(!mHideIconLabels);
- workspace.addInScreenFromBind(newFolder, item.container, item.screenId, item.cellX,
- item.cellY, 1, 1);
+ if (newFolder != null) {
+ newFolder.setTextVisible(!mHideIconLabels);
+ workspace.addInScreenFromBind(newFolder, item.container, item.screenId, item.cellX,
+ item.cellY, 1, 1);
+ }
break;
default:
throw new RuntimeException("Invalid Item Type");