Commit Graph

431 Commits

Author SHA1 Message Date
Sunny Goyal
605bcf3367 Fixing bug when model was not reflected properly on the UI.
If launcher submits a job, and then reloads before the job is executed, the correct model
is not reflected on the Launcher. In that case, we simply rebind the launcher

Change-Id: I380242a4de13e7b2bc326d1a076f0a974435999c
2018-03-05 17:38:47 -08:00
Sunny Goyal
0e7724cef7 Ensuring that all the pending tasks are run
before marking the ViewOnDrawExecutor as completed.

Also fixing model writer not updated on rotation

Change-Id: I5ecd7ac865b939ffa4c02afe892bd773d9f275c3
2018-02-22 17:27:13 -08:00
Winson Chung
d6519668bf Revert "Revert "Synchronizing loader preload to avoid launcher getting stuck in loading state,""
This reverts commit 73aa3025c0.

Reason for revert: Post-drop revert

Change-Id: Ife752d26e07d9c064c938ff8d33d40457b54217a
2018-02-16 03:23:51 +00:00
Winson Chung
73aa3025c0 Revert "Synchronizing loader preload to avoid launcher getting stuck in loading state,"
This reverts commit a1b4911e26.

Reason for revert: Temporary revert for NL build

Change-Id: I81527681bd00d49e590a99e238f4d57e5a619d16
2018-02-16 02:42:33 +00:00
Sunny Goyal
a1b4911e26 Synchronizing loader preload to avoid launcher getting stuck in loading state,
which could be caused by the following sequence of events

  1) Starts preload => execution moved to background thread
     a) check if loader is running
     ... execution moved to ui thread

  2) Launcher starts
  3) Cancels any running loader and starts a new loader
     .... Execution on background thread
    b) Cancels any running loader and starts a new loader

Synchronizing (3), and [a, b] under same lock would avoid this case
Bug: 73399920

Change-Id: I6b01f797fd6f4a2e5b3c078bb374ad40fcc311c8
2018-02-15 10:31:50 -08:00
Sunny Goyal
e75d9f1ec3 Preloading the LauncherModel in case launcher dies
Change-Id: Ibe529f31e96c645d45d51b9f3bf6c21b76b41254
2018-01-31 12:01:59 -08:00
Sunny Goyal
18a4e5aefb Making LauncherIcons thread safe
Creating a pool of LauncherIcons so that they can be used from multiple threads

Change-Id: Idc7b5ddb47b6e338a5389f3c4faa6f63de108c72
2018-01-09 17:30:52 -08:00
Sunny Goyal
179249d804 Dominant color is part of icon cache
> Calculating extracted color during icon generation and storing it in model and DB
> Removing unused logic avoid various types of badge rendering
> Icons are badged with extracted colors, while folder is badged with theme color

Bug: 35428783
Change-Id: I93e30c52fbded7515c3ae1778422e84672eafb56
2018-01-03 16:55:58 -08:00
Sunny Goyal
29947f0b53 No more waiting around for resume
Apply model updates as son as they arrive instead of waiting for onResume.
Various workspace items do not use any configuration dependent resources.
For Widgets, we wait until the host starts lietening before inflating the actual view.

Change-Id: Icb2f5e5940c1ce6c27062ccd34eff87e80af5ab1
2017-12-19 12:50:17 -08:00
Sunny Goyal
aeb1643ec6 Launcher state management cleanup
> Removing Widgets and related states
> Fixing different durations being used when opening/closing all-apps
> Removing some unnecessary object allocations when changing state without animation
> Differentiating widget bootm sheel and full sheet in logs

Bug: 67678570
Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
2017-10-17 12:42:08 -07:00
Sunny Goyal
f1fbc3fbe7 Converting widget panel into a floating view
> The widget panel is only inflated when needed
> Using the swipe up/down interaction for widgets tray
> Removing additional view wrappers from all-apps
> Widget tray is preserved across activity recreation
> Launcher no longer has WIDGET state, the actual code around
  the states will be removed in a follow-up cl

Bug: 67678570
Bug: 67585158
Change-Id: Ia29a7c33ec81e6c53cc24e2906b7022b6f41755b
2017-10-13 18:47:54 -07:00
Sunny Goyal
91498abf75 Moving install queue updates to worker thread.
This avoids acquiring a lock for upating the sharedPrefs during onResume
as all the logic runs on a single thread.

Bug: 67305604
Change-Id: I1bbea382da9fafb403b4e9508f393f78db28478d
2017-10-06 11:33:43 -07:00
Sunny Goyal
f2dd4216c1 Removing extraction service and palette api dependency
Change-Id: I30ad1a1462a97b6bc03f8e386ae3058c7fe022e5
2017-09-29 10:40:08 -07:00
Sunny Goyal
6e13dd3aa8 Simplifying some package matching code by using common itemInfo mathcher
Change-Id: Ib98d528391e19c0de3fe11304330dfa37710548c
2017-08-17 11:15:12 -07:00
Sunny Goyal
b23980cc0e Fixing duplicate/inconsistent definitions for model and callbacks
> 2 implementations for filtering workspace items
> 2 implementations for binding widgets
> duplicate logic for add and update appInfo

Change-Id: Id68a49926af398478deca8ac85ab1f22341a9449
2017-08-17 11:05:56 -07:00
Tony
2917a8bf2b Defer some work until after workspace fade-in
Defer:
- Setting all apps
- Setting widgets

Also set the launcher-loader thread to THREAD_PRIORITY_BACKGROUND
for the duration of the animation.

Bug: 37965432
Change-Id: I8364940805b84aecb8353a473ab4d575c27bfec4
2017-08-04 11:52:42 -07:00
Sunny Goyal
64a75aa305 Adding A feature flag to disable widgets and a corresponding build
target Launcher3Go without widgets support

Bug: 62353159
Change-Id: Ia03d2235a9bcf75f9ef191924f81630e63a2c684
2017-07-21 14:10:13 -07:00
Sunny Goyal
e86f11fa38 Adding support for loading workspace in the absence of Launcher.
> LoadWorkspace can be called with a LoaderResult which does not bind anything.
> Synchronous bind does not look for a valid page id, and will fallback to the
  current pageId similar to full load flow

Bug: 37616877
Change-Id: If14491dc79c5b85ae1019cc93e4e08759df3387d
2017-06-08 09:39:34 -07:00
Sunny Goyal
b434fde427 Moving LoaderTask to a separate class file
Bug: 34112546
Change-Id: I86d93cfb5d3903bfd3878564cbe8b67b64fd8423
2017-06-06 10:47:23 -07:00
Sunny Goyal
c6e97692e4 Moving LoaderTask static
Will move it to a separate file in a followup cl.
This simplifies dependencies between LauncherModel and LoaderTask which
and making it easier to start the loader before Launcher activity is
created (as the Callbacks in LauncherModel can change while loader is running).

Bug: 34112546
Bug: 37616877
Change-Id: Ie9619c6b0de0e3eb60657c04ae1b58d946c829e9
2017-06-02 14:27:29 -07:00
Sunny Goyal
f8d6ed21ce Moving workspace bind logic into a separate class.
This change separates the loading and binding code. Eventually workspace
loading will not depend on bind and we will be able to preload workspace
even before the launcher activity is started.

Bug: 34112546
Bug: 37616877
Change-Id: Ia8e661465cb40ad073b5b76adfc74b9e15633b1d
2017-06-01 15:56:38 -07:00
Sunny Goyal
a474a9bcf5 Simplifying logic for managed for icon addition
> Checking for duplicate icons before adding new icons

For O and above, icon addition is controlled using
SessionCommitReceiver.
As long as the Launcher is the default app, it will keep adding
icons on the homescreen. Apps installed while launcher was
not the default homescreen, no icons will be added.

For below O, icons are added based on package event. As long as
the Launcher process is running, it will keep adding icons on the
homescreen. Apps installed while the launcher app was dead, no
icons will be added.

Bug: 37528649
Bug: 37082950
Bug: 34112546
Change-Id: Ic99501fa476c00474a479f2a36c24614bfa3f4bf
2017-05-22 13:31:04 -07:00
Sunny Goyal
8bca47adc5 Merge "Making some methods accessible" into ub-launcher3-dorval-polish 2017-05-19 21:09:55 +00:00
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