Commit Graph

202 Commits

Author SHA1 Message Date
Anton Vayvod
ee38224910 Guard Flags references with a check for running on Android V.
Otherwise, Launcher3 next build crashes on non-V devices.

Bug: NONE Trivial cleanup.
Test: manual
Flag: NONE The change deals with flags

Change-Id: I9d9335ea1cb0f299aa5af8095ff1ea2f98c23542
2024-06-03 19:04:41 +00: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
bf3efe8af0 Fixing LauncherIcons leaking outside sandbox context
Since LauncherIcons was using a global static pool, a custom
instance for a test could leak into the global pool, affecting
other tests

Bug: 335280439
Test: Verified image test on device
Flag: None
Change-Id: Iedd19c8e69c928e44b65eae7eba0167b03b5df6b
2024-05-07 12:13:37 -07:00
Federico Baron
c113ce9f9f Merge "Migrate smartspace as a widget and smartspace removal toggle flags to aconfig" into main 2024-04-29 21:46:03 +00:00
Sunny Goyal
638a687fc8 Converting IconShape to mainThreadInitializedObject instead of
keeping it a process static

Bug: 297950111
Flag: None
Test: Presubmit
Change-Id: Id66100e0cb300659c6017c287eb38ab04290477b
2024-04-25 15:56:30 -07:00
fbaron
9d08e0fe70 Migrate smartspace as a widget and smartspace removal toggle flags to aconfig
Bug: 336823684, 336823681
Test: none
Flag: ACONFIG enable_smartspace_as_a_widget DISABLED
Flag: ACONFIG enable_smartspace_removal_toggle DISABLED
Change-Id: I4cba42e09f58365f761ab866b15a494817e6bb0f
2024-04-25 14:26:30 -07: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
Song Chun Fan
e5ad96ce10 [Launcher/Archive] remove all checks for the archiving system property
No longer needed

Change-Id: I62c8843aa04a245d1dcc30f7787c71d17993f5d1
BUG: 331165939
Test: builds
2024-04-08 23:14:07 +00:00
Jakob Schneider
328c32235e Add the archiving sysprop check to launcher3.
This system property will be used to test the feature
in DVT. This is required because the new device is built on U QPR3, not V. See
https://docs.google.com/document/d/1h8sLlnnhwGP4uZssglBqTShMoQcEq5dvR7jsJmmp0Cw/edit?resourcekey=0-KTFHkPKTdtMN-5kQYBWJig&tab=t.0#heading=h.x9snb54sjlu9  for more details.

Test: tested manually
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving TEAMFOOD

Change-Id: Ie64a40ba799c81057258dd7de3872a0494cff2d8
2024-02-06 14:29:07 +00:00
Jakob Schneider
94b5f1709b Refactor API syntax based on API council feedback. This is a noop.
Bug: 322010040
Test: LauncherAppsTest
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT

Change-Id: I60c45654badd85c5e62d994ee012927a0425285a
2024-01-31 19:19:20 +00:00
Jakob Schneider
2f609d09f6 Initialize the archiving compat options during launcher3 startup.
This just sets an OP_CODE (cheap operation). It disables a help-dialog
for launchers who have not implemented archiving.

Test: PackageInstallerArchiveTest and also manually
Bug: 302114748
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT
Change-Id: Ifa9335d7ad250218eec3863dcdd986118bba007c
2024-01-30 18:48:16 +00:00
Sunny Goyal
6449a21062 Fixing some launcher model tests
> Removing static mocks and using Sandbox context instead
> Removing inheritence in LauncherModel and converting LauncherApps.Callbacks
  to a separate class. decMaker sometimes fails because of API changes in
  LauncherApps.Callbacks

Bug: 319877828
Test: atest LoaderTaskTest
Flag: N/A
Change-Id: If78b5d83595627a355b284f52d887d75fef53014
2024-01-12 12:30:52 -08:00
Sunny Goyal
31e27ed934 Moving widget inflation logic to a separate class
This allows us to reuse this logic at other places

Bug: 318539160
Test: atest TaplBinderTests
Flag: None
Change-Id: I2e19aad207efb3a99bb3b70ba71c076699dba2bc
2024-01-10 10:41:44 -08:00
Sunny Goyal
4df719a1e6 Removing ENABLE_CACHED_WIDGET since we now have always listenign widget
> Also using PendingWidgetView for deferred widget view

Bug: 270395008
Flag: LEGACY ENABLE_CACHED_WIDGET enabled
Test: Exising widgets tests pass.
      Verified UI by forcefully rendering deferred widget

Change-Id: Id34f89d778f9f993c1b7ad13f66e57fda9843417
2024-01-04 09:26:10 -08:00
Himanshu Gupta
739b3c9f22 Enabling Private Space Container in Launcher.
This CL adds the following:
1. Adds filtering and addition of Private Profile apps in main user
all apps recycler view
2. Enables decoration of Private Profile apps
3. Enables hiding Private Space container based upon a settings entry.

Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Bug: 289223923
Test: Ran Launcher3 tests
Change-Id: I33dc55a3a39e75d3fc336ca6a488b282e2dd322c
2023-11-15 15:08:59 +00:00
Andreas Agvard
d1674985d6 Adds haptic build-up during LPNH behind feature flag
Flag: Omnient flags + ENABLE_SEARCH_HAPTIC_HINT
Test: Manual
Bug: 303023676
Change-Id: Ic43d1f34a05622328add6727f36406ce75d5a115
2023-10-19 21:10:42 +02:00
Andy Wickham
9fbc52f02d Add CUSTOM_LPNH_THRESHOLDS feature flag to customize LPNH
When this flag is enabled, new Developer Options appear which
allow you to customize the slop and timeout to invoke LPNH.

The slop is defined as a multiplier to the default edge slop
(which I discovered while looking into this - it appears to
be intended for touches along the device edge and is 50%
larger than the default touch slop; currently used by Back).

Timeout is defined in milliseconds, defaulting to 400, at least
on my device.

Bug: 301680992
Bug: 300955321
Flag: CUSTOM_LPNH_THRESHOLDS - should be no-op with default off
Test: Manual with flag on and adjusting sliders, and flag off
Change-Id: Iabc7b3706f4fdd6f0392c858b81a856e375ffd51
2023-10-06 15:06:13 -07:00
fbaron
c0e687bad8 Add smartspace removal option as a toggle
Bug: 303471576
Test: try removing smartspace by going to home settings and turning it off
Flag: ENABLE_SMARTSPACE_REMOVAL
Change-Id: Idd95da1b302927885a8c469e38db6d3c5130f8c1
2023-10-05 17:26:03 +00:00
Sunny Goyal
b02dafc1d4 Removing explicit target SDK for launcher
> It will automatically target the latest SDK it was compiled with

Bug: 284349887
Test: Presubmit and manual
Flag: N/A
Change-Id: I32629b0dd710c3c04d8f70f988b7279e7cae6731
2023-06-26 10:15:14 -07:00
Sunny Goyal
c80e60dc7a Making UserCache the source of truth for all user events
Bug: 243688989
Test: Presubmit
Flag: N/A
Change-Id: I0e6b853d965eff1abaeb3b26dd6b94424e5212df
2023-06-07 20:43:36 -07:00
Andy Wickham
af5bb30141 Add developer option to tweak All Apps from Overview threshold.
Ability to move threshold from shift 1.05 to 5.0. Saved as an int
from 105 to 500. Shift 1.0 is where Overview rests; using this
value exactly causes a slight glitch while settling.

Demo (slightly outdated min value and flavor text):
https://drive.google.com/file/d/1PaS4MjFM1P9ZHQ-400tXUbDz_-z8qYtC/view?usp=drive_link&resourcekey=0-ZX-ofW4AzN0-Qjqo4OmU-g

Bug: 281717218
Test: Manual
Flag: ENABLE_ALL_APPS_FROM_OVERVIEW
Change-Id: I5acfb46f9df16e9d3091a7822c449301bc6067f9
2023-05-19 21:26:35 +00:00
Sunny Goyal
e274d97fe5 Removing support for lagacy shortcuts
> Addition/removal of  shortcus is already removed. This just
  cleans up the unused code path

Bug: 275875209
Test: Updated tests
Flag: N/A
Change-Id: I8ab7f57b693f996920e50e8beecafcffab5167e9
2023-05-17 09:20:45 -07:00
Pavel Grafov
a3d37c8faa Use PROFILE_INACCESSIBLE to track locked profile
Pre-U ACTION_MANAGED_PROFILE_UNAVAILABLE broadcast meant the user was
shutting down, and could be used to track when the user can be treated
as locked. In Android U work profile in quiet mode remains running, so
to track when the user gets locked this CL swithces to
ACTION_PROFILE_INACCESSIBLE instead, which is sent when the user is shut
down.

+ formatting fix to satisfy lint

Bug: 277715473
Test: manual, with TestDPC and work contact shortcut
Change-Id: I258df006e2d87f69bbbac82d20ad72ddce625425
2023-05-11 17:10:27 +01:00
Pinyao Ting
bd638e7b41 Retains cached widget in launcher process
Currently cached widget are retained in LauncherWidgetHolder which is
released when Launcher activity is recreated. This CL moves the cached
widget into LauncherAppState to keep the cache alive.

Bug: 268189435
Test: steps below
1. Add multiple widgets (Calendar / Weather ... e.t.c) to Home Screen
2. Open Google Map, start navigation to any place
3. Google Map enters navigation mode and changes resolution
4. Swipe up to exit Google Map and go to Home Screen
5. Verify you don't see deferred widget host view.

Change-Id: I8b56167313780cd1be2a5da88517114acc6d44af
2023-03-21 11:04:31 -07:00
Stefan Andonian
5bd9a225a8 Preload expensive objects before user is unlocked.
This change includes migrating data required for starting the launcher
from encrypted storage into device protected storage. All of the data
being moved has already been approved by the correct authorities.

Bug: 251502424
Test: Performed latency testing using logs from user unlock until first
workspace screen loaded.

Change-Id: I58b0cd1c7bad260c2252f9e172ef85ab885c7fe9
2023-03-01 23:09:07 +00:00
Sunny Goyal
a992ac9e8d Moving all intent receiver register calls to a single place
This is eventually allow us to move all register to background thread
Also creating a single ScreenOn tracked which is used at multiple places

Bug: 264465756
Test: Verified on device
Change-Id: Ibadf9ca43218e578954420d97a733adfa0a94fc7
Merged-In: Ib410e5bf02773cefde5bf0a0a1f2f1c108718d24
2023-01-22 05:24:48 +00:00
Stefan Andonian
d1b33b311c Expanded LauncherPrefs APIs to Replace Direct Shared Preference Usage.
LauncherPrefs will contain Launcher's shared preference functionality.
It controls optimizations and classifications such as restorable vs
non-restorable data, bootaware vs non-bootaware data, and configurations
such as default values  so the calling code doesn't need to and our code
base can have a single source of truth for items that are used in
multiple places.

The old APIs remain in place, but are deprecated and will be removed
after all Shared Preference usage has been gated by LauncherPrefs in
future CLs.

Bug: 261635315
Test: Manually tested themed icon, Workspace configuration, and app
install functionality.

Change-Id: I29fd516468bc93fda393062e95be26b6d55c816e
2023-01-14 00:54:15 +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
Sunny Goyal
c5c7da9a8b Removing some obsolete features
PROMISE_APPS_NEW_INSTALLS = true
ENABLE_QUICKSTEP_WIDGET_APP_START = true
FOLDER_NAME_SUGGEST = true
ENABLE_PREDICTION_DISMISS = true
HOTSEAT_MIGRATE_TO_FOLDER = false
ENABLE_DEEP_SHORTCUT_ICON_CACHE = true
ENABLE_THEMED_ICONS = true
ENABLE_ALL_APPS_EDU = true
EXPANDED_SMARTSPACE = false

Bug: 241141733
Test: Presubmit
Change-Id: I72c0c20ab7e214994dc3c3665c90e85d45991a7a
2022-08-02 13:38:38 -07:00
kholoud mohamed
d5a4d60483 update enterprise strings on ACTION_DEVICE_POLICY_RESOURCE_UPDATED
Also updated work folder name provider to retrieve it from dpm

Bug: 218322904
Test: manual
Change-Id: Id80a9e90806f3a07f132b5cc1e9871bb35df42b0
2022-05-09 10:01:10 +01:00
TreeHugger Robot
2f94c70ad6 Merge "Adding icon theming API support in Launcher" 2022-01-12 08:26:03 +00:00
Sunny Goyal
68af549a45 Adding icon theming API support in Launcher
Bug: 200082620
Test: manual
Change-Id: If986b9cfc3db79d627d2a6f1304e1b6f58491470
2022-01-08 00:05:47 +05:30
Michael Groover
871467b651 Add required flag to registerReceiver call in LauncherAppState
Android T adds support to allow a runtime receiver to be registered as
not exported, but to ensure apps can take advantage of this, calls to
registerReceiver must specify a flag indicating whether the receiver
should be exported for apps targeting T+ that are registering for
unprotected broadcasts. This commit adds the RECEIVER_EXPORTED
flag to the call to registerReceiver in LauncherAppState when
registering for ACTION_FORCE_RELOAD.

Bug: 161145287
Test: Build
Change-Id: I9ffb5e00f2ce5bc9dcff4b681237ba06604fc995
2022-01-06 12:12:21 -08: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
TreeHugger Robot
667bda8448 Merge "Revert "Revert "Migrating all model tests to Instrumentation tests""" into sc-v2-dev 2021-08-31 10:52:02 +00:00
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
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
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
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
a093523299 Load widget preview images before adding the rows to the adapter
This allows for smooth animations as the items will have their full
height resolved

Bug: 190892517
Test: verified locally
Test: CachingWidgetPreviewLoaderTest
Change-Id: I86afc6951a4cc82ae45e63795791d259a3bb3cda
2021-06-18 19:18:29 +00:00
Hyunyoung Song
2e747e2194 Remove APP_SEARCH_IMPROVEMENTS
Bug: 190104801
Test: manual, builds

Change-Id: Icd7f0f17bf79eda9fa8e10a6699be3852a34de67
2021-06-03 20:22:29 -07:00
Sunny Goyal
df4241ca4e Fixing Launcher preview leaking surface and memory
> Closing existing preview if a new request comes for same host token
> Closing in-memory icon db when closing preview
> Removing unnecessary wait blocks on UI thread and rendering
  view asynchronously
> Fixing preview loading failing on LauncherAppState access

Bug: 186712316
Bug: 187140897
Test: Manual
Change-Id: I045930b007e5dc015320224a197eee20a8354d17
2021-05-20 21:37:28 +00:00
Sunny Goyal
01c32a69be Adding a shared-pref to control icon theming
Bug: 183641907
Test: Manual
Change-Id: I640a8473c9ca4acfded9ebbfa823e437c3a42b45
2021-05-18 14:25: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
Jon Miranda
5eff0bbe13 Remove temp logic added to migrate users to new 4x5 grid.
Related changes:
- I81a91b8415effbe0bf7ba722f11ab44a4169e3df
- Ia7ae129048bf5878b216f31f949e10c71e608818

Bug: 183965808
Bug: 175329686
Test: manual
Change-Id: If9ae69d746f1c86db98275f0c00ae054e146b67e
2021-04-09 14:58:46 +00:00
Sunny Goyal
58530bd64b Fixing notification dots settings not updated properly
Also avoiding settings cache reset whenever someone registers
a new listener

Bug: 184200027
Test: Manual
Change-Id: I0c8b7084b6b4656102e9041b779b80a98624ddd8
2021-03-31 15:57:49 -07:00
Jon Miranda
ec1277eec1 Migrate existing 4x5 and 4x4 grid users to a new 4x5 grid.
Due to the dogfood 4x5 grid using the wrong db, there may
be some rearranging of items.

The goal is to completely remove the old 4x4 and 4x5 grid,
but first we need to silently migrate users to the new grid.

We still  need to keep the old grids in the device profile
so we hide them from the Styles & Wallpaper app.

We also need to reset and remove the ENABLE_FOUR_COLUMN feature
flag from the UI.

- Added TODO to remove this logic in the tracking doc

Bug: 183965808
Bug: 175329686
Test: have old 4x4 or 4x5 grid set up
      install apk with these changes
      confirm that we are now using the new grid and the
      other grid options are inaccessible to the user
Change-Id: I81a91b8415effbe0bf7ba722f11ab44a4169e3df
2021-03-30 13:17:37 +00:00
Vinit Nayak
a34af18b0e Update System settings content observer to cache values.
Existing ContentObserver will cache values and overwrite
them when the value itself is modified or caller force
updates.

Bug: 149571513
Test: Wrote unit tests, mostly for caching logic.
Not meant to test ContentObserver contract for registering an
observer.

Change-Id: I12835f6c2be27ce17f65a55c51c4ef85c63b4487
2021-02-16 20:58:53 -08:00
Winson Chung
f99351888c Revert "Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ...""
This reverts commit 087a9e39b6.

Change-Id: I05b17a6e4aaaef6de3c2fa26aad45a39eb2833f9
2020-10-23 09:27:48 -07:00