mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Revert "Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly""""
This reverts commit 3772b246c2.
Reason for revert: Fixed the test failure
Change-Id: Ibdc9e184fcb32c7caa4ab25d8753a46fa322b703
This commit is contained in:
@@ -16,8 +16,8 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.model.DatabaseHelper;
|
||||
import com.android.launcher3.model.LoaderTask;
|
||||
import com.android.launcher3.model.ModelDbController;
|
||||
import com.android.launcher3.model.WidgetsModel;
|
||||
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
|
||||
import com.android.launcher3.pm.UserCache;
|
||||
@@ -52,7 +52,7 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver {
|
||||
* Updates the app widgets whose id has changed during the restore process.
|
||||
*/
|
||||
@WorkerThread
|
||||
public static void restoreAppWidgetIds(Context context, DatabaseHelper helper,
|
||||
public static void restoreAppWidgetIds(Context context, ModelDbController controller,
|
||||
int[] oldWidgetIds, int[] newWidgetIds, @NonNull AppWidgetHost host) {
|
||||
if (WidgetsModel.GO_DISABLE_WIDGETS) {
|
||||
Log.e(TAG, "Skipping widget ID remap as widgets not supported");
|
||||
@@ -92,12 +92,12 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver {
|
||||
final String where = "appWidgetId=? and (restored & 1) = 1 and profileId=?";
|
||||
final String[] args = new String[] { oldWidgetId, Long.toString(mainProfileId) };
|
||||
int result = new ContentWriter(context,
|
||||
new ContentWriter.CommitParams(helper, where, args))
|
||||
new ContentWriter.CommitParams(controller, where, args))
|
||||
.put(LauncherSettings.Favorites.APPWIDGET_ID, newWidgetIds[i])
|
||||
.put(LauncherSettings.Favorites.RESTORED, state)
|
||||
.commit();
|
||||
if (result == 0) {
|
||||
Cursor cursor = helper.getWritableDatabase().query(
|
||||
Cursor cursor = controller.getDb().query(
|
||||
Favorites.TABLE_NAME,
|
||||
new String[] {Favorites.APPWIDGET_ID},
|
||||
"appWidgetId=?", new String[] { oldWidgetId }, null, null, null);
|
||||
|
||||
Reference in New Issue
Block a user