Commit Graph

273 Commits

Author SHA1 Message Date
Sunny Goyal
0e43493f8f Merge "Separating the DB upgrade into two paths: > schema update: changes in the table schema > data update: backward compatible changes to the data" into ub-launcher3-dorval
am: d31692c0e7

Change-Id: If9b5e413401ac2b969a591acd81c8e6e1c7c2483
2017-04-17 16:46:28 +00:00
Sunny Goyal
3c7d55bdc7 Separating the DB upgrade into two paths:
> schema update: changes in the table schema
> data update: backward compatible changes to the data

Bug: 37257575
Change-Id: I856854ff2bffa2701f903a24fdc3baf6641175fd
2017-04-17 09:36:05 -07:00
Hyunyoung Song
e295acaeb3 Launcher dump proto that will be used for:
$ adb shell dumpsys activity provider com.android.launcher3/com.android.launcher3.LauncherProvider
To see how the proto is filled: go/launcher-proto-dump

b/31772480

Change-Id: I8e0f1e5e38148a3dfeabd2fc057392193b2625dd
(cherry picked from commit 6aa3729e98)
2017-04-04 23:06:30 +00:00
Sunny Goyal
740e90144a Adding support for dynamically change icon shape for AdaptiveIcons
am: ca18746163

Change-Id: Ic4c14ad1760930735a881926aac8b45efe0cdba0
2017-04-04 19:52:22 +00:00
Sunny Goyal
ca18746163 Adding support for dynamically change icon shape for AdaptiveIcons
> This would allow developers to verify their icon designs on different
device configurations
> This settings is only visible when developer settings is enabled

Change-Id: I7e32abfede001c134f23390734dcd39c93b68b9a
2017-04-04 12:33:59 -07:00
Sunny Goyal
d23f37794f Merge "Removing the profile extra from intent and using the profile id from the profile column" into ub-launcher3-dorval
am: 77ff9a4343

Change-Id: Ib0cd8cb8f963b78a9cd53ed896aeb6e4f6163683
2017-03-21 23:21:26 +00:00
Sunny Goyal
24bb66a1c5 Removing the profile extra from intent and using the profile id from the profile column
The intent extra is not always correct as the profile id can change during backup restore.
This allows us to use a consistant behavior everywhere.

Change-Id: I004bd244204ca91758b1d42488e1fc13b0ccb998
2017-03-21 15:14:43 -07:00
Sunny Goyal
3d706ad703 Separating the config and flags in different directories so that
it is easier to override one or the other

Bug: 36001650
Change-Id: I713f4f5dbcf902614ce9f6c7a73bdace7bdf1ea0
2017-03-07 09:30:51 -08:00
Hyunyoung Song
6aa3729e98 Launcher dump proto that will be used for:
$ adb shell dumpsys activity provider com.android.launcher3/com.android.launcher3.LauncherProvider
To see how the proto is filled: go/launcher-proto-dump

b/31772480

Change-Id: I8e0f1e5e38148a3dfeabd2fc057392193b2625dd
2017-03-01 17:21:19 -08:00
Sunny Goyal
e05b08f705 Using transaction when dropping tables, so that the DB never enters
an inconsistant state

Bug: 34720697
Change-Id: I55a26d63be6c06622da6ee3395bf1990f1a58a11
2017-02-23 18:30:56 -08:00
Sunny Goyal
dd96a5e4fd Simplifying Model data load state management
Instead of maintaining 3 different states, each tied to a subset of data,
maintaing a single state that represents all the data. Individual subset
data is invalidated in rare cases and these invalidates are tightly tied
to the UI. This also allows us to add new data to the model, without worring
about classifying the data into a subset.

Bug: 34112546
Change-Id: Id9cb273de35b79e84a2ef8d6556fcf1e72fb4b75
2017-02-22 15:45:14 -08:00
Sunny Goyal
fdbef27759 Initializing LauncherAppState only on the main thread
Bug: 33032833
Change-Id: I7992a5358142dde80aeaf8c6b7a6c7bfef2c8a00
2017-02-13 17:36:18 -08: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
8ad02b8f3f Removing static access to Context through LauncherAppState
Bug: 33032833
Change-Id: I09baaa6d79187b3096a2ab3a89d7dcaeaf9eee68
2016-12-29 15:12:14 -08:00
Sunny Goyal
a52ecb0390 Removing all compatibility code below Lollipop
Bug: 32745285
Change-Id: I62971908e3e4402941fab627bbdfd47be64473a3
2016-12-16 15:05:09 -08:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
72db9afef4 Fixing wrong message sent on app widget host reset
Change-Id: If5842d4ebbf3fa0ef8596f22788f909748f01ac5
2016-11-29 07:26:20 +05:30
Sunny Goyal
2e013ea7f6 Alienating QSB
> Moving all QSB widget handling code in a separate package
> QSB is handled on a separate host, independent of the main
host. This allows us to safely reset either of the two hosts
> Also removing the logic around closeSystemDialog:
   Launcher does not use any panels which need closing
   System sends an onActivityResult(RESULT_CANCELLED), we do
   not need special handling for waitingForResult
> Fixing bug when auto-generated qsb widget id was not being saved

Change-Id: I2d889b7b1c80b14785d14f35624142a4b78452de
2016-10-18 11:44:21 +01:00
Sunny Goyal
8e0e1d7609 Moving come helper methods to corresponding classes
> Moving isPackageEnabled to InstallShortcutReceiver
> Moving the deep shortcut map to the data model
> Removing appInfo.flags. Instead fetching the flags when needed

Change-Id: I654dd8acefa7b7d183b0419afbe112bef001d536
2016-10-10 20:58:56 +00:00
Sunny Goyal
10629b077c Moving some image handling classes to .graphics package
Change-Id: Id6d3d0b9c345a503ff2e09f073eb4b6449e21c7e
2016-09-02 12:34:33 -07:00
Louis Begin
a9c21c624c Improve handling of external deletion in LauncherProvider.delete
When deleting a widget, ensure that we also delete the corresponding
widget from the system server

Bug 30835877

Change-Id: I7d539c2d37ef53086d09ae128f7278941f804aeb
2016-08-16 12:43:05 -07:00
Sunny Goyal
a5c8a9eb66 Adding logic to pull in workspace data from another Launcher3 based
provider. This allows OEMs to keep the user's homescreen intact while
changing the default home app package.

Bug: 28536314
Change-Id: Ibebfd7dd33aa2cbd9ca28d2d611dd0a4a5971444
2016-07-09 16:19:26 -07:00
Sunny Goyal
eb77aaea89 Removing Key-Value pair backup logic as Launcher now uses full-data backup
Change-Id: I3bbaec2b33afe8c1da3ca1468c7c733cc3194604
2016-06-23 16:31:54 -07:00
Sunny Goyal
e26d1008eb Adding some tracing sections around launcher startup
Bug: 29007436
Change-Id: I53afd9130a2dc70a2223f1623e862faf44370f26
2016-06-20 15:56:22 -07:00
Sunny Goyal
a9e2f5abb3 Adding a DB update path to handle the QSB position change
> Renamed the id of 1st screen to 0 and making space for the QSB
by running the grid migration task.
> Added a feature flag to easily disable the QSB-in-workspace behavior

Change-Id: Ie3369f0d4433d916e9d6215d414770d4333f3e26
2016-06-15 10:03:12 -07:00
Sunny Goyal
e8f7d5a67e Executing the DB migration during startup instead of restore.
This allows proper execution of DB.onUpgrade task if the app updates
after the restore

Change-Id: I4c40167b30e1d7040b3a38be70d834f7b215e540
2016-06-08 16:14:59 -07:00
Sunny Goyal
da4fe1a624 Moving the QSB to the workspace grid.
The QSB will only be resent on the first screen of the workspace
covering the full width of the first row. If will not be movable.
The first screen of the workspace will not be movable.
The searchDropTargetBar no longer contains the QSB (it can be
renamed in aseparate cl).

Refactoring all QSB related logic by moving it to a custom view
inflated only using xml.
Change-Id: Icb4fd6eb855df1af15f685961c38351bf4fd4f4a
2016-05-27 18:23:29 -07:00
Sunny Goyal
ded0fdba52 Removing logic for workspace migration from Launcher2
Change-Id: I8a121d74862f665c58406f8d5c7eb1263e7ccff3
2016-05-23 16:00:09 -07:00
Sunny Goyal
f48e59268b Making the 'Allow rotation' setting dependent on system state
The setting will not be available on a tablet, where rotation is
always enabled. On mobiles, it will be disabled when auto-rotate
is disabled in display settings.
Also removing content provider dependency from settings, as its in the
same process as launcher.

Bug: 28704055
Change-Id: Ibe6b1e67411fb0e4b2e36446710f463e4a3d6883
2016-05-16 12:07:41 -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
c190dbfb78 Adding full backup handler for launcher3
Bug: 28302573

Change-Id: If0889a3b00b88b134b19d7f790159dfafdcdb004
2016-05-10 15:27:24 -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
745bad9da1 Chaning the behavior of settings activity.
> Making all twoState prefs backed by content provider
> Using the stadard intent defined in N for settings
> Using SharedPrefsListener instead of LauncherProvider

Change-Id: I8272f54aa780bc0436e3d0aa89096a4bd2a9194f
2016-05-02 12:00:51 -07:00
Sunny Goyal
cc8f9e0af7 Removing some deprecated columns.
Removing these columns will ensure that new installs do not
get this column, without affecting the upgrades.

Change-Id: If06edcd2f899f30b5427c07e72a170ccefc32dd6
2016-04-21 08:14:19 -07:00
Tony Wickham
827cef203f Added ColorExtractionService and ExtractedColors.
- Launcher has an instance of ExtractedColors, which is loaded from
  LauncherProvider in onCreate() and whenever the wallpaper changes.
  - When the wallpaper changes, the ColorExtractionService is started
    in the :wallpaper-chooser process.
  - ColorExtractionService builds an ExtractedColors instance and saves
    it as a String in LauncherProvider.
  - When the results are saved, Launcher gets a callback through
    LauncherProviderChangeListener and reloads the ExtractedColors.
- Whenever Launcher loads Extractecolors, it also re-colors items
  (currently a no-op).

Change-Id: I319e2cfe0a86abcbc6bb39ef6b9fbbcad54ad743
2016-04-01 15:40:57 -07:00
Sunny Goyal
7eab3cc374 Fixing broken instrumentation tests when run from command line
Change-Id: I923cdbaaaf18c9b765d1e70122b92cd2c1621e06
2016-03-18 17:48:53 -07:00
Sunny Goyal
bf67f3b184 Creating database without localized collators on NYC and above
Android automatically creates and maintains a metaData table to
store the current device locale. This is used when fetching
sorted results. Since Laucher does not require string based
sorting on its tables, we can avoid unnecessary IO by disabling
this feature

Bug: 24608776
Change-Id: I8bbf5ca3abd505be95a85cfc99dd0438966575e9
2016-03-17 11:40:04 -07:00
Sunny Goyal
8f3819bc51 Preserving the homescreen rotation setting on a tablet, when the display is scaled
Bug: 27040652
Change-Id: I07f5e02443379ac5b877f72d33cedf4f2feca926
2016-02-23 14:50:27 -08:00
Sunny Goyal
ad37152c14 resolve merge conflicts of b171e5675b to ub-launcher3-calgary.
Change-Id: I329c7518d8c3f0f43e96c6446d5b53a6f4439211
2016-01-29 14:30:08 -08:00
Sunny Goyal
b171e5675b Adding a method to throttle backup manager calls
Notifying backup manager when a boolean preference changes

Bug: 22885775
Change-Id: I105013af1841f6cd87472f558fa490670ed1ba24
2016-01-29 14:12:21 -08:00
Sunny Goyal
f076eae0ca Adding support for migrating the grid between any two valid screens sizes.
The grid is migrated in steps where each step consists of at max one column change and at max one row change.
Adding some unit tests for GridMigrationLogic

Bug: 25958224
Change-Id: Ie54e872ea0925cc4c463edbba0a7201d62b373a0
2016-01-20 11:58:09 -08:00
Sunny Goyal
d7d5bd878a resolve merge conflicts of ffa1237698 to ub-launcher3-master.
Change-Id: I65beecb5bbbfe9c4b33d6ca639118cb615c4120a
2015-12-18 15:04:13 -08:00
Sunny Goyal
d804398755 Using SharedPrefenrece.apply instead of commit to prevent disk IO on main thread
Bug: 25903149
Change-Id: Ib1ee3fd27cca14f147f704aec768a330c4f03b33
2015-12-17 22:24:51 -08:00
Sunny Goyal
aefc0c4dd0 resolve merge conflicts of e5ef3d2e9b to ub-launcher3-master.
Change-Id: I37cbbe4f51cc0a8de8071434020ec1553241da85
2015-12-10 17:46:12 -08:00
Sunny Goyal
d3849d191b Moving DB creation to background thread
Change-Id: I5404edd8df7160108c230d245f34bf8e24173619
2015-12-08 13:38:28 -08:00
Sunny Goyal
33f90e7b55 Clearing DB instead of deleting the DB file.
> Deleting a file/reinitializing the openHelper variable is not thread safe
and can cause the sqlite instance ot go in an invalid state

Change-Id: I54d992c7e3daee82e6dad38d6bfbfcbf8ede506c
2015-11-30 11:48:16 -08:00
Sunny Goyal
0c34443406 resolve merge conflicts of 7bce5f7988 to ub-launcher3-master.
Change-Id: Id352ce219bed7701956bb462ea2dd0a5aebe7317
2015-11-24 13:12:32 -08:00
Sunny Goyal
7bce5f7988 Tying LauncherAppState lifecycle with LauncherProvider
The content provider is the first component started with the main process,
which makes it ideal for initiating LauncherAppState

Change-Id: I03db82a8949ad1376af53a0033592f421dbf0b15
2015-11-24 12:06:42 -08:00
Sunny Goyal
d249748abf Making all provider calls using content resolver.
This will allow us to easily move db creation out of onCreate

Change-Id: Idd949624b0a9c95e4451e48db7764b7b7922c40a
2015-10-20 11:04:44 -07:00
Sunny Goyal
f912beb2ee resolve merge conflicts of fe3db428ab to ub-launcher3-master.
Change-Id: Icc60a61f621fefe9db67b178921e62f7d72d7e5a
2015-10-20 10:37:15 -07:00