Commit Graph

508 Commits

Author SHA1 Message Date
Sunny Goyal
777d49062f Revert "Revert "Migrating all model tests to Instrumentation tests""
This reverts commit 7a4a30d86d.

Test: Presubmit
Reason for revert: Fixing original bug

Bug: 196825541
Change-Id: Id4b1eb24a89564d264266d305aebea52917dfcd9
2021-08-31 10:51:52 +00:00
Alex Chau
7a4a30d86d Revert "Migrating all model tests to Instrumentation tests"
This reverts commit 455ba62b5d.

Reason for revert: Breaks tests on all targets

Bug: 196825541
Bug: 197570389
Change-Id: Ida6792a09c54dee46105b6b914a0dd1545bdf48d
2021-08-24 17:27:52 +00:00
Sunny Goyal
455ba62b5d Migrating all model tests to Instrumentation tests
Bug: 196825541
Test: Presubmit
Change-Id: Iebd46eb41eb46c187d569197f4b97b4fddc0f6f7
2021-08-23 12:34:44 -07:00
TreeHugger Robot
04c4f94223 Merge "Fixing ModelPreload cancelling existing load" into sc-qpr1-dev am: 8782ad4f99
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15524186

Change-Id: Ib89cd2bbe854242c87f52d2edc384ae864af01c2
2021-08-18 05:21:30 +00:00
Sunny Goyal
57e0866fdd Fixing ModelPreload cancelling existing load
When a model preload call was made while the loader task is running
(eg: on enabling/disabling icon theme, Launcher reloads and then
launcher preview start a model-preload), it would cancel the original
loader and then start a new loader with empty callbacks. So the
model indeed get loaded, but the original callbacks never got notified
of it.

> Instead we only start preload if an existing task is not running.
> Also when preloading, we use existing callbacks, instead of using
  empty callbacks

Bug: 193851085
Bug: 195155924
Test: Verified repro steps
Change-Id: I0a96310be8489756f364aa2a12e4345e1418733d
2021-08-12 21:33:33 +00:00
Sunny Goyal
711c596c86 Binding Taskbar directly from Launcher model
This allows taskbar to be loaded even in case of 3P Launchers
and removes dependency on LauncherActivity lifecycle

Bug: 187353581
Bug: 188788621
Test: Manual
Change-Id: I5a0988e0697b41677d4c58f0213aef14ec0c0972
2021-07-15 12:43:11 -07:00
Schneider Victor-tulias
3ec8f554af Expose the LauncherModel ModelDelegate
Added a getter for LauncherModel's ModelDelegate.

bug: 184179894
Test: manual
Change-Id: I94d2ee535f7c96e0d3672f053f32f55ddd10cba0
2021-04-13 14:17:41 -07:00
Andy Wickham
bb993c484a Adds dump method to ModelDelegate.
This allows delegates to include additional data in log dumps.

Bug: 181351828
Test: Checked that data was found in a bug report and
adb shell dumpsys activity com.google.android.apps.nexuslauncher

Change-Id: I7a63430202ff899ac885a544c558e1248d2ce829
2021-02-26 13:36:07 -08:00
Schneider Victor-tulias
6a5f431a7b Revert "Revert "Add UI updates for incremental app installs.""
This reverts commit 229497d182.

Reason for revert: Patching bugs

Fixes: 176901235, 176992421, 176884453

Test: manual

Change-Id: I57e13a15e72284564a10761966732ee31d15fd08
2021-01-12 12:22:33 -08:00
Schneider Victor-tulias
229497d182 Revert "Add UI updates for incremental app installs."
This reverts commit 84269d349d.

Reason for revert: causes b/176884453 and b/176992421

Change-Id: I3398674a0acbad8329df5d341ae074ac073a6bf9
2021-01-07 19:44:44 +00:00
Schneider Victor-tulias
84269d349d 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

Bug: 171008815

Test: manual

Change-Id: I5874a5146d79a8c91d7d90ff0b9c1c427a3c95dd
2021-01-05 15:17:26 -05:00
TreeHugger Robot
3cc22175e9 Merge "Moving hotseat predictions to ModelDelegate" into ub-launcher3-master 2020-08-24 18:42:01 +00:00
TreeHugger Robot
217dbfea01 Merge "Removing static state management from the install shortcut queue" into ub-launcher3-master 2020-08-18 22:00:23 +00:00
Sunny Goyal
0fc3d1275a Moving hotseat predictions to ModelDelegate
Bug: 160748731

Change-Id: I8db7856a17e0b6ca45b4d5ec3513f788f22db11a
2020-08-17 08:43:07 -07:00
Sunny Goyal
5fb83a47f2 Removing icon recents version
Change-Id: Ibdc88715e38590cedf8a7b5174061bb2c6ef9533
2020-08-14 10:49:19 -07: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
8b74cc761b Moving all-apps predictions to Launcher model
Predictions are loaded and managed by Launcher model and follow
the model lifecycle. They are then bound to the callback which
handles the UI

Bug: 160748731
Change-Id: I4a3ea0698d80fafe94afb4ce66ffa7f4a6a91c68
2020-07-29 13:07:52 -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
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Pinyao Ting
8e5db81c3b Fix the issue "Turn on work profile?" dialog not displayed for
work profile deep shortcuts when disabled.

When work profile is locked, the state change doesn't propagated
into UserManagerService immediately. This CL remove that dependency,
rather than having Launcher calls UserManager#isUserUnlocked, the state
is passed into UserLockStateChangedTask by extracting user state from
broadcasted intent at the call-site.

Bug: 147210578
Test: manual
Change-Id: I87f3d0478df44df60e273189f77b61bc40dd2630
2020-04-09 18:00:37 +00:00
Sunny Goyal
bb18f4c9c6 Fixing log message
Change-Id: I0668ea273a54ea741b1b871a50a8738c0ec4788b
2020-02-25 15:27:06 -08:00
Hyunyoung Song
308faf8335 Move foldername and appinfo fetching to model thread
Bug: 149255695
Change-Id: I8377d4a06d4ae67b601f3e0ad9e722bd7b103a7a
2020-02-18 16:41:45 -08:00
Zak Cohen
3eeb41de9a Rename flag IS_DOGFOOD to IS_STUDIO.
The flag is only set when building from Android Studio... and is never
used for dogfood.

Test: local
Change-Id: I898d585f4558c2437f0152ef102bea59c351f80b
2020-02-14 14:19:59 -08:00
vadimt
2e1e0d6bff Removing tracing for "Launcher didn't initialize" flake
The flake had disappeared, perhaps because of this logging, or,
hopefully, for some other reason.

Bug: 148313079
Change-Id: I636783d5fc71474dd443c143289c3ff74651835e
2020-02-10 12:47:42 -08:00
Sunny Goyal
18204e4eea Various icon cache fixes
> Multiple instances of LauncherIcon created when
    LauncherIcons refers IconCache which in turn creates new LauncherIcons
> Widget icons are never cached as they were using low res icons
> Shortcut drag icons are not loaded synchronously
    when using PinItemRequest flow
> Wrong lastUpdatedTime is used in iconCache for shortcuts
> IconUpdateHandler does not ignore managedUser promise icons

Change-Id: Ie7eed68a30fad11d1861b6c70c380953a15ae1cf
2020-02-06 14:16:34 -08:00
vadimt
c8b09709ff Tracing for another "Launcher didn't initialize" failure
This simply restored logging used for one of earlier investigations

Bug: 148313079
Change-Id: Idafed13208dc5610d577986fc487d1d44bc0ef5e
2020-01-27 17:48:49 -08:00
Sunny Goyal
a7a5bf3101 Adding support for multiple Model clients
Bug: 137568159
Change-Id: Ia4db800b19cc80c695fcb9ea28e07709dfd08c6a
2020-01-10 12:23:27 -08:00
Hyunyoung Song
97253ec3ab Change the load logic of FolderNameProvider
Work profile apps are suggested as "Work" folder name

Bug: 147359653
Bug: 147359733

Change-Id: Idb2438de9c71c85cfeca6a6b0e116174ea2f3b62
2020-01-08 23:31:58 -08:00
Sunny Goyal
9ae9b60043 Updating Robolectric tests
> Adding multi-thread support
> Simulating actual loader loading flow
> Moving some android tests to robolectic

Change-Id: Ie17a448f20e8a4b1f18ecc33d22054bbf9e18729
2020-01-06 11:05:42 -08: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
14168431bd Adding support for dynamic calendar and clock icons
Change-Id: Icdba34340a27a4f6dff7310d0bf9fd29aef1330c
2019-10-29 13:50:02 -07: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
vadimt
23c8341096 Removing tracing and @Stability for a fixed bug
Bug: 142514365
Change-Id: I147850db274c465fb964eca30b97b3ebaaa2ccf6
2019-10-25 11:21:33 -07:00
vadimt
54e0c9e49c Tracing to determine why the model doesn't load
Bug: 142514365
Change-Id: I30ecaec5a5d0868db10157c61a2a8d7dd12872ca
2019-10-14 18:39:10 -07:00
vadimt
ce25a2bf68 Adding tracing for a lab-only flake
Bug: 142514365
Change-Id: I9c93ecabbcbad6d4683d595587831d8465e62ee8
2019-10-14 11:34:38 -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
088b9c2f87 Adding in missing changes to ub-launcher3-master.
Manual merge marked as DO NOT MERGE: Id60ae2c08ec7aca6780fec1f873920f3857d598e
also including the subsequent fix I8ee6836d3a06f315518aa4829c8e2ddf8cf5f74d
that I had to Skip from the automerger since the first CL never made it in.

Change-Id: I5a4a39278010099dded8fe06e960c0397c49c0aa
2019-09-17 11:51:49 -07: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
2b06908252 Merge "Add Logs to track app uninstall and icon removal" into ub-launcher3-qt-future-dev 2019-09-16 21:54:20 +00: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
Jon Miranda
f1ce0f31ab Fix failing test testPromiseIcon_addedFromEligibleSession.
am: d6ae55d968

Change-Id: I733da069b9de54d11f8e736ccd84eca610d65f91
2019-09-13 14:29:52 -07:00
Jon Miranda
b548b3c7b0 [DO NOT MERGE] resolve merge conflicts of cfdeb06205 to ub-launcher3-qt-future-dev
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Id60ae2c08ec7aca6780fec1f873920f3857d598e
2019-09-12 23:13:25 +00:00
Jon Miranda
d6ae55d968 Fix failing test testPromiseIcon_addedFromEligibleSession.
Test: Ran tests on device
Bug: 140819614
Change-Id: I8ee6836d3a06f315518aa4829c8e2ddf8cf5f74d
2019-09-12 16:58:51 +00:00
Jon Miranda
1c247cf451 Fix bug where existing icon is removed when install session is abandonded.
- Ensure we only add promise icons for apps that aren't already installed to
  our internal list of session ids.
- Ensure we only remove promise icons created from the install session when
  that session is abandonded.

Bug: 140819614
Change-Id: I3c93865b5e96a9c7a160154b45a38eb90ac9d183
2019-09-11 12:37:14 -07:00
Pinyao Ting
c7a6c2979c migrate custom widgets in comply with plugin framework
Bug: 139888225
Change-Id: I8a3d0fe2689ad5ba24b19309728bbad0b6287f71
2019-08-30 12:06:22 -07:00
Sunny Goyal
6fe3eec95c Moving various common executors to a single location
Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c
2019-08-20 14:36:17 -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