Commit Graph

458 Commits

Author SHA1 Message Date
Sunny Goyal
0e947fbdbb Making some methods accessible
Bug: 37616877
Change-Id: I22ed43d9a39d321757d7c2fde7754b95a44780e2
2017-05-19 12:22:31 -07:00
Sunny Goyal
c6bfffb078 Removing workspaceLoaded check from loadDeepShortcuts()
am: 4869bf3f74

Change-Id: I1516a214df024f5e9b9387671cfadd3697384ede
2017-05-19 18:02:00 +00:00
Sunny Goyal
4869bf3f74 Removing workspaceLoaded check from loadDeepShortcuts()
loadDeepShortcuts() is called after loadWorkspace() which already
clears the shortcutMap. So if loader runs twice, during the second run,
workspaceLoaded is true, but the shortcutMap had already been cleared
in loadWorkspace().

Bug: 38384071
Change-Id: I40f0faf88376617e56819aef02620488e528dfb2
2017-05-17 12:07:39 -07:00
Tony Wickham
dce01fe029 Merge "Don't delete legacy shortcuts in loadWorkspace()" into ub-launcher3-dorval
am: 23cae10576

Change-Id: Icb8b72be29249e5df4505bb02c75c6f2a90d6bee
2017-05-05 00:31:49 +00:00
Tony Wickham
431a71320c Don't delete legacy shortcuts in loadWorkspace()
Legacy 1x1 shortcut intents have null package names.
This was causing an NPE when calling LauncherApps#getApplicationInfo(),
which caused those shortcuts to be removed from the workspace.

Bug: 37634887
Change-Id: I6d9876ee1634a573c1f0f94602ae373365cab01c
2017-05-04 17:08:30 -07:00
Jon Miranda
2b823f452b Show icon in PendingAppWidgetHostView immediately.
Before this change, PendingAppWidgetHostView would appear 'blank'
until they were loaded -- which could take a while depending on
how many apps the user had, because the all apps icons are loaded
first.

Bug: 36815047
Change-Id: Ia7449cce4341ed9e9384fc8aaadeaae6c33bb262
2017-05-03 17:05:41 -07:00
Tony Wickham
623daea93b resolve merge conflicts of 6f725f283 to ub-launcher3-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I3559969b62a9a4b1ec04697109636e8cb0fd9fc8
2017-04-20 16:24:09 -07:00
Tony Wickham
6f725f2831 Merge "Only add widgets system shortcut if widgets exist" into ub-launcher3-dorval 2017-04-20 23:08:47 +00:00
Tony Wickham
a7e1c1c088 Only add widgets system shortcut if widgets exist
Before we were adding it in a disabled state, and then enabling it once
widgets were bound (if widgets existed for that app). Now we load all
widgets when launcher starts so that we can use the values for the
purpose of animating the popup container. Then, as the container opens,
we reload widgets/shortcuts for that particular app and add/remove the
widgets shortcut if necessary.

Bug: 34940468
Change-Id: I64bd009442d10d3d1f9a977bdedfdb639a7dd193
2017-04-20 15:10:38 -07:00
Sunny Goyal
581a69e6d4 Merge "Deleting any ghost widget from system service:" into ub-launcher3-dorval
am: f2d8b65775

Change-Id: I1d9b7a5a532bf504aabac69691e3f83e2f181a04
2017-04-18 22:20:19 +00:00
Sunny Goyal
55fddc825b Deleting any ghost widget from system service:
> A one-time DB update for removing any existing ghost widgets
> Handling widget cleanup when we bulk delete workspace items during loader
> Simplifying external delete

Bug: 35634653
Change-Id: Id0c520f57aee6d75d9c0e7bcd5786a464bf9f39f
2017-04-17 15:28:39 -07:00
Hyunyoung Song
0aa685bb6f Merge "Launcher dump proto that will be used for:" into ub-launcher3-dorval 2017-04-06 22:42:10 +00:00
Tony Wickham
6c300c89ec resolve merge conflicts of 128b7e59a to ub-launcher3-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I927373593dfb1b67b504a76b1ad013357b363a6e
2017-04-05 13:14:01 -07:00
Hyunyoung Song
e295acaeb3 Launcher dump proto that will be used for:
$ adb shell dumpsys activity provider com.android.launcher3/com.android.launcher3.LauncherProvider
To see how the proto is filled: go/launcher-proto-dump

b/31772480

Change-Id: I8e0f1e5e38148a3dfeabd2fc057392193b2625dd
(cherry picked from commit 6aa3729e98)
2017-04-04 23:06:30 +00:00
Tony Wickham
86222d23e2 Add support for getting widgets/shortucts for a particular package/user
Bug: 34940468
Bug: 33553066
Change-Id: I5d0131df206c6a13d4227ad28c5b094bbf1343df
2017-04-04 14:36:52 -07:00
Mario Bertschler
c06af333cb Minor Refactoring only: no functional change
- organizing imports
- remove redundant modifiers on LauncherCallback interface
- fix typos

Change-Id: I61eb985cac7c1379b6b804a67d4f234386d3d1b4
2017-03-28 12:23:22 -07:00
Sunny Goyal
d23f37794f Merge "Removing the profile extra from intent and using the profile id from the profile column" into ub-launcher3-dorval
am: 77ff9a4343

Change-Id: Ib0cd8cb8f963b78a9cd53ed896aeb6e4f6163683
2017-03-21 23:21:26 +00:00
Sunny Goyal
24bb66a1c5 Removing the profile extra from intent and using the profile id from the profile column
The intent extra is not always correct as the profile id can change during backup restore.
This allows us to use a consistant behavior everywhere.

Change-Id: I004bd244204ca91758b1d42488e1fc13b0ccb998
2017-03-21 15:14:43 -07:00
Mario Bertschler
08ffaae3b6 Show promise app icon progress in All Apps and setup market intent
on clicking promise app icon in All Apps.

Only the progress will be changed with animation on progress update,
no relayout is performed. If the icon is newly bound, the progress
will not be animated.

Bug: 23952570
Change-Id: I98d3f945f08a2abadf53f20e6007c15e56d5d410
2017-03-20 16:02:24 -07:00
Mario Bertschler
817afa3447 Show promise app icon in All Apps while installation process.
This CL only modifies the model and is behind a feature flag
which per default is set to false.
The app icon will appear as a promise icon, it reacts on icon
or label changes and the icon will be remove on finishing the
installation process. With this CL the progress of the installation
process is not visible.

Bug: 23952570

Change-Id: I510825d0b0b1b01eb14f7e50f0a2358b0d8b99b5
2017-03-17 09:21:35 -07:00
TreeHugger Robot
93ce56fdb2 Merge "Separating the config and flags in different directories so that it is easier to override one or the other" into ub-launcher3-master 2017-03-07 22:42:14 +00:00
Sunny Goyal
b265ba7449 Removing DeferredHandler and using a simple Handler to post callbacks
DeferredHandler was added when we were posting each icon separately,
to prevent starvation. But since then we have moved to binding batct
items during bind.

Also fixing waitForIdle not waiting the second time. waitForIdle was
using a global variable to maintain state, and was not waiting properly
when its called the second time before binding deep shortcuts

Original Change-Id: I9c1289cb3bfb74f86e53ec7ac6dd76bb39666b2d

Change-Id: I9e6b3ae65fbd3aec3a46092efc5249c4525efedf
2017-03-07 13:44:52 -08:00
Sunny Goyal
3d706ad703 Separating the config and flags in different directories so that
it is easier to override one or the other

Bug: 36001650
Change-Id: I713f4f5dbcf902614ce9f6c7a73bdace7bdf1ea0
2017-03-07 09:30:51 -08:00
Hyunyoung Song
6bfcbecbb4 Merge "Launcher dump proto that will be used for:" into ub-launcher3-master 2017-03-02 02:01:42 +00:00
Sunny Goyal
69d520cc86 Merge "Fixing SDCard and package enabled state checks in PackageManagerHeler" into ub-launcher3-dorval
am: ed7bef195c

Change-Id: Ifb4ab24887d58fa1ffa85f86a579ef31aef75394
2017-03-02 01:31:23 +00:00
Hyunyoung Song
6aa3729e98 Launcher dump proto that will be used for:
$ adb shell dumpsys activity provider com.android.launcher3/com.android.launcher3.LauncherProvider
To see how the proto is filled: go/launcher-proto-dump

b/31772480

Change-Id: I8e0f1e5e38148a3dfeabd2fc057392193b2625dd
2017-03-01 17:21:19 -08:00
Sunny Goyal
ad2e91a216 Fixing SDCard and package enabled state checks in PackageManagerHeler
Bug: 32365540
Change-Id: Iaac3e08ce55457ebbfb3633514ebc8ade6d200c5
2017-03-01 17:17:40 -08:00
Jon Miranda
529af302dc Use FolderIconPreviewVerifier to check if item is in preview.
Bug: 35064148
Bug: 33600656
Change-Id: I71a03636276e6169c7eb8c68eecf31f37fde2d56
2017-02-28 17:52:42 -08:00
Jon Miranda
655ec42ce5 Added FolderIconPreviewVerifier class.
This class verifies whether an item in a Foder is displayed in
the FolderIcon preview, based on the item's rank.

We use this class to determine which items in a Folder will be
displayed in the preview.

Bug: 35064148
Change-Id: Ia21bccbd95c348efeac62591ae3696a4c60b5339
2017-02-28 11:57:26 -08:00
Sunny Goyal
e05b08f705 Using transaction when dropping tables, so that the DB never enters
an inconsistant state

Bug: 34720697
Change-Id: I55a26d63be6c06622da6ee3395bf1990f1a58a11
2017-02-23 18:30:56 -08:00
Jon Miranda
f28629a47b Ignore tasks if the LauncherModel is still pending.
The tasks will be enqueued after the model is loaded when it
gets to the final state.

Bug: 31509386
Change-Id: Id72aaedb025a91a49b25e1ef103cc1976d603b21
2017-02-23 15:12:42 -08:00
Sunny Goyal
dd96a5e4fd Simplifying Model data load state management
Instead of maintaining 3 different states, each tied to a subset of data,
maintaing a single state that represents all the data. Individual subset
data is invalidated in rare cases and these invalidates are tightly tied
to the UI. This also allows us to add new data to the model, without worring
about classifying the data into a subset.

Bug: 34112546
Change-Id: Id9cb273de35b79e84a2ef8d6556fcf1e72fb4b75
2017-02-22 15:45:14 -08:00
TreeHugger Robot
232f6a3884 Merge "Launcher3: fix app shortcuts for suspended apps" into ub-launcher3-master 2017-02-21 20:33:33 +00:00
Charles He
3ff9047221 Launcher3: fix app shortcuts for suspended apps
This CL fixes app shortcuts for suspended packages.

1) When DO/PO suspends an app, its pinned shortcuts are instantly grayed
out, but this is not persisted after the launcher restarts (e.g. device
reboot). We now enforce the launcher to check the suspended state when
loading the workspace, and gray out pinned shortcut icons accordingly.

2) When DO/PO suspends an app, its app shortcut popup is still
available. We now temporarily disable the popup when the app is
suspended, and persist the state across restarts.

Bug: 32365540
Test: manual, by following the steps in the bug above
Test: manual, by restarting the launcher package
Change-Id: I983d7c17fa198beca23b66459b50bd67b447bdd2
2017-02-21 20:23:50 +00:00
TreeHugger Robot
93bc3c1e41 Merge "Separating methods for updating the model to a sepatate class." into ub-launcher3-master 2017-02-16 21:56:39 +00:00
Sunny Goyal
43bf11d9c9 Separating methods for updating the model to a sepatate class.
Removing static access to model update methods, to allow for better
access control and testing

Change-Id: I9afe004dbf1b2fe50df422fd28bceea9230a4704
2017-02-16 13:50:14 -08:00
TreeHugger Robot
ee544c5d24 Merge "Making methods in PaackageManagerHelper non-static" into ub-launcher3-master 2017-02-09 23:28:21 +00:00
Sunny Goyal
342e466739 Making methods in PaackageManagerHelper non-static
Bug: 34112546
Change-Id: Ia3db3e2f56d26e314000e302b51e6d38607c525d
2017-02-02 15:26:12 -08:00
Hyunyoung Song
3c7d9cbb20 Clean up around 1) Log.VERBOSE and 2) dump
b/31772480

Note: in the follow up CL, I will add the dump result of the bgDataModel
to a proto

Change-Id: I5261cff0fb29cedd1dd772b8b15f67095ad5b967
2017-02-01 15:11:08 -08:00
Sunny Goyal
81e4491450 Fixing loadWorkspace
> Adding checks on legacy shortcuts
> Checking restore status based on package and not componentName

Bug: 34123342
Change-Id: I442699e4ebb34ae66aa25c512bfcdc1b4fd5ae2a
2017-01-24 22:55:36 -08:00
Sunny Goyal
1b0726359b Moving icon generation out of ShortcutInfo constructor so that it
can be created on the UI thread

Change-Id: If84e52041eb4ab20807f5cfd4b7f31d7b5f381ed
2017-01-18 11:30:59 -08:00
Sunny Goyal
c1ad0ce8ae Only marking items not already restored as restore
> Moving the restore property to LoaderCursor

Bug: 34123089
Change-Id: I1f992ef086d65e0b3cf18d3b2cf37a4f254c97d2
2017-01-13 10:38:41 -08:00
Sunny Goyal
e6e7200791 Removing promiseIntent property from ShortuctInfo
> Instead of checking promiseIntent != null, using isPromise() for consistency
> Fixing bug where clicking a pending icon does not launch anything
> Fixing bug where draging an icon on Info target, permanently hides the icon

Change-Id: Ic8f6b56042dba42d5ed9aedb0f5947186e1a4208
2017-01-12 18:54:21 -08:00
Sunny Goyal
3e9be43b6e No more LauncherActivityInfoCompat
Bug: 32745285
Change-Id: I00f13794d5dc0a2b1fe03ec74de36018f22eb386
2017-01-11 13:06:50 -08:00
Sunny Goyal
87f784c285 Removing static Context access using LauncherAppState
> This ensures that LauncherAppState is only accessed in the presence of
a valid context

Bug: 33032833
Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
2017-01-11 12:52:03 -08:00
Sunny Goyal
1cc1c9ad83 Enforcing background thread when accessing iconCacheDb.
> Moving any icon cache access to background thread
> Updating Apps list to avoid loading icons for ignored apps

Bug: 21325319
Change-Id: Id72755100f1176ccfcc99249c5e02873cc249a13
2017-01-10 23:42:49 -08:00
Sunny Goyal
aaf86fe9a0 Refactoring some loadWorkspace logic in a separate class
Bug: 34112546
Change-Id: I8a43ed1646056aa1957ac3d6ea82018691df6386
2017-01-10 13:53:50 -08:00
Sunny Goyal
a32bf9b181 Removing logic around replacing icon during restore
This logic was dependent on key-value based backup. Since we are
using full-backup, the appropriate flags are never set.

Bug: 18764649
Change-Id: I95a93eee63ac9c82acfb66abfdd1a5407974df46
2017-01-05 14:07:58 -08:00
Sunny Goyal
3fe4a146cf Simplifying IconCache access code
Providing a way to access icon cache without LauncherAcitivtiyInfo.
This allows fetching LauncherActivityInfo only when required, thus
avoiding system RPC when the icon is already in cache.

Change-Id: I92918c7a0d0d0796e5f7b70d4ecb6787c52c6600
2017-01-03 15:58:53 -08:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00