Commit Graph

26 Commits

Author SHA1 Message Date
Jon Miranda
26256f79c3 Fix work profile promise icon bugs.
- We did not pass in the user when creating the workspace item infos.
- Added check for if app is installed before adding item to workspace
  to prevent any stale promise icons. This seems to happen when uninstalling
  and then immediately reinstalling an application.

Bug: 141556707
Change-Id: I2db2d8da449c37eb248a59fbc9e7b517f50855c1
2019-10-24 13:27:41 -07:00
Sunny Goyal
e7b00128c7 Removing static instance of LauncherAppsCompat and unnecessary wrapper classes
Bug: 141376165
Change-Id: I8c1f1ab7d83ec50fe9c7bf39960ef9c360025ec7
2019-10-02 16:20:22 -07:00
Sunny Goyal
045b4fab76 Removing static listeners from PackageInstallerCompat
Bug: 141376165
Change-Id: I2b49d53a05a04c622ed5a7b723109a6cc230d230
2019-09-30 23:17:15 -07:00
Jon Miranda
14f3936c92 Fix RequestPinItemTest, broken by my manual merge.
Bug: 139880994
Change-Id: I7f6e1dda6cf4497bccf7ea682739bacd12079d4d
2019-08-22 13:37:29 -07:00
Jon Miranda
c84168df80 Add support for adding promise icons for new install sessions by user.
- Added flag PROMISE_APPS_NEW_INSTALLS
- Promise icons only added if flag (above) is on, as well as the setting
  for "Add icon to Home screen"
- Maintains a list of session ids of promise icons that have been added to the
  home screen, so that if the user manually removes the icon, we do not add
  it back to the home screen when the install is completed.
- Queues all applications as promise icons, and replaces with actual
  app info when its being added to the workspace.

Bug: 135633159
Change-Id: I411db59f9bd1b346d98b9bb73f5376a5983b8de5
2019-08-22 10:28:14 -07:00
Sunny Goyal
87dcde6d6c Separating apps list callback from model callback and simplifying various events
Bug: 137568159
Change-Id: I4d8bb5c01cabe642731ebd3f57fe15bdc5a569b7
2019-07-25 11:29:16 -07:00
Sunny Goyal
9dbb27c09c Moving some utilities methods to separate class
Change-Id: I5094b22ddc77c45590cea1a5f5dead0dc7580abf
2019-07-17 15:15:07 -07:00
Sunny Goyal
9589916418 ShortcutInfo renamed to WorkspaceItemInfo
Will get rid of ShortcutInfoCompat in a follow up cl

Change-Id: I7d7d9c938635f59b216290ba28bea9d0e0721a7d
2019-04-16 00:08:24 -07:00
Sunny Goyal
c3f4dc6c6a Fixing workspace screens not including page 0
Instead of maintaining a workspace screen array, calculating it from
the current set of items as needed.

Bug: 122262946
Bug: 119500058
Change-Id: I85bb0e55a4442ab9bcac390a601da0cb2583c26a
2019-01-07 12:14:06 -08:00
Sunny Goyal
c5939393a9 Bye bye workspace screens table
Removing a separate table for workspace screens. List of screens are
automatically parsed using the items in the favorites DB. Order of the
screen based on the screen id and rearranging screens is no longer
supported. In case the screens need to be rearranged, all the items
in the favorites db will need to be updated with new screen ids.

This makes backing up the DB (in the same database) easier as only
one table needs to be duplicates.

Change-Id: I8ba947a898f637d780e2f49925e78604263126e8
2018-12-10 11:43:35 -08:00
Sunny Goyal
efb7e84242 Converting long item IDs to int
> Items ids were already being typecasted to int when being bound on the UI
> Using a consistent type allow better use of platform data-structures
> Adding IntArray and IntSet as a replacement for various Collection classes

Change-Id: Id3c650ed2420c2bfca3bd7671d2b705b56112371
2018-10-08 14:52:39 -07:00
Tony Mak
1b6826c53c Deprecate work folder
FIX: 73876183

Change-Id: I9d15df247eed3500c679cba085c680b75581cffb
2018-02-27 17:47:22 +00: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
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
Rajeev Kumar
44c3ddcf49 Replace use of java.util.HashMap with android.util.ArrayMap in
AddWorkspaceItemsTask class
Bug: 62466540

Change-Id: Iae1e7a639754d08ad7dbb90b20e2e4e205a078f8
2017-06-14 17:50:51 -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
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
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
Mario Bertschler
bf2d46efad Enable Promise App Icon in All Apps.
- feature flag defaults to true
- avoid adding additional workspace shortcut if promise shortcut already
  exists
- handle promise app removal in package added callback for success case

Change-Id: I694701e35cc94481a9c337df3a17b1e5aa2c3b4c
2017-03-21 16:44:38 -07: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
Sunny Goyal
278359539c Adding support for requesting addition of shortcut/widget
on the workspace.

Bug: 33584624
Change-Id: I664366822fe8088742faff2cce006239ab0771bc
2017-01-18 18:38:34 -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
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
3be633b82f Adding support for app widgets in the InstallQueue
Bug: 32904959
Change-Id: I0d07a0c59d266493ae30a42579c1fa69b805009e
2016-12-12 08:37:33 -08:00
Sunny Goyal
2bcbe13c64 Moving ShortcutInfo creation in InstallShortcutReceiver to background thread
> Creating shortcut info requires iconCache access

Bug: 21325319
Change-Id: I3317d8b6824aa05b836f3ed3626f169d4d34f783
2016-11-30 05:47:57 +05:30
Sunny Goyal
f0ba8b7ca1 Moving various runnables in LauncherModel to individual tasks
> Adding tests for some of the runnable

Change-Id: I1a315d38878857df3371f0e69d622a41fc3b081a
2016-11-09 15:50:08 -08:00