mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Adding logic to pull in workspace data from another Launcher3 based
provider. This allows OEMs to keep the user's homescreen intact while changing the default home app package. Bug: 28536314 Change-Id: Ibebfd7dd33aa2cbd9ca28d2d611dd0a4a5971444
This commit is contained in:
@@ -60,6 +60,7 @@ import com.android.launcher3.folder.FolderIcon;
|
||||
import com.android.launcher3.logging.FileLog;
|
||||
import com.android.launcher3.model.GridSizeMigrationTask;
|
||||
import com.android.launcher3.model.WidgetsModel;
|
||||
import com.android.launcher3.provider.ImportDataTask;
|
||||
import com.android.launcher3.provider.LauncherDbUtils;
|
||||
import com.android.launcher3.shortcuts.DeepShortcutManager;
|
||||
import com.android.launcher3.shortcuts.ShortcutInfoCompat;
|
||||
@@ -1648,7 +1649,14 @@ public class LauncherModel extends BroadcastReceiver
|
||||
int countY = profile.numRows;
|
||||
|
||||
boolean clearDb = false;
|
||||
if (GridSizeMigrationTask.ENABLED &&
|
||||
try {
|
||||
ImportDataTask.performImportIfPossible(context);
|
||||
} catch (Exception e) {
|
||||
// Migration failed. Clear workspace.
|
||||
clearDb = true;
|
||||
}
|
||||
|
||||
if (!clearDb && GridSizeMigrationTask.ENABLED &&
|
||||
!GridSizeMigrationTask.migrateGridIfNeeded(mContext)) {
|
||||
// Migration failed. Clear workspace.
|
||||
clearDb = true;
|
||||
|
||||
Reference in New Issue
Block a user