Commit Graph

78 Commits

Author SHA1 Message Date
Vinit Nayak
6106ae9ac7 Add logs for PackageUpdatedTask
* That's the bit that updates new packages for work profile,
at least from command line.
* There is variability in how long it could take work profile
apps to show up, from 2-8 seconds.

Bug: 243688989
Change-Id: I710befc5f17b4a16bff523eb03f1e88975cafd43
2023-04-26 13:21:57 -07:00
Sunny Goyal
84b48d8deb Removing support for adding legacy shortcuts.
All existing legacy shortcuts will be migrated one-time to deep shortcuts
This shortcuts are pinned under the Launcher package, with custom badging

Bug: 275875209
Test: Updated unit tests
Flag: N/A
Change-Id: I7da001f724776ad8d6c807517b7e4e259de626c2
2023-04-10 12:28:52 -07:00
Pinyao Ting
777c13eb00 Explicit Nullbility in Launcher (Part 5)
This CL addresses the nullbility in LauncherModel and update tasks.

Bug: 242895652
Test: manual
Change-Id: Ied635c944c3656f0d493b295f772aa0329b354b9
2022-09-16 17:17:16 -07:00
Pinyao Ting
415740978b Include additional logs for widget removal
It isn't clear what causes widgets to be removed when restoring on a new
device. This CL included additional error message, which hopefully would
reveal the root cause.

Bug: 235923862
Test: manual
Change-Id: I8601d8fe598072dc9def0549796d1e527e167e23
2022-07-19 14:43:32 -07:00
Pinyao Ting
6a41d56b50 Log the reason why a WorkspaceItemInfo was removed
In the past we've seen a WorkspaceItem disappeared from the workspace
but wasn't able to determine why it was removed. This CL includes the
reason why it was removed in the error log, which hopefully would help
us debugging similar issues in the future.

Bug: 231239260
Test: make
Change-Id: Iba3d57568c9b3e011a6b65b26f0d4170d42fe1a5
2022-05-16 20:17:47 +00:00
Sunny Goyal
32084d49d3 Replacing ItemInfoMatcher with predicate
This removed unnecessary componentName lookups when it
is not required. Many checks just rely on IDs and
userHandle

Bug: 231153610
Test: Presubmit
Change-Id: Ief93954abc5861062a9f55dc2ef181d3de106c62
2022-05-03 10:07:22 -07:00
Sunny Goyal
7dece749a3 Updating logic to check if icon needs badging
Bug: 209503720
Test: Manual
Change-Id: I66f0dbaf81be3190a106323fe3ce87717626d8e7
2022-01-19 17:22:46 +05:30
Sunny Goyal
ed2a55f413 Removing widget preview caching
> All previews are generated on demand when the corresponding
  header expands
> Using ItemAnimator to animate layout changes when preview loads

Bug: 196238313
Test: Manual
Change-Id: I0cb859c8443c2c536399e4063f58baecfc7416ad
2021-08-17 17:50:30 -07:00
Stevie Kideckel
10d4edade1 Merge "Refresh widgets in the model when packages change" into sc-dev 2021-06-17 15:04:01 +00:00
Stevie Kideckel
69af278f8a Refresh widgets in the model when packages change
Fix: 191163748
Test: local sample app
Change-Id: Ic09ad11cabf6efa471fb6e685cb255c4a17493ee
2021-06-17 13:08:53 +00:00
Schneider Victor-tulias
bcd72a7b32 Fix broken app icon on restart during install.
Fixes: 186610233
Test: manual with backup/restart and restart during install
Change-Id: Ic64bd98758bc2e1a2a1562579cb25de02faa624c
2021-06-16 16:47:45 -07:00
Sunny Goyal
4c23ca768f Fixing shortcut intent getting cleared during backup/restore
Bug: 174570283
Bug: 156871815
Test: Verified on device
Change-Id: Ie286ee783bfe96c5b2be28f0db5298caf3801e6d
2021-02-12 18:04:23 +00:00
Schneider Victor-tulias
1b4d5034fb Fix icon flicker on transition from installing, to installed, to downloading incrementally.
When an app finished downloading, we assumed that its progress level was 100%. This caused flicker in apps that supported incremental downloads. Added a check for the total download progress on app installation.

demo: https://drive.google.com/file/d/11NwwhHj_4rmDFwpsb8gTX-uA5YSinjSj/view?usp=sharing

Fixes: 178745816

Test: manual

Change-Id: I08328296db2ce2c2242fc4fe87158ff4b911c659
2021-02-03 16:39:16 -08:00
Schneider Victor-tulias
9918e94c03 Revert "Revert "Add UI updates for incremental app installs.""
This reverts commit 6e60380abb.

Reason for revert: revert was unnecesary

Change-Id: I021769e929d3026b23c5f644e2ee629cec21a301
2021-01-20 00:42:03 +00:00
Schneider Victor-tulias
6e60380abb Revert "Add UI updates for incremental app installs."
This reverts commit b803f7e2cb.

Reason for revert: causes b/177642572

Change-Id: I48b85e8495734a2d3a7b477dfb20929879465b6a
2021-01-19 19:50:18 +00:00
Schneider Victor-tulias
b803f7e2cb Add UI updates for incremental app installs.
1. Changed Preload Icon UI to be grayscale while the app is not startable.
2. Added progress bar for when app is installed but still ownloading.
3. Updated Preload Icon progress and click handling to use new incremental api.

Progress bar color updates will follow in a separate CL.

Demo: https://drive.google.com/file/d/1H1EvtTorLeJwC1eiq10tm-TT81YZ6osk/view?usp=sharing

Fixes: 176901235,176992421,176884453

Test: manual
Change-Id: Ie0575dc56c33c5d6ecd6c5cbf00666b96d6dcb16
2021-01-12 16:04:01 -08:00
Sunny Goyal
60e68c91e9 Removing static state management from the install shortcut queue
Change-Id: I0b74a843b2081ee314e0840d5ea8ab8ddabde32b
2020-08-12 14:37:15 -07:00
Sunny Goyal
eaf7a95546 Changing minimum supported Launcher version to 26
Change-Id: I49fcf874430ac53c3246371e179fbd828e14e4da
2020-07-29 17:30:19 -07:00
Sunny Goyal
ea600c70fd Creating a common method to iterate over all model items.
This would allow adding different source for model items without
modifying every model task

Bug: 160748731
Change-Id: I5a14dd761e2b8696c58dc8fec7b14077da0aced3
2020-07-10 09:56:15 -07:00
Sunny Goyal
28daf4a76f Removing multiple system RPCs to packageMAnager and userManager from UI thread
Bug: 158427348
Change-Id: Ibb1837fe932000b69cf5683bb01727fc32abca91
2020-06-08 17:56:36 -07:00
vadimt
99939d3b0d Removing tracing for a fixed bug
Bug: 139891609
Change-Id: Ic7c988f06022b82685a3216154a47783ef2ec98b
2020-04-22 13:32:03 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Sunny Goyal
fa39536570 Removing static reference of deep shortcut manager
Bug: 141376165
Change-Id: Ie60b82be63a8926825598c681d8b2a1b2ace6413
2020-01-02 20:13:12 +00:00
Sunny Goyal
337c81f664 Removing static instances of UserManagerCompat and AppWidgetManager
> Changing the lifecycle to follow other static objects in Launcher
> Removing compat interface and inlining everything to helpers

Bug: 141376165
Change-Id: I82bd5db1969101de9a7eac77f32728d70195bb35
2019-12-11 10:03:19 -08:00
Sunny Goyal
3808a69a6c Storing BitmapInfo instead of icon and color directly in itemInfo
This will allow subclassing BitmapInfo to support custom icon/dynamic
icons which can be loaded on the background thread instead of going
through IconFactory which runs on UiThread

Change-Id: Ieced6e91330bdff1b505826d097a8df711dfe967
2019-10-28 11:12:47 -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
Jon Miranda
a4deb15c30 Merge "Fixed a bug where restored promise icons stay promise icons." into ub-launcher3-qt-future-dev
am: 32a3421f1a

Change-Id: Ic8c429b151e4e679c7e38e0b33bc30f885dd4ba1
2019-09-24 13:25:16 -07:00
Jon Miranda
3944746fb6 Fixed a bug where restored promise icons stay promise icons.
Test:
1 Turn off WiFi
2 Install app. (Promise icon gets added to home screen).
3 Backup launcher.
4 Restore launcher.
5 Turn on WiFi
6 Note promise icon gets updated with as installation progresses.

Will submit to future/master later.

Bug: 140212732
Change-Id: I63cedc6c16f5028297fb1a0852ffbd4473319ae9
(cherry picked from commit 0e1b17f8c4)
2019-09-24 19:40:30 +00:00
Samuel Fufa
b5a16812a6 Merge "Add Logs to track app uninstall and icon removal" into ub-launcher3-qt-future-dev
am: 2b06908252

Change-Id: I638ad5d2f48a577503b8925253152e0a9b42ab6d
2019-09-16 20:50:55 -07:00
Samuel Fufa
cc1e1075bb Add Logs to track app uninstall and icon removal
Some users are affected by a bug that keeps orphaned app icons after a
package is uninstalled. Since we are unable to pinpoint to what exactly
is causing this, we're adding logs so we could tell where exactly things
are failing.

Bug: 124817089
Change-Id: If168935115a7d323fd60c2b19426c1dbd43dbce3
2019-09-16 14:35:44 -07:00
Sunny Goyal
3e3d759db2 Removing flag overrides. All flags should be defined as togglable flags instead.
Change-Id: Ia7b9ff84413096cd5b0c4a9a81a232019f2522d2
2019-09-12 10:17:14 -07:00
vadimt
ce7ec2e645 Merge "Adding tracing for suspending via Wellbeing" into ub-launcher3-qt-qpr1-dev
am: 418787778b

Change-Id: Id8869a40893ef596b3ad50275d8e9bfa3fdac2c4
2019-08-22 16:35:31 -07:00
TreeHugger Robot
418787778b Merge "Adding tracing for suspending via Wellbeing" into ub-launcher3-qt-qpr1-dev 2019-08-22 23:22:02 +00:00
vadimt
872cf29211 Adding tracing for suspending via Wellbeing
Bug: 139891609
Change-Id: I3ffb7941f7c4015cba3c65d87e20ccc6be920592
2019-08-22 15:30:42 -07:00
Jon Miranda
89137e7bb8 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: Idf2fc9033f890afef924628b76b89ad4692f529c
Merged-In: I411db59f9bd1b346d98b9bb73f5376a5983b8de5
2019-08-22 10:42:45 -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
6bbf6004f8 Removing ShortcutInfoCompat and directly using ShortcutInfo
Change-Id: I2842689e192a206c0d31558c8126eae1c7904598
2019-04-22 15:39:40 -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
Hyunyoung Song
cda96a5b43 Setup make icon-loader library
Bug: 115891474

Test: make -j10 icon-loader
Next step: Launcher will depend on icon-loader in next CL

Change-Id: I797ddb857cf8be79f3be6ca2f174c593ca3713a5
2018-10-19 14:33:46 -07: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
Hyunyoung Song
48cb7bc7a4 Move IconNormalizer/ShadowGenerator/LauncherIcons to icons package
Bug: 115891474

Sending out the package name changing CL first before I make
LauncherIconsHandler and tests around it.

Change-Id: Ic10479a06333e1435b392a7072cd08782e710cbd
2018-09-26 11:57:37 -07:00
Sunny Goyal
f840f10d50 Removing additional rpc due to icon cache update
When launcher loads, it fetches the list of apps twice, once for
loading all-apps and again for updating icons. Instead reusing
the previously fetched apps list.
Also moving the icon loading in a separate package for further
generalization

Change-Id: Ibd2dae56e6027a31b633da030bc6b43a90b27e1b
2018-09-21 15:27:03 -07:00
Tobias Dubois
a4c1002bac Fix auto install add of installed activity
Reset the restore status for auto install icons where the activity is
installed and enabled so the item is not stuck in the auto install
state.

Bug: 112664405
Test: manual - See issue
Change-Id: I37116b6e6ecbe4215d96627f9b1ea6909d12a6c0
2018-09-07 13:59:04 -07:00
Tony Wickham
f9d9df7d3a Gracefully fallback to new ComponentName if one is renamed/removed
Previously, if a developer renamed their launcher activity, we removed
all instances of their icon from the home screen, since technically the
activity they pointed to no longer exists. However, in the vast majority
of cases, the developer simply renamed their activity and nothing should
change from a user's perspective. So instead of removing icons that no
longer point to a valid activity, we now redirect them to point to the
first activity in the manifest (or remove them if there is none).

Test:
- Install app with Activity A and place on home screen
- Rename A to B and reinstall - verify home screen icon remains
- Add new launcher activity C - verify icons still go to B
- Force stop launcher and rename B to A - verify icons go to A (same activity)
- Remove activity A - verify icons go to C
- Remove activity C - verify icons are removed

Bug: 28907647
Change-Id: If9da251bd588908c4c425e7dd32e38fcbe54bab2
2018-09-05 18:23:54 -07:00
Sunny Goyal
2b787e5bd6 Using a placeholder icon shape instead of low-res/blurry icon
Bug: 111142970
Change-Id: I867224464ae9c026f4dcb5256ef14fc39c8e751d
2018-08-27 10:43:46 -07:00
Sunny Goyal
e48fe1095d Deleting invalid icons when an app is restored
When a app is restored, it may not be in exactly the same state as it was when backed up.
Some components might be missing, and some shortcuts may be disabled or unavailable

Bug: 63525806
Change-Id: I09e6c0e9a9d2c1e8ccd73430f94bd065bdf2718e
2018-05-30 15:23:09 -07: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
076839c321 Moving various runtime flags into the common base class.
Caching the ststemApp status for workspace shortcuts.

Change-Id: I25663e1f04a9768afcca000294adcbb00ea1db7b
2017-10-31 11:00:28 -07:00