Commit Graph

15 Commits

Author SHA1 Message Date
Sunny Goyal
ee9740462e Simplifying some test utility methods
Bug: 283821111
Test: Presubmit
Flag: N/A
Change-Id: I7b9690bc0cc53d097d26cd4f0ab2dd36ba88e1cb
2023-06-02 13:30:55 +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
Alex Chau
49dcd16b26 Only check dbFile to decide if grid migration is needed
Fix: 234847755
Test: With a modified local build, when changing display config to swap between same grid:
- When dbFile is same but device type is different, no migration is performed
- When both dbFile and device type are different, migration is performed properly
Test: Grid migration through Wallpaper & Styles still works properly

Change-Id: Ie7429a7d59c135ba47061cae21c40b8d8af7188a
2022-06-21 12:36:50 +00:00
Alex Chau
fe9a07bb96 Pass in dbFile from idpGridState for grid migration
- IDP can get re-initializeed during grid migration task, causing src/dest dbFile to be the same when prepareForMigration, which fails the migration and causes a wipe
- The fix is to cache IDP state as DeviceGridState, and use DeviceGridState to determine migration, trigger migration and save configuration after migration
- This should avoid migration failure in b/198965093 that causes homescreen wipe. Homescreen icon may still be messed up by the migration, but won't completely disappear

Bug: 198965093
Fix: 223579388
Test: manually trigger grid migration
Change-Id: I9890a6d5d530ff87aed8f601ec7d35a672b7cd46
2022-03-09 14:52:17 +00:00
Thales Lima
0a7ff8780f Create new logic for grid migration
Fixes 217564863
Test: manual, changing grids from Wallpaper & Style and checking against spec

Change-Id: I94cf77111b37810282527f1a212b6e4126d3eba1
2022-02-23 15:20:50 +00:00
Alex Chau
f3dbb049dc Add 6 col grid to UIEvents
Bug: 210118169
Test: manual
Change-Id: I811c970ba41641a0abfae0d0a395a6b31a9da5dd
2022-01-06 14:53:51 +00:00
Alex Chau
ab26c62c4a Allow restore across form factors
- Removed deviceTypeCompatible check and allow restore across for mfactors
- In AOSP default device_profile, mark 3x3, 4x4, and 5x5 as phone only. On tablets they'll reflow to 6x5.

Bug: 198575341
Bug: 210129187
Test: Only 3x3, 4x4 and 5x5 are enabled on phone
Test: Only 6x5 is enabled on tablet
Test: Phone backup of 4x4 get restored and reflow to 6x5 on tablet
Change-Id: I36a641d47fcee86ace0fea3d9194d61d12517f13
2021-12-10 22:00:49 +00:00
Alex Chau
1c883d861e Add launcher grid spec for tablet
- Introduced device_category to allow grids to be only enabled for certain device types. By default grids are enabled for all device types, so old OEM device_profiles aren't affected
  - Removed device_profiles_split.xml as a result and merged with device_profiles.xml
- Added deviceType in InvariantDeviceProfile to replace isSplitDisplay and centralize the logic
- Only has 6x5 grid with new default layout that works better for tablets

Bug: 198575341
Test: manual
Change-Id: I03f6727ce837ffeee6321b6d7c53942338d0cf30
2021-12-08 18:22:34 +00:00
Sunny Goyal
807de418e9 Ignoring display size change when display is off
Bug: 198965093
Test: Verified with the script provided on the bug
Change-Id: I0efaa5a9b7be94f406a9c283219c715a6c430256
2021-09-30 11:43:26 -07:00
Alex Chau
e35ef91c3e Workaround: don't migrate grid when hotseat size or device type changes in multi display
Bug: 198965093
Test: manual
Change-Id: I804ec854b98d27717c32723028f892ca2556d327
2021-09-20 12:29:00 +01:00
Andras Kloczl
971da6c3aa Add logging to catch rare launcher wipe issue
Test: not necessary
Bug: 200010396
Change-Id: If7c478e220c2c0ee9f6479b18bf05bf39811b451
2021-09-16 17:26:04 +01:00
Alex Chau
d63c58d7d1 Allow restore between TYPE_PHONE AND TYPE_MULTI_DISPLAY in RestoreDbTask
- Follow-up of ag/15795679: allow restore in RestoreDbTask as well

Bug: 199407109
Test: manual
Change-Id: I2a8e2d9c28ee777f53a6d3554e31f7318422401f
2021-09-10 15:16:36 +01:00
Alex Chau
fef4d0e081 Allow restore between TYPE_PHONE AND TYPE_MULTI_DISPLAY
Bug: 199407109
Test: manual
Change-Id: I6eb982a79f4130925a9d7e0972faf0f01a6aac20
2021-09-09 18:24:51 +01:00
Sunny Goyal
68031ca3f9 Storing form factor as part of backup and disabling restore if form-factor is different
Bug: 195301649
Test: Manual
Change-Id: I9a9c4bc9246f40af2209cb914b3966319bc78bff
2021-08-04 09:51:04 -07:00