Commit Graph

50 Commits

Author SHA1 Message Date
MrSluffy
99b65be3c2 Fixed crashes on android 8 2024-12-27 15:46:16 +08:00
MrSluffy
eeb7416bfe Merge branch 'android15-release' into merge-aosp15 2024-09-14 17:29:57 +08:00
Winson Chung
94e8ad0731 Add multi-instance state to item infos
- Add legacy resource for supported multi-instance apps that
  matches the current SystemUI resource of the same name, and will
  be removed as apps migrate to the V manifest property to declare
  multi-instance support
- Load the multi-instance state from PackageManager when the db is
  first loaded or when packages are updated
- The multi-instance check is then used to determine if an app pair
  can be saved (ie. whether the action can be shown)

Bug: 323112914
Test: atest NexusLauncherTests

Change-Id: I565b4bee4ab5f7040910306b1fd60a4fc3bf9a1c
2024-05-09 18:43:38 +00:00
Sunny Goyal
10fa016352 Fixing MainThreadInitializedObject
> Making SafeCloseable implementation mandatory, to prevent leaks during test and preview
> Removing getNoCreate method and defining executeIfCreated to avoid null pointer exceptions
> Fixing sandbox value leaking into main, by Checking sandbox against App context
> Converting sanbox to an interface instead a class

Bug: 335280439
Test: Presubmit
Flag: None
Change-Id: I951dcde871898e745ff6490a1c4f8fd1512888f5
2024-04-22 17:04:33 -07:00
Winson Chung
6a6de2dfc3 Migrate WorkspaceItemInfo non-resizeable flag to runtime status flag
- This aligns with other app-level state that is read at runtime

Bug: 323112914
Test: atest NexusLauncherTests
Change-Id: I1e29583d1c0302646718473c8958d604c1a202a5
2024-04-14 06:20:54 +00:00
Sunny Goyal
9d28eee769 Allowing base class for ResourceBasedOverride to have Context based constructors
Bug: 330920490
Flag: None
Test: Presubmit
Change-Id: Ib4d1ef80133596a114a4fb32ea8ae918852a77f5
2024-04-05 12:56:36 -07:00
Jeremy Sim
742630c2f8 Reparent folders and app pairs
Previously, app pairs and folders shared a common data model, FolderInfo. Now we need to separate them, so a new type, CollectionInfo, will serve as the parent of both types.

Bug: 315731527
Fixes: 326664798
Flag: ACONFIG com.android.wm.shell.enable_app_pairs TRUNKFOOD
Test: Manual, unit tests to follow
Change-Id: Ia8c429cf6e6a376f2554ae1866549ef0bcab2a22
2024-03-29 15:39:28 -07:00
John Andrew Camu
c31b41ae73 QuickSwitch Compat Q to U (#3948)
Initial support quickstep, Android versions from Q to U, ensuring a smooth and efficient user experience. Enjoy effortless navigation and swift app switching on your Android device with QuickSwitch's compatibility across the Q, R, S, T, and U.


Co-authored-by: Goooler <wangzongler@gmail.com>
Co-authored-by: 无言 <57122860+liu-wanshun@users.noreply.github.com>
2024-01-26 05:59:47 +08:00
Himanshu Gupta
f591ce5f17 Restricting Accessibility flows for Private Profile.
Adding PS apps to the home screen is restricted.
This CL prevents the same from accessibility drags.

Bug: 289223923
Flag: ACONFIG com.android.launcher3.Flags.private_space_restrict_accessibility_drag DEVELOPEMENT
Test: Ran Launcher3 Tests.
Change-Id: I3e2b7b196b96a4d2ba34d8ece5fd6e0463f17253
2024-01-25 04:19:20 +00:00
Goooler
20c884d972 Merge tag 'android-14.0.0_r21' into 14-dev-merge-launcher3
https://android.googlesource.com/platform/packages/apps/Launcher3/+/refs/tags/android-14.0.0_r21

Android 14.0.0 release 21
2024-01-08 14:45:36 +08:00
MrSluffy
cc8f9828ab Merge branch 'heads/android-14.0.0_r18' into 14-dev 2023-12-16 17:18:13 +08:00
MrSluffy
32700b0100 Merge branch 'android14-release' into 14-dev 2023-12-13 18:47:55 +08:00
MrSluffy
19bf26dd5a Merge branch 'aosp-13' into 13-wip 2023-10-21 09:52:01 +08:00
Stefan Andonian
2171d09fe6 Remove some direct usage of getDevicePrefs()
Bug: 261635315
Test: Manually did testing on device.
Change-Id: I47c88bdc031d330f6efa573411ab5dbf154ec8a2
2023-10-11 23:06:41 +00:00
Fengjiang Li
ff15fbffec Recreate hotseat predictor whenever we query it due to workspace change
Fix: b/289013842
Test: unit test, also verified moving icons will recreate hotseat predictor
Change-Id: I1f19b17654b87156132a4e4dee26e12312589dba
2023-07-12 10:11:12 -07:00
Stefan Andonian
e4609a27bd Load Delegate Items in correct order when loading Launcher Data.
Bug: 251502424
Test: Loaded and bound the workspace properly.
Change-Id: Ia6d609ffa21c5036cb48e464d3e8d4fa561cb008
2023-04-10 15:46:12 +00:00
Stefan Andonian
05ca3a8089 Refactor Workspace Loading / Processing code.
There are no behavioral changes (other than we no longer are recycling
objects while processing workspace items), but this refactor will setup
the next change to load the first workspace page before other workspace
pages.

Bug: 251502424
Test: Workspace, app widgets, and containers loaded properly.
Change-Id: I437aab40000d841d7fcc4380d05ab4a8f5d5c2ad
2023-02-15 17:36:27 +00:00
Alex Chau
e5c1edb31b Clear PredictorState targets when it's re-registered
- After SUW, registerPredictor is called for hotseat, and then BaseLauncherBinder will call bindExtraContainerItems with empty items. A subsequent registerPredictor will then be triggered by LoadTask, but handleUpdate will skip the update due to no diff in PredictorState targets. As a result, HotseatPredictionController always have no items after SUW
- Clearing PredictorState when it's re-registerted will allow the respective prediction controller to receive new prediction items that comes with the registration.

Fix: 265340241
Test: Factory reset, pass SUW, prediction items are in hotseat
Test: Reboot, prediction items are in hotseat
Change-Id: Ie6e219028e7fde42854459d34806a04052dc41ba
2023-01-31 19:24:31 +00:00
TreeHugger Robot
3a801de233 Merge "Fix ConcurrentModificationExceptions during binding." into tm-qpr-dev 2022-11-18 01:44:01 +00:00
Stefan Andonian
a04de842d1 Fix ConcurrentModificationExceptions during binding.
The same lists of extra items stored in BgModelData are also stored in
UI components. This is causing ConcurrentModificationExceptions. The
solution is to clone these lists or mark them as immutable before storing
them in their respective components.

Bug: 206918543
Test: Verified that crash no longer occurs after fix.
Change-Id: I571a2c451af58137aa7513b372b6a8ecf9bd3ff6
2022-11-17 20:46:51 +00:00
Stefan Andonian
146701ca3e Move SharedPreferences code to its own class.
Bug: 251502424
Test: Code compiled correctly.
Change-Id: Iea0d6ab2999504117546ee0f7adc0c7b8b45c065
2022-11-17 17:22:47 +00:00
Holly Sun
03caf49826 Update container for ItemInfo.
See https://docs.google.com/document/d/1eAxQ9p263FI8-ZdkOsiQoarhpwm9aOdncqfJUD42o1Q/edit?resourcekey=0-GJyyDut-Tfy29akzHyoz0Q for the debugging process.
Test: see video https://drive.google.com/file/d/1qpD7070v0qOaBEuYS0WoZauawyhL54MQ/view
Fix: 234848972

Change-Id: I2ed5d24d11ab2081c6faa5d040d72a9d1646e5ca
2022-09-01 12:10:31 -07:00
Sunny Goyal
f0ff70a2a5 Adding support for easily extending Launcher DragAndDrop support
Bug: 232165524
Test: Verified locally
Change-Id: I3b4f37bc9914de55330662edd678e6fdd0eafece
2022-05-11 21:34:08 +00:00
Suphon Thanakornpakapong
952551cb4c Fix more build errors 2022-05-08 22:53:06 +07:00
Suphon Thanakornpakapong
11e1a2fdc8 Merge remote-tracking branch 'aosp/android12L-release' into 12.1-dev 2022-05-08 20:29:17 +07:00
kholoud mohamed
e210b47c20 RESTRICT AUTOMERGE Moved enteprise resource updatability to Launcher3
Bug: 217388602
Bug: 218875965
Test: atest EnterpriseResourcesTests
Test: manual
Change-Id: I095a1da30766e4b4eab33f42b034601b3322eb3d
2022-03-15 17:24:04 +00:00
kholoud mohamed
c76b2035aa Allow overriding enterprise related strings in Launcher
Test: manual
Bug: 188414133
Bug: 211422509
Bug: 188410712
Change-Id: I75858cdcf2057e7c270da5893cd9a90c6753f182
2022-01-28 16:33:03 +00:00
Brian Isganitis
f7c2adf861 Avoid race condition with hotseat predictions.
Make sure that the ArrayList cannot be cleared on the model thread while
it is being used on the UI thread to render a launcher preview.

Test: Manual
Fix: 210123588
Change-Id: I5a47cb3f28f5ac9e400f6ae535e410c345e14ee1
2021-12-22 01:08:46 +00:00
Thiru Ramasamy
7d04782532 Log launcher settings whenever launcher layout is logged using pull atom.
* Whenever launcher setting is changed, only log the changed setting instead of all

Bug: 181703659
Test: wwdebug && wwlogcat AND statsd_testdrive 10108

Change-Id: I9c6b7a17d653038a91f885df455e5ebbb401b49a
Merged-In: I9c6b7a17d653038a91f885df455e5ebbb401b49a
(cherry picked from commit f7ebfb9a7f)
2021-12-21 19:58:15 +00:00
Thiru Ramasamy
f7ebfb9a7f Log launcher settings whenever launcher layout is logged using pull atom.
* Whenever launcher setting is changed, only log the changed setting instead of all

Bug: 181703659
Test: wwdebug && wwlogcat AND statsd_testdrive 10108

Change-Id: I9c6b7a17d653038a91f885df455e5ebbb401b49a
2021-12-09 06:13:44 +00:00
Schneider Victor-tulias
c817dac4cd Merge ag/16307859 into master without bug fix.
- Copied ag/16307859, with a modification to QuickstepModelDelegate#getContainer. This allows the crash from b/173838775 to continue occuring with additional debuging logs.

Bug: 173838775
Test: manual
Change-Id: Ic96a25665457c80f5c9ab45a896fada34a3a68ff
2021-11-30 12:08:23 -08:00
Schneider Victor-tulias
8664cb1261 Revert "Fix ClassCastException in QuickstepModelDelegate"
This reverts commit 380f8fd890.

Reason for revert: remove bug fix on master

Bug: 173838775
Change-Id: I3cbb3e383c52095a10b3e22ea4c586c0c3c8d7a9
2021-11-29 22:34:04 +00:00
Schneider Victor-tulias
380f8fd890 Fix ClassCastException in QuickstepModelDelegate
- Added a casting check as an immediate fix to b/173838775
- Added logging to help debug the corrupt state where an item of type other than FolderInfo is used as an other item's container.
- Added LoaderMemoryLogger for adding large logs that are only conditionally printed.

Bug: 173838775
Test: manually checked logs
Change-Id: I9491cb421b9fb807d5fb110b04ad069481de768f
2021-11-24 14:26:45 -08:00
Hyunyoung Song
1e5b621a50 Address AppEventProducer to correctly send search-result location on AppTargetEvent
Bug: 191362091
Test: logcat printout

11-10 20:27:02.290 32215 32237 D QuickstepModelDelegate: notifyAppTargetEvent action=1launchLocation=search-results

Change-Id: I16ef7679116e397a8a108cc291f5741febf2e453
2021-11-11 21:27:01 -08:00
Alina Zaidi
987221a1cc Send widget added and removed events to AiAi.
-Pass the widgets on workspace as an extra List<AppTargetEvents> while
 creating prediction session.
-Notify the session about widget added/removed events after creation.

Bug: 186648032
Test: Manually checked events are received
Change-Id: I4de6c011a1e24c129a3e995ddba16bfc55074939
2021-10-26 12:29:48 +01:00
Suphon Thanakornpakapong
9c5689f3d2 Fix release build 2021-10-23 00:02:21 +07:00
Suphon Thanakornpakapong
cddb7fe98a Fix crashes below R 2021-10-13 09:56:37 +07:00
Suphon Thanakornpakapong
1d7c0a4bf6 Fix crash below 12 2021-10-09 16:34:29 +07:00
Thiru Ramasamy
d495e8c8b4 Implement LauncherLayoutSnapshot pulled atom callback.
This change will pull only the workspace items but not the launcher settings such as grid layout etc. Future CLs will address it.

Bug: 181703659
Test: Manual-`statsd_testdrive 10108` http://gpaste/4894958784872448
Change-Id: I0e7d7da62034c411edb26ff9205a81b0e2e891a0
2021-09-10 13:29:27 -07:00
Sunny Goyal
6e6f79933e Do not reload launcher when changing active display
> Updating IDP to use fixed bitmap sizes, so that the cache
  stays valid
> Caching last known windowMetrices for non-active displays and
  using estimation only when the cache is not available
> Only reloading model if IDP change could have affected the model
> Remove unnecessary listeners from IDP which are already controlled by
  model lifecycle

Bug: 191657065
Test: Manual
Change-Id: Ia8e6dfafd0977e62aa3fcf367ad79f7a49b2df51
2021-08-26 15:55:21 -07:00
Sunny Goyal
b47172bc4e Linking various settings that control icon cache to icon state
Also separating icon provider for recents from Launcher as it used a fixed size

Bug: 183641907
Test: Verified on device
Change-Id: I6ea3caa0066d1483bfb8a81f0e8aaa472c813afe
2021-05-05 23:05:38 -07:00
Sunny Goyal
19ff728b92 Adding support for determining split layout for launcher.
> Simulating the windo wmanager API to get available device
  profiles until final API
> When a device has multiple internal displays, and with both
  tablet and phone possibilities, it uses a split workspace layout

Bug: 186160341
Bug: 175782275
Test: Manual
Change-Id: Ieff2329acac7cdd6b9abe6f96cd459cd45bd0efe
2021-05-03 14:48:28 -07:00
Tony Wickham
b87f3cdc1c Add support for having more hotseat icons in the DB than we show
Split InvariantDeviceProfile#numHotseatIcons into two variables:
numDatabaseHotseatIcons and numShownHotseatIcons. These are generally
the same, but different DisplayOptions within the same GridOption
can choose to show different numbers of hotseat icons while sharing
the same database.

numDatabaseHotseatIcons is used for all reading/writing/migrating
purposes, while numShownHotseatIcons determines how many Hotseat
icons to show in the UI.

Test: Existing tests pass, added two new migration tests
Bug: 184789479
Bug: 171917176

Change-Id: I54583504f61a47a4444b6a637ebb7e3ab31528b7
2021-04-12 16:08:15 -07:00
Steven Ng
05df2843ee Increase the number of prediction for widgets model
Test: launch all widgets tray and observes widgets predicted.

Bug: 179797520
Change-Id: Id231cde5015a2a79b7532a39343b3340c27e09c9
2021-03-22 20:22:42 +00:00
Steven Ng
3a8353256a Widgets recommendation backend
Add a widgets recommendation mechanism based on AiAI app predication
ranking with the following changes:

1. Only one widget is picked from one app.
2. Widgets that are already added to the workspace are excluded from
   the recommendation.

Test: run PredicationUpdateTaskTest

Bug: 179797520
Change-Id: Ia697bc6df0bae75969e68b7b3de32d57901f7461
2021-03-08 23:37:51 +00:00
thiruram
97710ffbb2 [AA+] Log additional UI events with Launcher snapshot logging.
Bug: 180418845
Test: Manual
Change-Id: I74ab1faafe6c21a8fbf6992a8aebe918cc31d85e
2021-02-23 02:59:43 +00:00
Andy Wickham
19ab177d1b Adds CONTAINER_QSB to be used for QSB data.
Also updates some related generics definitions for
better/simpler compile-time checks.

Bug: 178536734
Test: Manual
Change-Id: If439b64ad968f62674f856fd3ff465bf21cc9204
2021-02-11 22:16:24 -08:00
Sunny Goyal
b694a69f53 Integrating snapshot logging in Launcher
> Workspace snapshot is logged when the workspace loads (at most once a day)
> Removing unnecessary thread jumping when logging folders
> Preference snapshot is logged on process start and whenever something changes

Change-Id: I93767de89b11522d843c0e8300d1f108c78f6d90
2020-10-27 11:25:43 -07: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