Commit Graph

458 Commits

Author SHA1 Message Date
Sunny Goyal
3e195d7429 Disable fake landscape UI
Bug: 131360075
Change-Id: I21e0a6cdf332e2d16821c589f9630c254b595770
2019-06-19 14:25:00 -07:00
Sunny Goyal
51f220dac2 Fixing ANR when loader task could run while helding the lock object
During AppWidgetRestoredReceiver, we call forceReload from worker thread
which in turn starts the loader while holding mLock. This causes other
loader calls on UI thread to cause ANR

Bug: 133651528
Change-Id: Iabf983c4319bd6e6ef88e74fe6076289294454f9
2019-05-29 11:07:10 -07:00
vadimt
8649cf29e4 Remove tracing for fixed bugs
Bug: 129434166
Bug: 131170582
Change-Id: Ia9b356594001d96c69ffbb7f8b767b2f54ed5feb
2019-05-01 16:10:56 -07:00
vadimt
d518364d53 Add tracing for non-loading model
Bug: 131170582
Change-Id: Iffc3f5f38ce896c4cfd2df55bedcf43e2018a58f
2019-04-23 12:10:44 -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
Sunny Goyal
371ea051d1 Fixing launcher UI not reapplied properly when IDP changed as a result of display changes
> Removing unnecessary check when binding model data as its safe to bind old data,
  we should just not persist it (that check is already there in model writer)
> Adding additional check in model bind to skip old bind if there are multiple binds

Bug: 126259547
Bug: 118441555
Change-Id: Ic250d2af13797d3e70c6e1fc70da65ebe6ab8d70
2019-03-06 15:41:29 -08:00
Sunny Goyal
2db5342f04 Fixing some Launcher crashes because of using old model data even
after launcher has reloaded

Bug: 126289691
Bug: 124288578
Change-Id: Id7fb29716241a13f4e03ee0fc0e879523de4f878
2019-03-05 12:43:50 -08:00
TreeHugger Robot
3663b314fa Merge "Removing diagnostics" into ub-launcher3-master 2019-01-30 18:43:08 +00:00
Sunny Goyal
8c48d8bea6 Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
2019-01-29 11:29:52 -08:00
vadimt
3f8591f003 Removing diagnostics
Now that b/117332845 is fixed

Bug: 117332845
Change-Id: If8c137b9c7cc386dfc5b5af4b81a3efbfa33f770
Tests: None
2019-01-25 10:35:53 -08:00
Tony
f80e893163 When undoing a removal, always return to the page it came from
We were already returning to the current page, but this wasn't
always right, e.g. when removing the last item on the last page.
So now we mark the page the item was removed from, and bind that
page first when undo is clicked.

This also addresses an issue where we incorrectly returned to the
first page if currentPage = INVALID_RESTORE_PAGE, which happens if
there are no items on the first page.

Bug: 118846684
Change-Id: I4ec1f64b24ba1cc308ce08bfb3111b5981fae99b
2018-12-21 12:21:53 -08:00
Sunny Goyal
c5939393a9 Bye bye workspace screens table
Removing a separate table for workspace screens. List of screens are
automatically parsed using the items in the favorites DB. Order of the
screen based on the screen id and rearranging screens is no longer
supported. In case the screens need to be rearranged, all the items
in the favorites db will need to be updated with new screen ids.

This makes backing up the DB (in the same database) easier as only
one table needs to be duplicates.

Change-Id: I8ba947a898f637d780e2f49925e78604263126e8
2018-12-10 11:43:35 -08:00
Sunny Goyal
06a07e9748 Moving come tests to Roboelectric
> Fixing resource loading in robo tests

Change-Id: Id5b8a0e4916a2a200da7a41b03f19846834beb1f
2018-11-12 10:49:59 -08:00
Zak Cohen
658c67a609 Deepshortcuts - only keep the per package shortcut count in memory.
Change to only keep the per Activity shortcut count in memory, not
the list of ids.
The full shortcuts are loaded at long press time so saves memory.

Bug:117239104
Test:Manual and ran instrumentation tests
Change-Id: Iee974ecba2c977216be4f078396ceed22b931f5d
2018-10-22 11:38:09 -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
Vadim Tryshev
14c6c8cee4 Improving tests to fix testBindNormalWidget_withoutConfig, and beyond
1. Make waitXXX methods fail if the condition diesn’t turn true.
2. Waiting for loading to complete in tearDown instead of reloading the
 model
3. Avoiding waiting for load-complete where loading didn’t start
4. Disabling last test in AddConfigWidgetTest
5. Waiting for loading to complete inside setupAndVerifyContents(), not
 outside
6. Unifying how we wait for loader to complete
7. Adding more logging

Bug: 117332845
Test: running all Nexus tests
Change-Id: I3070e1ac2b9161179cc3e0800b0cd8162807389a
2018-10-09 18:47:42 -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
Vadim Tryshev
a7da86e14a More temporary logging to diagnose testPendingWidget_autoRestored
And waiting to loader to finish to improve determinism.

Bug: 117332845
Test: running Launcher
Change-Id: Icdfce969b61f8ceb952a2715037783458da4d4c4
2018-10-05 20:05:34 -07:00
Vadim Tryshev
c052e4e68a Adding temporary logging to diagnose testPendingWidget_autoRestored
This test fails

Bug: 117332845
Test: running Launcher
Change-Id: I300c856992b3d1f559c4c31525a45e2c4a960f11
2018-10-05 17:37:01 -07:00
Sunny Goyal
ac8154a23d Caching widget labels in icon cache to avoid lookup at startup
Change-Id: Ie026ee47905454bd70e774d422cd7fe142aec7e2
2018-09-28 16:36:33 -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
Tony Wickham
6a71a5bd77 Add undo snackbar for deleting items
- Add methods to ModelWriter to prepareForUndoDelete, then
  enqueueDeleteRunnable, followed by commitDelete or abortDelete.
- Add Snackbar floating view
- Show Undo snackbar when dropping or flinging to delete target; if the
  undo action is clicked, we abort the delete, otherwise we commit it.

Bug: 24238108
Change-Id: I9997235e1f8525cbb8b1fa2338099609e7358426
2018-08-30 16:22:25 -07:00
Sunny Goyal
d230307a95 Migrating to android-x
Change-Id: I9a774152d13a541e8496dd84f2469bfed407f86d
2018-08-14 15:22:12 -07:00
Sunny Goyal
83fd25e3af Moving some abstract classes to interfaces, to better use java-8 features
Change-Id: I862af4931c95cbde052130d8b7d4ac3375db782f
2018-07-09 17:01:28 -07:00
Sunny Goyal
f266deb24c Persist the updated item to DB when a shortcut info is badged for the first time
Bug: 110016648
Change-Id: I8e36b80e9c893de91bce208ceac93a3fcdb557d5
2018-06-21 10:00:22 -07:00
Sunny Goyal
605bcf3367 Fixing bug when model was not reflected properly on the UI.
If launcher submits a job, and then reloads before the job is executed, the correct model
is not reflected on the Launcher. In that case, we simply rebind the launcher

Change-Id: I380242a4de13e7b2bc326d1a076f0a974435999c
2018-03-05 17:38:47 -08:00
Sunny Goyal
0e7724cef7 Ensuring that all the pending tasks are run
before marking the ViewOnDrawExecutor as completed.

Also fixing model writer not updated on rotation

Change-Id: I5ecd7ac865b939ffa4c02afe892bd773d9f275c3
2018-02-22 17:27:13 -08:00
Winson Chung
d6519668bf Revert "Revert "Synchronizing loader preload to avoid launcher getting stuck in loading state,""
This reverts commit 73aa3025c0.

Reason for revert: Post-drop revert

Change-Id: Ife752d26e07d9c064c938ff8d33d40457b54217a
2018-02-16 03:23:51 +00:00
Winson Chung
73aa3025c0 Revert "Synchronizing loader preload to avoid launcher getting stuck in loading state,"
This reverts commit a1b4911e26.

Reason for revert: Temporary revert for NL build

Change-Id: I81527681bd00d49e590a99e238f4d57e5a619d16
2018-02-16 02:42:33 +00:00
Sunny Goyal
a1b4911e26 Synchronizing loader preload to avoid launcher getting stuck in loading state,
which could be caused by the following sequence of events

  1) Starts preload => execution moved to background thread
     a) check if loader is running
     ... execution moved to ui thread

  2) Launcher starts
  3) Cancels any running loader and starts a new loader
     .... Execution on background thread
    b) Cancels any running loader and starts a new loader

Synchronizing (3), and [a, b] under same lock would avoid this case
Bug: 73399920

Change-Id: I6b01f797fd6f4a2e5b3c078bb374ad40fcc311c8
2018-02-15 10:31:50 -08:00
Sunny Goyal
e75d9f1ec3 Preloading the LauncherModel in case launcher dies
Change-Id: Ibe529f31e96c645d45d51b9f3bf6c21b76b41254
2018-01-31 12:01:59 -08: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
29947f0b53 No more waiting around for resume
Apply model updates as son as they arrive instead of waiting for onResume.
Various workspace items do not use any configuration dependent resources.
For Widgets, we wait until the host starts lietening before inflating the actual view.

Change-Id: Icb2f5e5940c1ce6c27062ccd34eff87e80af5ab1
2017-12-19 12:50:17 -08:00
Sunny Goyal
aeb1643ec6 Launcher state management cleanup
> Removing Widgets and related states
> Fixing different durations being used when opening/closing all-apps
> Removing some unnecessary object allocations when changing state without animation
> Differentiating widget bootm sheel and full sheet in logs

Bug: 67678570
Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
2017-10-17 12:42:08 -07:00
Sunny Goyal
f1fbc3fbe7 Converting widget panel into a floating view
> The widget panel is only inflated when needed
> Using the swipe up/down interaction for widgets tray
> Removing additional view wrappers from all-apps
> Widget tray is preserved across activity recreation
> Launcher no longer has WIDGET state, the actual code around
  the states will be removed in a follow-up cl

Bug: 67678570
Bug: 67585158
Change-Id: Ia29a7c33ec81e6c53cc24e2906b7022b6f41755b
2017-10-13 18:47:54 -07:00
Sunny Goyal
91498abf75 Moving install queue updates to worker thread.
This avoids acquiring a lock for upating the sharedPrefs during onResume
as all the logic runs on a single thread.

Bug: 67305604
Change-Id: I1bbea382da9fafb403b4e9508f393f78db28478d
2017-10-06 11:33:43 -07:00
Sunny Goyal
f2dd4216c1 Removing extraction service and palette api dependency
Change-Id: I30ad1a1462a97b6bc03f8e386ae3058c7fe022e5
2017-09-29 10:40:08 -07:00
Sunny Goyal
6e13dd3aa8 Simplifying some package matching code by using common itemInfo mathcher
Change-Id: Ib98d528391e19c0de3fe11304330dfa37710548c
2017-08-17 11:15:12 -07:00
Sunny Goyal
b23980cc0e Fixing duplicate/inconsistent definitions for model and callbacks
> 2 implementations for filtering workspace items
> 2 implementations for binding widgets
> duplicate logic for add and update appInfo

Change-Id: Id68a49926af398478deca8ac85ab1f22341a9449
2017-08-17 11:05:56 -07:00
Tony
2917a8bf2b Defer some work until after workspace fade-in
Defer:
- Setting all apps
- Setting widgets

Also set the launcher-loader thread to THREAD_PRIORITY_BACKGROUND
for the duration of the animation.

Bug: 37965432
Change-Id: I8364940805b84aecb8353a473ab4d575c27bfec4
2017-08-04 11:52:42 -07:00
Sunny Goyal
64a75aa305 Adding A feature flag to disable widgets and a corresponding build
target Launcher3Go without widgets support

Bug: 62353159
Change-Id: Ia03d2235a9bcf75f9ef191924f81630e63a2c684
2017-07-21 14:10:13 -07:00
Sunny Goyal
e86f11fa38 Adding support for loading workspace in the absence of Launcher.
> LoadWorkspace can be called with a LoaderResult which does not bind anything.
> Synchronous bind does not look for a valid page id, and will fallback to the
  current pageId similar to full load flow

Bug: 37616877
Change-Id: If14491dc79c5b85ae1019cc93e4e08759df3387d
2017-06-08 09:39:34 -07:00
Sunny Goyal
b434fde427 Moving LoaderTask to a separate class file
Bug: 34112546
Change-Id: I86d93cfb5d3903bfd3878564cbe8b67b64fd8423
2017-06-06 10:47:23 -07:00
Sunny Goyal
c6e97692e4 Moving LoaderTask static
Will move it to a separate file in a followup cl.
This simplifies dependencies between LauncherModel and LoaderTask which
and making it easier to start the loader before Launcher activity is
created (as the Callbacks in LauncherModel can change while loader is running).

Bug: 34112546
Bug: 37616877
Change-Id: Ie9619c6b0de0e3eb60657c04ae1b58d946c829e9
2017-06-02 14:27:29 -07:00
Sunny Goyal
f8d6ed21ce Moving workspace bind logic into a separate class.
This change separates the loading and binding code. Eventually workspace
loading will not depend on bind and we will be able to preload workspace
even before the launcher activity is started.

Bug: 34112546
Bug: 37616877
Change-Id: Ia8e661465cb40ad073b5b76adfc74b9e15633b1d
2017-06-01 15:56:38 -07:00
Sunny Goyal
a474a9bcf5 Simplifying logic for managed for icon addition
> Checking for duplicate icons before adding new icons

For O and above, icon addition is controlled using
SessionCommitReceiver.
As long as the Launcher is the default app, it will keep adding
icons on the homescreen. Apps installed while launcher was
not the default homescreen, no icons will be added.

For below O, icons are added based on package event. As long as
the Launcher process is running, it will keep adding icons on the
homescreen. Apps installed while the launcher app was dead, no
icons will be added.

Bug: 37528649
Bug: 37082950
Bug: 34112546
Change-Id: Ic99501fa476c00474a479f2a36c24614bfa3f4bf
2017-05-22 13:31:04 -07:00
Sunny Goyal
8bca47adc5 Merge "Making some methods accessible" into ub-launcher3-dorval-polish 2017-05-19 21:09:55 +00:00