Fixing backup restore
> Not deleting icons from cache, which have not been restored yet > Not checking if activity exists during DB migration. Missing components are removed during loader anyway > Backing up and restoring bitmaps even when iconType is resource. This allows us to show a proper bitmap icon, until the correct resource is available. > Loading proper shortcutResource icon for promiseIcons > Checking against promise intent when verifying duplicates > A launcher App intent can contain EXTRA_PROFILE Bug: 22094970 Change-Id: I982971338846733833ec133119393af0bea0eb08
This commit is contained in:
1 parent
b41b836968
commit
4e5cc64eaf
8 files changed
+178
-98
No files matched your search
@@ -771,22 +771,7 @@ public class LauncherBackupHelper implements BackupHelper {
|
||||
favorite.spanX = c.getInt(SPANX_INDEX);
|
||||
favorite.spanY = c.getInt(SPANY_INDEX);
|
||||
favorite.iconType = c.getInt(ICON_TYPE_INDEX);
|
||||
if (favorite.iconType == Favorites.ICON_TYPE_RESOURCE) {
|
||||
String iconPackage = c.getString(ICON_PACKAGE_INDEX);
|
||||
if (!TextUtils.isEmpty(iconPackage)) {
|
||||
favorite.iconPackage = iconPackage;
|
||||
}
|
||||
String iconResource = c.getString(ICON_RESOURCE_INDEX);
|
||||
if (!TextUtils.isEmpty(iconResource)) {
|
||||
favorite.iconResource = iconResource;
|
||||
}
|
||||
}
|
||||
if (favorite.iconType == Favorites.ICON_TYPE_BITMAP) {
|
||||
byte[] blob = c.getBlob(ICON_INDEX);
|
||||
if (blob != null && blob.length > 0) {
|
||||
favorite.icon = blob;
|
||||
}
|
||||
}
|
||||
|
||||
String title = c.getString(TITLE_INDEX);
|
||||
if (!TextUtils.isEmpty(title)) {
|
||||
favorite.title = title;
|
||||
@@ -809,6 +794,22 @@ public class LauncherBackupHelper implements BackupHelper {
|
||||
if (!TextUtils.isEmpty(appWidgetProvider)) {
|
||||
favorite.appWidgetProvider = appWidgetProvider;
|
||||
}
|
||||
} else if (favorite.itemType == Favorites.ITEM_TYPE_SHORTCUT) {
|
||||
if (favorite.iconType == Favorites.ICON_TYPE_RESOURCE) {
|
||||
String iconPackage = c.getString(ICON_PACKAGE_INDEX);
|
||||
if (!TextUtils.isEmpty(iconPackage)) {
|
||||
favorite.iconPackage = iconPackage;
|
||||
}
|
||||
String iconResource = c.getString(ICON_RESOURCE_INDEX);
|
||||
if (!TextUtils.isEmpty(iconResource)) {
|
||||
favorite.iconResource = iconResource;
|
||||
}
|
||||
}
|
||||
|
||||
byte[] blob = c.getBlob(ICON_INDEX);
|
||||
if (blob != null && blob.length > 0) {
|
||||
favorite.icon = blob;
|
||||
}
|
||||
}
|
||||
|
||||
if (isReplaceableHotseatItem(favorite)) {
|
||||
@@ -852,14 +853,16 @@ public class LauncherBackupHelper implements BackupHelper {
|
||||
values.put(Favorites.CELLY, favorite.cellY);
|
||||
values.put(Favorites.SPANX, favorite.spanX);
|
||||
values.put(Favorites.SPANY, favorite.spanY);
|
||||
values.put(Favorites.ICON_TYPE, favorite.iconType);
|
||||
if (favorite.iconType == Favorites.ICON_TYPE_RESOURCE) {
|
||||
values.put(Favorites.ICON_PACKAGE, favorite.iconPackage);
|
||||
values.put(Favorites.ICON_RESOURCE, favorite.iconResource);
|
||||
}
|
||||
if (favorite.iconType == Favorites.ICON_TYPE_BITMAP) {
|
||||
|
||||
if (favorite.itemType == Favorites.ITEM_TYPE_SHORTCUT) {
|
||||
values.put(Favorites.ICON_TYPE, favorite.iconType);
|
||||
if (favorite.iconType == Favorites.ICON_TYPE_RESOURCE) {
|
||||
values.put(Favorites.ICON_PACKAGE, favorite.iconPackage);
|
||||
values.put(Favorites.ICON_RESOURCE, favorite.iconResource);
|
||||
}
|
||||
values.put(Favorites.ICON, favorite.icon);
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(favorite.title)) {
|
||||
values.put(Favorites.TITLE, favorite.title);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user