New launcher2 icon migration algorithm.

The user will be able to request "icon migration", which is
not a direct mapping of the old workspace, but rather
follows this heuristic for bringing the user's favorite
icons (by dint of their existence on the workspace) into
Launcher3:

Workspace shortcuts are placed in lexicographic order on the workspace
starting at screen 0 (leaving the bottom row of screen 0 empty to make
sure there's room to move things around). Folders are preserved and
their contents sorted. Duplicate icons (that is, shortcuts
with the same intent, pursuant to some cleanups) are removed.

Hotseat icons are migrated in their original place, unless their new
location is not accommodated by the hotseat (i.e. the L3 hotseat is
too small on this device), in which case they're treated like any
other shortcut and tossed into the workspace.

To test, turn on Launcher.ENABLE_DEBUG_INTENTS and then:

$ adb shell am broadcast -a com.android.launcher3.action.DELETE_DATABASE
$ adb shell am broadcast -a com.android.launcher3.action.MIGRATE_DATABASE

Bug: 12416411
Change-Id: Ia5c56f36c11455867ea20a39f70210f595020a87
4 files changed