Commit Graph

6 Commits

Author SHA1 Message Date
Sunny Goyal
d94100a223 Migrating prediction_undo to aconfig
Flag: com.android.launcher3.enable_dismiss_prediction_undo
Test: atest SystemShortcutTest
Bug: 270394476
Change-Id: I5daef5d168c301115d860a1ae1d3c96f70a0f18f
2024-09-13 20:21:32 -07:00
Sebastián Franco
5054899552 Merge "Moving some constants in Launcher.java to a separate file for ease of readability" into main 2023-11-07 21:22:11 +00:00
Sebastian Franco
974cc94839 Moving some constants in Launcher.java to a separate file for ease of readability
Part of  go/launcher_SoR

Flag: N/A
Bug: 306465626
Test: compiling, no-op change
Change-Id: I5ea40acb2ba1ea5840021e297516a511b032a043
2023-11-07 10:12:26 -06:00
Sunny Goyal
e82a20a44d Removing some dependencies on Activity
> Removing activtiy from overlay callbacks
> Removing usage on activtiyLifecycleCallbacks and managing the callbacks ourselves

Bug: 306225896
Test: Existing tests cover the lifecycle changes
Flag: N/A
Change-Id: I79941e364328eecdc8a72cac4d35b75d50a25319
2023-10-30 08:23:15 -07:00
Sebastian Franco
a64f3a6c98 Call getModelWriter() to get the newest version instead of using the old one
DropTargetHandler was calling getModelWriter() on a final variable
and the model writer it was using was and old one.

Fix: 280170665
Test: Manul test, delete widget and rotate the device, you have to do this twice.
Change-Id: I7b3ac4b272568fcc81438ffd5ac84cf7b64a62ea
2023-05-05 16:09:38 -06:00
Andrew Cole
44898c3db4 Unit testing ButtonDropTarget
Originally there was a bug in a method (isTextClippedVertically) in ButtonDropTarget. While attempting to write a unit test it became necessary to refactor ButtonDropTarget and DeleteDropTarget to decouple them from their dependency on launcher in order to allow for a unit test to be written

The pattern we are introducing here is to decouple Launcher from a controller, in order to facilitate easier testing.
Instead of calling Launcher.getLauncher() we call the method through ActivityContext, which has a testing wrapper already defined. Here is a diagram that explains the old and new pattern

Design Pattern: https://screenshot.googleplex.com/7apiE2DaGDrFzy9.png

Test: isTextClippedVerticallyTest
Bug: b/274402490

Change-Id: I1f3003d0b62dddbceb6e492b15aa5d7352d3a293
2023-04-20 11:22:27 -07:00