diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-03 01:29:56 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-02-03 01:29:56 +0000 |
commit | b5c5e27ab6bbbaf69203044bab7b9af61efd79dd (patch) | |
tree | d51ac9fb3e2a72b592dde8472dcf2bae54adce13 /tests/src/com/android/launcher3/util/WidgetUtils.java | |
parent | 041c765ca5ee78a8b8c21db1882740b81439c1eb (diff) | |
parent | 808fc1574781a8be6700feb728c9ee65426722a8 (diff) | |
download | Launcher3-simpleperf-release.tar.gz |
Merge "Snap for 11400057 from ded14cc2110e39408f74abac8a83e0a0f16608d2 to simpleperf-release" into simpleperf-releasesimpleperf-release
Diffstat (limited to 'tests/src/com/android/launcher3/util/WidgetUtils.java')
-rw-r--r-- | tests/src/com/android/launcher3/util/WidgetUtils.java | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/src/com/android/launcher3/util/WidgetUtils.java b/tests/src/com/android/launcher3/util/WidgetUtils.java index b0df0558dd..027a31aeb2 100644 --- a/tests/src/com/android/launcher3/util/WidgetUtils.java +++ b/tests/src/com/android/launcher3/util/WidgetUtils.java @@ -18,18 +18,14 @@ package com.android.launcher3.util; import static androidx.test.core.app.ApplicationProvider.getApplicationContext; import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; -import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID; - import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; import android.content.ComponentName; -import android.content.ContentResolver; import android.content.Context; import android.os.Bundle; import android.os.Process; import com.android.launcher3.LauncherSettings; -import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; import com.android.launcher3.widget.LauncherWidgetHolder; @@ -88,33 +84,6 @@ public class WidgetUtils { } /** - * Adds {@param item} on the homescreen on the 0th screen - */ - public static void addItemToScreen(ItemInfo item, Context targetContext) { - ContentResolver resolver = targetContext.getContentResolver(); - int screenId = FIRST_SCREEN_ID; - // Update the screen id counter for the provider. - LauncherSettings.Settings.call(resolver, - LauncherSettings.Settings.METHOD_NEW_SCREEN_ID); - - if (screenId > FIRST_SCREEN_ID) { - screenId = FIRST_SCREEN_ID; - } - - // Insert the item - ContentWriter writer = new ContentWriter(targetContext); - item.id = LauncherSettings.Settings.call( - resolver, LauncherSettings.Settings.METHOD_NEW_ITEM_ID) - .getInt(LauncherSettings.Settings.EXTRA_VALUE); - item.screenId = screenId; - item.onAddToDatabase(writer); - writer.put(LauncherSettings.Favorites._ID, item.id); - resolver.insert(LauncherSettings.Favorites.CONTENT_URI, - writer.getValues(targetContext)); - } - - - /** * Creates a {@link AppWidgetProviderInfo} for the provided component name */ public static AppWidgetProviderInfo createAppWidgetProviderInfo(ComponentName cn) { |