44 Commits

Author SHA1 Message Date
Suphon Thanakornpakapong
c51b2a2218 Disable loading external default layout 2021-10-28 15:45:33 +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
Sunny Goyal
762d06136c Caching last predictions and loading it with model
Adding support for persisting itemInfos on disk. This uses
a separate xml file. Unlike prefs, it does not keep the items
in memory and is just a wraper over reading/writing a file.

Bug: 160748731
Change-Id: Iaccab9928ab8f30127fb3c2d630ca8ca83f0bd05
2020-08-11 13:23:29 -07:00
Sunny Goyal
55e2b1635f Adding a new attribute to speficy folder label directly in layout
Bug: 158141109
Change-Id: I84dccf43981abc910c0d9e75bf316c6b27b3606b
2020-06-09 15:47:21 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Samuel Fufa
ca37b8afe5 Add support for searchwidget in layout files.
Test: Manual
Bug:139703885
Change-Id: I86b36187d95bb5db59dbf6ae2e20373d23e55aa1
2019-08-23 10:58:13 -07:00
Samuel Fufa
84245e84c8 Default name's language of folder won't change after changing the system language
Test: Manual - Create unnamed folder and change system language. Folder
name should pickup new language.
Bug:78611156
Change-Id: Ie06baebe5b9a64e91630c581b75b674f363b9973
2019-08-15 09:56:12 -07:00
Sunny Goyal
9dbb27c09c Moving some utilities methods to separate class
Change-Id: I5094b22ddc77c45590cea1a5f5dead0dc7580abf
2019-07-17 15:15:07 -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
c0f03d9665 Adding support for loading the default layout from a content provider
The autority of the provider should be set in secure settings:
  launcher3.layout.provider

Bug: 127987071
Change-Id: Iccf2960aa6c0a5a8ff9621b13d8963d9daecb993
2019-04-10 12:06:17 -07:00
Sunny Goyal
0d74231fec Removing dependency on XmlResourceParser in default layout parsing
This is allow support for generating and parsing default layout at
runtime by a different app.

Change-Id: Id3bfcf1d353417102429ab137402ccfedc4e6cc5
2019-03-05 10:22:57 -08:00
Sunny Goyal
e62d2bb165 Removing some Launcher3 dependencies from BaseIconCache
Change-Id: Ic80ed4a5cd2fc414cd6c27096d798e7f0b8efc72
2018-11-06 14:51:55 -08: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
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
36b54228fc Retiring some feature flags
Change-Id: I80a00ecaec0785ce2ba6a5f14a54c8a76f555d43
2018-07-10 13:52:17 -07: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
ad7ff44009 Unifying various icon loading methods
Change-Id: I5a8969b6aad6513d769b5bb38bf95a701fe346d8
2017-09-13 11:56:55 -07:00
Rajeev Kumar
26453a297b Replace use of java.util.HashMap with android.util.ArrayMap in
AutoInstallsLayout, DefaultLayoutParser, ImportDataTask
classes.

Change-Id: Idcf1f5f020132ddf43751067a38a64bfc088800e
Bug: 62466540
2017-06-09 16:03:32 -07:00
Mario Bertschler
c06af333cb Minor Refactoring only: no functional change
- organizing imports
- remove redundant modifiers on LauncherCallback interface
- fix typos

Change-Id: I61eb985cac7c1379b6b804a67d4f234386d3d1b4
2017-03-28 12:23:22 -07:00
Sunny Goyal
eb3ba0fdfb Removing some unnecessary stacktraces from the log
Bug: 36604650
Change-Id: If754aacf37fed5fdc9ff419812c0924ad136eb45
2017-03-27 11:23:18 -07:00
Sunny Goyal
87f784c285 Removing static Context access using LauncherAppState
> This ensures that LauncherAppState is only accessed in the presence of
a valid context

Bug: 33032833
Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
2017-01-11 12:52:03 -08:00
Sunny Goyal
32f3dda802 Adding a utility class to enforce that icons are always flattened on
the background thread.

Bug: 21325319
Change-Id: I4d0f02557cdbf70cfa86750ac047faf2917e39bf
2016-11-19 23:40:07 +05:30
Sunny Goyal
10629b077c Moving some image handling classes to .graphics package
Change-Id: Id6d3d0b9c345a503ff2e09f073eb4b6449e21c7e
2016-09-02 12:34:33 -07:00
Sunny Goyal
86df138d9f Adding support for pending widgets in AutoInstall layout
> Pending widgets whill show a loading progress while the app
is being installed.
> Extra bind options can be defined using the tub tags
    <extra key="key-name" value="key-value" />
  These are sent as widget options when the widget is bound.
> If the widget has any config activity, it is not shown
> Required attributes:
   className, packageName, x, y, spanY, spanY & screen

Bug: 30279609
Change-Id: I1338618bfa5d86967339dffb68c12b1add6eb5d7
2016-08-16 12:37:29 -07:00
Sunny Goyal
bb011dad4e Adding a flag (enabled by default) to remove the all-apps button.
All apps can still be opened by clicking the caret.

Bug: 29398447
Change-Id: I61f1b05cea83a0a49d7cc16c518c5419618ba779
2016-06-17 08:17:22 -07:00
Sunny Goyal
eb4b79935e Removing icon_type column
Icon type is not used consistently. It is used initially
during the loader. Afterwards, we save both the icon and resource to the db.
Instead of changing the logic to always read the shortcut-resource first, and fallback to the bitmap if the resource is not available,
always write the bitmap to DB whenever the shortcut is edited.

Change-Id: I0ea5e88f8904bd3250ca669220b3e5d6aeef1bfd
2016-05-11 15:21:42 -07:00
Sunny Goyal
b5b55c8012 Removing LauncherProvider dependency in DatabaseHeler
This will allow DatabaseHeler to easily be moved to an independent class

Change-Id: I9a3d5d3380ed0af246d7a01553a492467c3096b0
2016-05-10 12:30:47 -07:00
Sunny Goyal
f82e547359 Fixing syntax error
Change-Id: I8fbcd34d891b1d020436e9aa430fd26372910a63
2016-01-06 15:09:22 -08:00
Sunny Goyal
96a0963c4a Adding support for negative x and y in layout xml.
Fixing default configurations for some screen sizes.

> Negative values for x and y are parsed as distance from end
column and row respectively. e.g.  (-1, -2) => (3, 2) in a
4x4 grid

Bug: 26110981
Change-Id: I4ca30e225ed6e2a31610ab23235d2cd10e8d317c
2015-12-18 17:17:08 -08:00
Adam Cohen
cf0c746ec0 Always log if Package is missing while loading default workspace
Change-Id: I7f2e5a9aabdf1fc192ad7912aaefa3f41c059ff1
2015-08-06 14:07:49 -07:00
Sunny Goyal
56a57bb6bb Adding item rank when parsing a folder
Bug: 22059402
Change-Id: Ie57f2dd58d2b4bc2eb277f10e93a25d026d1cdd2
2015-07-06 11:16:17 -07:00
Adam Cohen
2e6da1539b Refactoring DeviceProfile
-> Pulling out the parts of device profile which can (and need to be)
   initialized and accessed without access to an Activity context,
   ie. the invariant bits.
-> The invariant bits are stored in InvariantDeviceProfile which is
   initialized statically from LauncherAppState.
-> The DeviceProfile contains the Activity context-dependent bits,
   and we will create one of these for each Activity instance, and
   this instance is accessed through the Launcher activity.
-> It's possible that we can continue to refactor this such that
   all appropriate dimensions can be computed without an Activity
   context (by only specifying orientation). This would be an
   extension of this CL and allow us to know exactly how launcher
   will look in both orientations from any context.

Sets the stage for some improvements around b/19514688

Change-Id: Ia7daccf14d8ca2b9cb340b8780b684769e9f1892
2015-05-21 16:16:40 -07:00
Sunny Goyal
1d4a2df091 Removing ContentObserver from LauncherModel, and calling reload
whereever necessary

Change-Id: Ia4a8abdfe2be9703f3217a60527d3a1220b33bdc
2015-04-01 10:20:18 -07:00
Sunny Goyal
b2d46ceaaa Configuration of workspace through app restrictions
> Checking for a grid specific layout before loading the default layout

Change-Id: I1e8d4176341e61d0876b0a9bea9ad8010e3a0f6a
2015-03-27 13:00:44 -07:00
Adam Cohen
091440a9cb Reducing method count by eliminating synthetic accessors
Elimates 304 methods based on dex analysis

The java compiler generates sythetic accessor methods for all private
fields, methods and contructors accessed from inner classes. By marking them
package-private and @Thunk instead, sythentic accessor methods are no
longer needeed. These annotated elements should be treated as private.

Change-Id: Id0dc2c92733474250d8ff12fa793d3a8adeb1f26
2015-03-20 11:15:54 -07:00
Sunny Goyal
b3a8f80e2e resolved conflicts for merge of b564efb0 to ub-launcher3-master
Change-Id: I4321522dd1b6b3f96e21232d113fad5144b630bc
2015-01-23 14:22:07 -08:00
Sunny Goyal
b564efb024 Adding support for <include> tag in AutoInstall layout
Bug: 19121893
Change-Id: I760fa76d6e63c1aa0152e8cd710aba0d6ef4462a
2015-01-23 13:53:38 -08:00
Sunny Goyal
bb3b02f562 Replacing hotseat icon to an appropriate system app
> During backupi, store the hotseat target app type, based on some predefined
common system apps
> During restore, save this app type in the restore flag, if it is a hotseat app
> During first launcher load, if an app is not being restored, try to replace it
with an appropriate replacement for that type, otherwise delete it.

Bug: 18764649
Change-Id: Ic49e40bd707bd8d7de18bbab8b1e58a0a36426a2
2015-01-22 10:54:50 -08:00
Sunny Goyal
3a5a9d18da Refactoring layout parsing code
Change-Id: Iee5b2280cb1e841bcfe91fdcf523de6fa7f7f3b8
2014-10-17 14:34:49 -07:00
Sameer Padala
8fd74831de Source change to get code compiling on google3
Change-Id: Ib16df8dd9caa04903a664d8cf92767107fe57628
2014-09-22 15:17:18 -07:00
Sunny Goyal
2233c8850d Changing intent action for auto installs
Bug: 17425805
Change-Id: I12e94860206ed62d6ba04f0b5734cc55ba414e45
2014-09-19 12:23:34 -07:00
Sunny Goyal
349426234e Handling label and icon from SessionInfo.
> The ShortcutInfo stores state as bit flags and not as ints
> Intents of auto-install shortcut are automatically updated
upon installation
> Icons/titles for active sessions are cached in IconCache

Change-Id: I2047849f67d4a8aaf2bc346b58110325bb4807d4
2014-09-04 08:18:33 -07:00
Sunny Goyal
0fe505bf82 Autoinstalls loading xml
> Launcher checkes for an apk in the system image with a broadcast
receiver for action:
com.android.launcher3.action.LAUNCHER_CUSTOMIZATION
> Default layout is parsed from that apk, which can also contain
icons and string resources used in the layout config

Change-Id: I44fc9e7c3134f525f7b5db29f4e8bb56e17ce445
2014-08-12 14:13:18 -07:00