diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-10-30 00:33:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-30 00:33:46 +0000 |
commit | 4f63c76bfec06949af2391e5babd4be73ae3eb38 (patch) | |
tree | fe87c0e04fc3e6af825192be659eacfe3d50c1cf /src/com/android/launcher3/LauncherModel.java | |
parent | b9388f5742522032a36598205a53fc0f66b5ea4c (diff) | |
parent | 9eba1fd75e9fa6b0dc5cad9a4e817b3b167d2461 (diff) | |
download | android_packages_apps_Trebuchet-4f63c76bfec06949af2391e5babd4be73ae3eb38.tar.gz android_packages_apps_Trebuchet-4f63c76bfec06949af2391e5babd4be73ae3eb38.tar.bz2 android_packages_apps_Trebuchet-4f63c76bfec06949af2391e5babd4be73ae3eb38.zip |
Merge "Refactoring WallpaperOffsetInterpolator to a new file Removing some us unused methods" into ub-launcher3-master
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 64 |
1 files changed, 2 insertions, 62 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 4ad4695f3..676ee2a5b 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -431,7 +431,6 @@ public class LauncherModel extends BroadcastReceiver * @return screenId and the coordinates for the item. */ @Thunk Pair<Long, int[]> findSpaceForItem( - Context context, ArrayList<Long> workspaceScreens, ArrayList<Long> addedWorkspaceScreensFinal, int spanX, int spanY) { @@ -527,9 +526,8 @@ public class LauncherModel extends BroadcastReceiver } // Find appropriate space for the item. - Pair<Long, int[]> coords = findSpaceForItem(context, - workspaceScreens, addedWorkspaceScreensFinal, - 1, 1); + Pair<Long, int[]> coords = findSpaceForItem( + workspaceScreens, addedWorkspaceScreensFinal, 1, 1); long screenId = coords.first; int[] cordinates = coords.second; @@ -926,51 +924,6 @@ public class LauncherModel extends BroadcastReceiver } /** - * Find a folder in the db, creating the FolderInfo if necessary, and adding it to folderList. - */ - FolderInfo getFolderById(Context context, LongArrayMap<FolderInfo> folderList, long id) { - final ContentResolver cr = context.getContentResolver(); - Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI, null, - "_id=? and (itemType=? or itemType=?)", - new String[] { String.valueOf(id), - String.valueOf(LauncherSettings.Favorites.ITEM_TYPE_FOLDER)}, null); - - try { - if (c.moveToFirst()) { - final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE); - final int titleIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE); - final int containerIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CONTAINER); - final int screenIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN); - final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX); - final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY); - final int optionsIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.OPTIONS); - - FolderInfo folderInfo = null; - switch (c.getInt(itemTypeIndex)) { - case LauncherSettings.Favorites.ITEM_TYPE_FOLDER: - folderInfo = findOrMakeFolder(folderList, id); - break; - } - - // Do not trim the folder label, as is was set by the user. - folderInfo.title = c.getString(titleIndex); - folderInfo.id = id; - folderInfo.container = c.getInt(containerIndex); - folderInfo.screenId = c.getInt(screenIndex); - folderInfo.cellX = c.getInt(cellXIndex); - folderInfo.cellY = c.getInt(cellYIndex); - folderInfo.options = c.getInt(optionsIndex); - - return folderInfo; - } - } finally { - c.close(); - } - - return null; - } - - /** * Add an item to the database in a specified container. Sets the container, screen, cellX and * cellY fields of the item. Also assigns an ID to the item. */ @@ -1034,15 +987,6 @@ public class LauncherModel extends BroadcastReceiver runOnWorkerThread(r); } - /** - * Creates a new unique child id, for a given cell span across all layouts. - */ - static int getCellLayoutChildId( - long container, long screen, int localCellX, int localCellY, int spanX, int spanY) { - return (((int) container & 0xFF) << 24) - | ((int) screen & 0xFF) << 16 | (localCellX & 0xFF) << 8 | (localCellY & 0xFF); - } - private static ArrayList<ItemInfo> getItemsByPackageName( final String pn, final UserHandleCompat user) { ItemInfoFilter filter = new ItemInfoFilter() { @@ -1396,10 +1340,6 @@ public class LauncherModel extends BroadcastReceiver return screenIds; } - public boolean isAllAppsLoaded() { - return mAllAppsLoaded; - } - /** * Runnable for the thread that loads the contents of the launcher: * - workspace icons |