Commit Graph

180 Commits

Author SHA1 Message Date
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
Alistair Delva
087a9e39b6 Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ..."
Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert submission 12738409-merge_ub-launcher3-master_6877130

Reason for revert: Introduced crashes to global presubmit

Reverted Changes:
I624658ce6:Merge commit '8d14dbe041199d611839140f1c9285fd4174...
Iccd2f1e3a:Merging from ub-launcher3-master @ build 6877130
I791d64951:Merging from ub-launcher3-master @ build 6877130
Icdd32ab01:Merging from ub-launcher3-master @ build 6877130

Bug: 169963211
Change-Id: I77a4ae59e823147beae8dd7cb9b54ccdace2c7f4
2020-10-05 14:46:26 +00:00
Sunny Goyal
573b9ca9ad Moving package installer initialization to worker thread
Bug: 169002215
Change-Id: Ie7b9a1eb27b634455e3d43da411037642efd0534
2020-09-22 12:14:03 -07:00
Sunny Goyal
4484015f48 Simplifying AppFilter
Change-Id: I36217a42aa67f2b3bc3a3226ace2ef7e194956a6
2020-09-08 16:31:17 -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
eaf7a95546 Changing minimum supported Launcher version to 26
Change-Id: I49fcf874430ac53c3246371e179fbd828e14e4da
2020-07-29 17:30:19 -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
Samuel Fufa
d12d6ab98a Switch to new protocol for hybrid hotseat
- create predictor from items in bgModel instead of scanning views
- Launcher no longer checks for duplicates before sending pin/unpin events
- sending cached items from last prediction to reduce UI shuffle
- Switch to using UserCache to persist and read ComponentKey

Bug: 148814143
Bug: 156413231
Bug: 156200931
Change-Id: Ide6330bed8eb7f0c6fbec1d1ac21e7f67a9b2be2
2020-05-14 17:27:34 -07:00
Samuel Fufa
385e93249e Improve Hybird hotseat cache support
Loads list of cached apps and shows predicted app icons with the rest of workspace items.

-> Extracted prediction caching logic into a model layer

Bug: 155029837
Test: Manual

Change-Id: I6981594a910f5fe4e8e8cf8fe39db0cb856e7acd
2020-05-06 14:14:08 -07:00
Tracy Zhou
be13d109b7 Render user's actual workspace in ThemePicker preview (Part 3)
go/grid-migration-preview

With this change, we can see actual grid migration in wallpaper preview.

The approach here: we use a tmp table (favorites_preview) here specifically for this preview (to write off the migration results), and load from this tmp table workspace items if migration is necessary and successful. Otherwise, we load from the current workspace.

UPDATED: this change should be completely compatible with the new multi-db grid migration algorithm. Here is why
1. In LauncherPreviewRender#renderScreenShot, I added a check to decide which grid migration preview method we should call. Once v2 preview method is implemented, it should be integrated with other parts of this change perfectly (the reason will be mentioned below).
2. While we have multiple DBs, mOpenHelper in LauncherProvider always points to the current db we are using. Queries using CONTENT_URI is routed to whatever DB mOpenHelper points to, so it works perfectly to directly operate on CONTENT_URI even when we use multi-db underneath the hood.
3. With 1 and 2 mentioned, I believe in order for this preview change to support multi-db, we only need to implement the V2 grid migration algorithm. Because most of what we are doing in this change is wrapped in GridSizeMigrationTask, it's perfectly safeguarded.

Bug: 144052839
Change-Id: Ie6d6048d77326f96546c8a180a7cd8f15b47e4c4
2020-02-21 15:49:00 -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
Sunny Goyal
a7a5bf3101 Adding support for multiple Model clients
Bug: 137568159
Change-Id: Ia4db800b19cc80c695fcb9ea28e07709dfd08c6a
2020-01-10 12:23:27 -08:00
Sunny Goyal
73b5a27b14 Updating some non-final static objects
Updating various static objects to use a standard pattern so that
it is easier to track and cleanup those objects

Bug: 141376165
Change-Id: Ia539cbfa338d544dddad771c5027b6748762768b
2019-12-11 13:22:58 -08: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
TreeHugger Robot
f31dab5e02 Merge "Removing static instance of LauncherAppsCompat and unnecessary wrapper classes" into ub-launcher3-master 2019-10-08 18:49:36 +00: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
01615a69d2 Removing host deletion on startup and corresponding callbacks
> Launcher deletes the phantom widget ids in loader

Bug:141376165
Change-Id: Icf0542535f194f9abc67e7190f34cb60f69e9f66
2019-10-02 12:08:26 -07:00
Sunny Goyal
045b4fab76 Removing static listeners from PackageInstallerCompat
Bug: 141376165
Change-Id: I2b49d53a05a04c622ed5a7b723109a6cc230d230
2019-09-30 23:17:15 -07:00
Sunny Goyal
cf845f0dbf Fixing some robolectric tests
Bug: 131115553
Bug: 141576665
Bug: 141577881
Change-Id: Idb7e9346f57fea1d0231391477fdd11ad6b96a5c
2019-09-26 18:06:28 +00:00
Hyunyoung Song
338e4ea7df resolve merge conflicts of 057059665e to ub-launcher3-master
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I8a92d1389acbefc5bf33ef9760373bfbf54d682b
2019-09-16 15:29:37 -07:00
Hyunyoung Song
e17a699618 When DeviceConfig/FeatureFlag value is different than the previous
value, refresh icon cache

Bug: 135638690
Bug: 138964490

Test: manually toggled feature flag UI on/off
$ adb shell device_config put launcher APP_SEARCH_IMPROVEMENTS [true|false]
when launcher is in foreground and also when it is in the background

Afterwards, saw if "bank" would show BofA app or not

Change-Id: I98b62bd07b14a225168217d7eb9bfdfc7f74435d
2019-09-11 10:38: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