Commit Graph

111 Commits

Author SHA1 Message Date
Helena Josol
4fbbb3e3e0 Create a central list of files the Launcher writes to the app directory
Replace hardcoded Launcher filenames with the defined constants.

Bug: 12753154
Change-Id: I072f202d9388a703b9e6851bde64ea7fafe4b10a
2014-10-06 17:08:10 +01:00
Sunny Goyal
42de82ff8d Resetting launcherProvider data if restore set was empty
Bug: 17332300
Change-Id: I6d2187cd1b1fa7a53e49b96eb109263f6b74b258
2014-09-28 17:02:03 -07:00
Adam Cohen
4ae96ce92d Add ability for Partner customization apk to override certain DeviceProfile params
-> Workspace row / col counts
-> All apps row / col counts
-> Workspace icon size

issue 17208277

Change-Id: I25cfafede4da783083593b9bfeff4e5ba7751d36
2014-09-04 15:12:55 +00:00
Jason Monk
c3009c06d9 Change URI favorite resolving to use launch intents
Rather than dropping the user in the middle of the app wherever
our intent resolves to, add a shortcut to the launch intent of
the app that handles that intent.

Bug: 16459162
Change-Id: I58256cdc9dc1b3441815f60cc354b60f91fb1a16
2014-08-20 10:00:31 -04:00
Sunny Goyal
0fe505bf82 Autoinstalls loading xml
> Launcher checkes for an apk in the system image with a broadcast
receiver for action:
com.android.launcher3.action.LAUNCHER_CUSTOMIZATION
> Default layout is parsed from that apk, which can also contain
icons and string resources used in the layout config

Change-Id: I44fc9e7c3134f525f7b5db29f4e8bb56e17ce445
2014-08-12 14:13:18 -07:00
Adam Cohen
7ec3bbff8b Fix screen issues with externally added items
-> Ensure that when an item is added to the db from an external
   source that the screen id exists.
-> If the screen id does not exist, add that id as the largest rank

Change-Id: I98d68900c428d80666dab1909418c6d9b0f52e10
(cherry picked from commit 484526620012f88bcd9d5656a71d4218a9acd090)
2014-08-08 04:31:47 +00:00
Adam Cohen
43f3ca0f8c Fix resource issue in folders of partner layouts
-> Resources in folders were not being loaded with the partner
   apk resources. This caused any number of weird things to appear
   in folders of partner default layouts

Change-Id: I7d373e53028c5c327980c15d004993af997de553
2014-07-25 13:38:45 -07:00
Adam Cohen
3ed316a71d Adding broadcast to indicate first launcher load
-> fixing small thing from previous CL

issue 16191557

Change-Id: I015859f6028066e7c8664436f291ed226a539e29
2014-07-23 20:40:09 -07:00
Adam Cohen
a043fa8921 When inserting directly into LauncherProvider, ensure item id and widget id are valid
-> We generate an item id, and allocate and bind a widget id if necessary when items
   are added to the LauncherProvider externally. Writing to the provider is protected
   by system|signature.

issue 16191557

Change-Id: I09472e41ad4c8302901a5e49b5817247e9b86695
2014-07-24 00:40:53 +00:00
Adam Cohen
9b8f51fcc8 Adding ability for partners to specify a default layout
Change-Id: Ib071faa4b41d13961c3a33b865b40a644631c08a
2014-06-02 11:06:47 -07:00
Adam Cohen
9b1d062b0f Make sure we can handle database downgrade (by wiping and starting fresh)
issue 15144138

Change-Id: I59aad7445d2aaaaede1cba6754e047f05a2859ae
2014-05-21 19:04:49 -07:00
Winson Chung
dbc46f5e05 Merge "Adding support for dynamically resolved default layouts." into ub-now-nova 2014-05-16 19:42:03 +00:00
Winson Chung
be87647e2a Adding support for dynamically resolved default layouts.
Change-Id: Id05c60b93423ce37dd06a126ecf33c74a0ba1d62
2014-05-16 12:33:38 -07:00
Adam Cohen
71483f417b Removing antiquated migration path logic
-> also added some extra debugging for issue 14466459

Change-Id: I1ac9352c52c15d3e37f945cffabbca49343d2b8f
2014-05-16 12:26:36 -07:00
Kenny Guy
ed13187a74 Launcher3 multi-profile support
Use LauncherApps API and badging APIs instead of PackageManager.
With compatability layer that uses PackageManager pre L.

Adds support to show apps from current user and any managed profiles.

Background: Managed profiles are user sandboxes that are visible from
the primary user and can be launched as if they are a part of this user.
A launcher should now be capable of listing apps from this user as well
as related profiles of this user.

Launching of activities is now via the LauncherApps interface, to allow
for cross-profile app launching. Only activities with category LAUNCHER
can be added as a shortcut on the workspace for a managed profile.

Widgets and non-application shortcuts are only supported for the
current profile. Widgets from the managed profile are not available.

Change-Id: I5f396b1bf7f91ad91a5710ea4a0fd14573972eb9
2014-04-30 23:43:00 +01:00
Adam Cohen
16f645542a Merge "Second try removing orphaned items from the database" into ub-now-nova 2014-04-23 18:21:15 +00:00
Adam Cohen
f9c14de995 Second try removing orphaned items from the database
-> Delete items contained directly on the desktop whose screens
   no longer exist (do not remove items contained in hotseat or
   folders, except as described below)
-> Delete items contained by folder ids which are no longer present
   (ie. orphaned as their parent folder no long exists)

Change-Id: I2f47cc970ce00677cb1c83c0f0a2d13b6f16a33e
2014-04-22 16:11:40 -07:00
Jeff Sharkey
5aeef58131 Add support for partner customization.
Traditionally Launcher workspace customization is offered through
overlays at build time, but we don't have access to partner-specific
customization at build time.  To solve this, this adds a new
"partner-folder" tag which points at an XML resource provided by
an external package.

The external package XML can't depend on the binary XML attributes
defined by Launcher3, so we switch to using manual string-based
attribute lookups.  Partners can also provide extra wallpapers.

When a folder only results in a single item, promote that item into
the folder location instead of deleting completely.

Bug: 13340779
Change-Id: Ide558288bef4113565f288b700d8245055c0fee9
2014-04-22 12:28:51 -07:00
Adam Cohen
76ac344cb6 Merge "Allow the old launcher content URI to be overrided" into ub-now-mister-ugly 2014-04-17 00:53:52 +00:00
Adam Cohen
a7946070dc Fix serious data loss issue for folders and hotseat items
Change-Id: I37a5b44c670c2a1f99eb97b77cfdbc78534fdf91

bug 13964735
2014-04-11 01:13:46 +00:00
Adam Cohen
119285e755 Cleanup orphaned workspace items on db upgrade
-> Any workspace item whose screen id is not present in the
   screens table is removed from the database. This is
   intended to restore database consistency.

issue 13741729

Change-Id: I9a04b4165f1d85541025fcf48ddf2ad9e39ae94e
2014-04-02 17:04:41 -07:00
Jason Monk
0bfccebc9b Allow the old launcher content URI to be overrided
Move the URI used to import favorites from launcher2 to be loaded
from a string resource.  This allows it to be overridden.

This will enable permissions fix for GoogleSearch.

Bug: 12058200
Change-Id: I31243fe89f545c9771d5cceffe1c9e7668a42bc5
2014-03-21 15:42:06 -04:00
Anjali Koppal
67e7cae5ad Add LauncherProviderChangeListener
Change-Id: I2333a157c488cd048a860982cc675ed9cec626ae
2014-03-17 15:13:01 -07:00
Jason Monk
9364986c83 Merge "Add support for uri favorites and resolve groups" into ub-now-mister-ugly 2014-03-10 18:29:38 +00:00
Jason Monk
41314973b4 Add support for uri favorites and resolve groups
Adds support for new types in default_workspace xml files.

Adds support to favorite that attempts to resolve an intent specified
by URI. If a logical choice can be found from the resolve, it adds the
shortcut.

Adds support for a resolve, which contains several favorites and attempts
to add the shortcuts until one is successful.

Bug: 10547358
Change-Id: Ia30341e77e7d4a0bd4a4f4e6a3d9ce2a48a46237
2014-03-07 13:35:34 -05:00
Dan Sandler
ab5fa3a06a Don't lose icons when migrating from different-sized hotseats.
Launcher2 on sw720dp devices had 8 hotseat slots; Launcher3
has only 6 on those same devices. When importing the old
hotseat, the empty slot (so technically there were 9)
occupied by the all apps button didn't line up with the new
all apps button, causing a hole on the hotseat. Furthermore,
the icon in old position 3 was clobbered by the new all apps
icon:

    0 1 2 3 (#) 4 5 6 7 ==> 0 1 2 (:) _ 4 5

In this CL we introduce a separate sort-and-place step for
hotseat icons so that any icon colliding with the new
all-apps slot can be moved to the right to find the next
nearest open slot. This works well for the 8->6 case; it
will probably do something reasonable, if not ideal, for
other grid migration scenarios.

But those are not covered by this bug.

Bug: 13015468
Change-Id: I7edb3f27addc78ad02bbfcd1c39175ca56220007
2014-03-06 23:54:24 -05:00
Adam Cohen
71e03b9979 Fix issue where clings didn't appear after set up wizard (issue 13077829)
-> Also removed the db-created as a criteria for showing the clings
   (this was a bit problematic in some cases and going forward)
-> Instead, we use database upgrade as a signal to not show the clings.
   This is used instead of the above criteria (to prevent old users from
   seeing the migration cling and losing their data.)
-> Stripped some old code related to custom clings that's no longer used.

Change-Id: Ib5e5285e5ddbc60e69eb998ee9fd092ae879150d
2014-02-21 14:37:53 -08:00
Yura
085c853a57 Do updateWorkspaceScreenOrder inside a single transaction.
The workspacescreens table is updated in LauncherModel.updateWorkspaceScreenOrder
and that the operation to remove all screens, then reinsert the new list of
screens in not inside a single transaction, so if the app is updating or
crashes between ContentResolver.delete and ContentResolver.bulkInsert then
the data will be lost. This CL makes it all happen inside 1 transaction.

Bug: 12523285
Change-Id: I409dbc9f48fa9c8bd4bf3b1453204a4daac1689a
2014-02-11 15:15:29 +00:00
Chris Wren
f4d081107f handle shortcut restore for missing packages
Bug: 10778992
Change-Id: I8766b8d4dd9c0269d52a7ec3da58dd408bc5f09f
2014-01-27 17:30:48 -05:00
Dan Sandler
7a9cda18eb Merge "Defend against missing DB during migration." into jb-ub-now-kermit 2014-01-25 05:00:33 +00:00
Winson Chung
0b560dda27 Adding tighter first run checks for migration clings. (Bug 12626290)
Change-Id: I09fc95c9a3d50ce57f9140e89da2ff4856807f92
2014-01-21 13:00:26 -08:00
Dan Sandler
2b4717447e Defend against missing DB during migration.
Bug: 12600784
Change-Id: Ie295d2ac970eab798b9826748d400cd30a04662d
2014-01-21 14:14:41 -05:00
Adam Cohen
72960975d8 Migration update: ensuring all folders go first
-> Also, leave the last row empty on every screen
-> Fix bug where shortcuts weren't getting moved (introduced in
   previous CL)
-> Only dedupe items directly on the workspace

Bug 12416411
Bug 12572727

Change-Id: Id95cc6081c57cc289c2a85b2a6872ee0bf3eb98a
2014-01-16 11:56:41 -08:00
Adam Cohen
556f6135f9 Don't migrate shortcuts for components that no longer exist
Bug 12570791

Change-Id: Ie4b55afcee0c4d1d16acf7b830d7885800943454
2014-01-15 23:32:46 +00:00
Chris Wren
5dee7aff5f restore app favorites and screens
version 0: restore assuming apps are already installed.

Bug: 10779035
Change-Id: I7f9aa418a7d3d5460a79a229c0fbc80305b5eb5c
2014-01-14 11:23:07 -05:00
Adam Cohen
8b5b05b7f3 Merge "New launcher2 icon migration algorithm." into jb-ub-now-kermit 2014-01-10 21:42:39 +00:00
Dan Sandler
d502404a44 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
2014-01-10 15:49:51 -05:00
Nilesh Agrawal
16f3ea870a Allow DISABLE_ALL_APPS to be set using a system property.
- Moving the property to LauncherAppState
 - The property is only read on dogfood builds.

The property can be set using setprop or /data/local.prop

Change-Id: I14c7354efb12edb93f97e81687a6f920cc634e9a
2014-01-09 17:21:09 -08:00
Nilesh Agrawal
da41ea6698 Allow 5 hotseat icons in DISABLE_ALL_APPS mode.
Added the xml resource in Launcher3 package as well.
This is a dummy resource with just hotseat icons.
Previously reviewed on: http://ag/396580

Change-Id: I31b0d7d4796d028f44f746260c381f2d8226605a
2013-12-09 14:37:59 -08:00
Nilesh Agrawal
d85ee9b994 Revert "Allow 5 hotseat icons in DISABLE_ALL_APPS mode."
This reverts commit f4ed1be4ef.

This broke the build: 
packages/apps/Launcher3/src/com/android/launcher3/LauncherProvider.java:292: cannot find symbol
symbol  : variable default_workspace_no_all_apps
location: class com.android.launcher3.R.xml
            return R.xml.default_workspace_no_all_apps;

Change-Id: I40e80494f06f08de3d827c6816075ac4d269ea6a
2013-12-09 20:39:28 +00:00
Nilesh Agrawal
f4ed1be4ef Allow 5 hotseat icons in DISABLE_ALL_APPS mode.
Change-Id: I71510cf079e211bd53e411e6e43f1bc6475f6d35
2013-12-06 17:58:56 -08:00
Dan Sandler
b3084e87fc Merge "Revert "Revert "Enable Launcher2 workspace import.""" into jb-ub-now-jolly-elf 2013-12-03 04:12:23 +00:00
Adam Cohen
6dbe049431 Only import workspaces for non-tablets (where grid hasn't changed)
Change-Id: I832b6259477d6325c141fddfe9b50cb05aeff8d2
2013-12-02 17:02:36 -08:00
Dan Sandler
d0e4118f2e Revert "Revert "Enable Launcher2 workspace import.""
This reverts commit a6a296ba1f.

https://memegen.googleplex.com/5476445807706112

Bug: 9832552
2013-12-02 16:00:03 -05:00
Dan Sandler
a6a296ba1f Revert "Enable Launcher2 workspace import."
This reverts commit 5b3bdd394e.

Bug: 11768766
Bug: 9832552
2013-11-26 18:55:28 +00:00
Dan Sandler
5b3bdd394e Enable Launcher2 workspace import.
Bug: 11800663
Change-Id: I5c8963bde69e667bf726d1f926a913c347294e16
2013-11-21 08:29:51 -05:00
Dan Sandler
f0b8dacf15 Disable importing workspaces from Launcher2.
Bug: 9832552
Bug: 11761032
Change-Id: I4dfd16046e9d6d0d1d864dff4340b0ed13cc8b8f
2013-11-19 19:31:04 +00:00
Winson Chung
a90303bb6f Adding logs to track down missing workspace screen. (Bug 11683562)
Change-Id: I12ef3331ab81004c75229d33afa0a8dd0fa8521c
2013-11-15 13:10:03 -08:00
Daniel Sandler
55585dbc1d Fix loading widgets in <include>d workspaces.
Resetting the item id was breaking the widget loading code
and is totally unnecessary.

Bug: 11352675
Change-Id: I2e70e542ecc5d8c0664b674ebdac5d520b71b8a0
2013-10-23 18:52:18 +00:00
Chris Wren
e523e70f75 move the provider authority to a config class
Bug: 10816034
Change-Id: I68364081f039f94205b805a1510eb04e6f0f40a2
2013-10-09 12:41:09 -04:00