summaryrefslogtreecommitdiff
path: root/java
AgeCommit message (Collapse)Author
2024-03-01Create a Resolver-specific WorkProfileEmptyStateProvider Mark Renouf
This is a temporary measure to split upcoming CLs between actively shipping code and future work (ResolverActivity). The changes within ResolverActivity to integrate profile support are independent *except* for this one class which is used by both Activities. After ResolverActivity is updated, this copy can be removed. Bug: 311348033 Test: atest IntentResolver-tests-activity Test: atest IntentResolver-tests-unit Change-Id: I39b3c2fd0c0bd5451d6ded97bd5cbf4dc8404826
2024-03-01Adds @JavaInterop, a @RequiresOptIn for marking Java interop code mrenouf
"This is a a property, function or class specifically supporting Java interoperability. Usage from Kotlin should be limited to interactions with Java" Bug: 309960444 Test: This is just an annotation. Change-Id: Ia2f21bd5d4359ba22e1292ebebbef77707706ac9
2024-03-01Merge "ProfileHelper: compat helper class for Profile flows in existing ↵ Mark Renouf
Java" into main
2024-02-29ProfileHelper: compat helper class for Profile flows in existing Java Mark Renouf
This is a temporary measure to bring up the app with an initial set of user profile data sourced from UserInteractor. This is effectively a snapshot of current profile state, combined with a wrapper to access the availability StateFlow via an interface (hiding a suspend call). Test: atest IntentResolver-tests-unit:ProfileHelperTest Bug: 311348033 Flag: ACONFIG com.android.intentresolver.ENABLE_PRIVATE_PROFILE Change-Id: I6db6ece3bebbed22d0a6b7cf981873f96dd97745
2024-02-28Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: I3be17b36c834da312412ba6e69a95a9a301a1b8d
2024-02-28Merge "Shareousel: make the only selected item unselectable" into main Treehugger Robot
2024-02-28Merge "Fix Valid<T> to contain non nullable value" into main Mark Renouf
2024-02-28Merge "Shareousel: read preview uri for non-image items." into main Treehugger Robot
2024-02-27Merge "Moves Activity Lifecycle methods up to the top in order of occurance" ↵ Treehugger Robot
into main
2024-02-27Fix Valid<T> to contain non nullable value Mark Renouf
This corrects a design mistake: the Valid<T> subclass of ValidationResult should have a non-null value, so the value can be taken directly after a smart-cast. Usage becomes more concise: when (val result = validateInput(source) { is Valid -> processValue(result.value) // also result.warnings is Invalid -> handleInvalid(result.errors) } Bug: 309960444 Test: atest com.android.intentresolver.v2.validation Change-Id: Ia4ee53413d729e551b8b7ec21a8765ae7d4f5e95
2024-02-27Make ImageLoader injectable Andrey Epin
Do not inject ImageLoader anywhere by v2 activity tests. Rename TestPreviewImageLoader to FakeImageLoader for naming consistency. Bug: 302691505 Test: atest IntentResolver-tests-activity Test: atest IntentResolver-tests-unit Change-Id: I5630664eab6c9546d5de19fa7410184138d15602
2024-02-27Moves Activity Lifecycle methods up to the top in order of occurance Mark Renouf
This helps to keep the execution model of the activity lifecycle in mind while reviewing and debugging. Test: Only reorders methods, no functional change Bug: 309960444 Change-Id: If56514beb1ae790a25d8ec885efbcedaba37c484
2024-02-27Merge "Fix app target list footer" into main Andrey Yepin
2024-02-26Fix app target list footer Andrey Epin
Fix: 324011248 Test: manual testing (launching chooser while a keyboard is shown) Flag: ACONFIG com.android.intentresolver.fix_target_list_footer DEVELOPMENT Change-Id: I6bbadde2535cd9a6a43563021b37658fc566d19f
2024-02-25Make 'ShortcutSelectionLogic' Injectable. Mark Renouf
This adds a module to provide the shortcut per-app limit and the existing DeviceConfig flag used to control whether that limit is applied. Once fully integrated, tests should be updated to simply increase the limit by injecting a different value, instead of altering the device state by modfying DeviceConfig values. To complete, inject into the caller of ChooserListAdapter.addServiceResults, moving usage injecting this component to the caller to use. Bug: 300157408 Test: (this change does not yet affect live code) Flag: n/a Change-Id: I63a661ca304c8d5653992761f10983b5776d50dd
2024-02-24Merge "Creates ChooserHelper, a peer class for code cleanup" into main Mark Renouf
2024-02-23Creates ChooserHelper, a peer class for code cleanup Mark Renouf
This is a peer class to ChooserActivity to incrementally assume the tasks of initialization. Code moved through this class will have carefully controlled rules (documented in the class) for control and data flow to prevent additional tangles. This commit makes only a single control flow change, forwarding the call to ChooserActivity#init through this class. This makes no change to functionality yet, but provides a hook for following CLs. Bug: 309960444 Test: atest com.android.intentresolver Change-Id: I4d895adb00a09a9d18117639b2d85e3fe880e067
2024-02-23Shareousel: read preview uri for non-image items. Andrey Epin
Move some common metadata-related methods out of PreviewDataProvider into a separate file; use those methods in UriMetadataReader to determine preview uri value. Bug: 302691505 Test: IntentResolver-tests-unit Change-Id: Id154fc28dae8127ba41904ba9bf966763dc29320
2024-02-23Merge "Parse remaining payload selection callback result arguments" into main Andrey Yepin
2024-02-22Merge "Import translations. DO NOT MERGE ANYWHERE" into main Bill Yi
2024-02-22Renames ActivityLaunch to ActivityModel Mark Renouf
This is a straight automated rename refactor for clarity and based on team feedback and arch guidelines for consistency. Only changing names with no functional changes. Bug: 309960444 Change-Id: Ibe93ae5fc0198432fc65d9c43922d6fb6913364d
2024-02-21Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: I3719fc06a17e8e88825cd153fae004c38dfe0511
2024-02-21Parse remaining payload selection callback result arguments Andrey Epin
Bug: 302691505 Test: atest IntentResolver-tests-unit Change-Id: I93ab3abb9605a32b4ce44572a027c478c3ea1210
2024-02-20Check for EXTRA_CHOOSER_RESULT for backcompat until V2 is released Mark Renouf
This keeps the existing functionality working in V1, with the flag enabled for apps using Intent.createChooser which will begin sending the new extra value. The extra used has no bearing on functionality. With the feature flag disabled, the same functionality continues while also accepting the the extra name from Intent.createChooser. Without this, apps using Intent.createChooser will stop receiving results with the flag[1] disabled. [1] intentresolver/com.android.intentresolver.modular_framework Bug: 325545074 Test: atest android.content.cts.IntentTest#testCreateChooser Change-Id: Id25de6410835a85e71cb58277015d8ede51f4e4d
2024-02-18Merge "Change UserInteractor availability interface" into main Mark Renouf
2024-02-17Shareousel: make the only selected item unselectable Andrey Epin
Fix: 325496908 Test: atest IntentResolver-tests-unit Test: manual functionality testing Change-Id: Ie7d8a7691d697f3c0aa87ce0a4b144f48bfdbdd5
2024-02-16Change UserInteractor availability interface Mark Renouf
This does the following: 1) Keeps availability information per-Profile, and not per-Type because there isn't a requirement to enforce a single instance per type at this layer, and this requirement may come along in the future. 2) changes `fun isAvailable(Profile.Type: Flow<Boolean>` to `val availability: Flow<Map<Profile, Boolean>>` which is easier to consume downstream as a StateFlow without additional bookeeping of maintaining individual flows. Changes can be easily processed by using a runningFold and taking the difference in the two maps. Test: atest UserInteractorTest Bug: n/a Flag: n/a (code is not yet live) Change-Id: I8605c42bead70b4bf41fdf89c195311b85938b1b
2024-02-16Merge "Import translations. DO NOT MERGE ANYWHERE" into main Bill Yi
2024-02-16Merge "Moves Profile to shared/model for use with some existing View ↵ Mark Renouf
components." into main
2024-02-16Moves Profile to shared/model for use with some existing View components. Mark Renouf
It's more of an identifying token than a UI model and is used in logic not for drawing UI. Bug: 300157408 Test: atest IntentResolver-tests-unit Change-Id: I13cf3a7f15beb985f91647a65731950092236f04
2024-02-16Adds hasComponent and hasSendAction to IntentExt Mark Renouf
Bug: n/a Test: atest com.android.intentresolver.v2.ext.IntentExtTest Change-Id: I6b2ab5e5f829a6ea1d7c127dcc3dac810e0b6982
2024-02-15Merge "Move MPPA and subclasses to subpackage 'profiles'" into main Treehugger Robot
2024-02-15Move MPPA and subclasses to subpackage 'profiles' Mark Renouf
This will let us unpack these files a bit, move some inner classes out and make a home for additional code to improve the patterns here. Pure mechanical refactor. Bug: n/a Test: atest IntentResolver-tests-unit Change-Id: I138313fc0e84b603b6f173a27cb3b96c91ecc194
2024-02-15Merge "Fix infinite loop in edit/copy callbacks" into main Matt Casey
2024-02-15Fix infinite loop in edit/copy callbacks Matt Casey
Minor refactor to allow for some testing of the change as well. Test: atest chooserActionFactoryTest Test: Manual verification of bug fix with ShareTest Bug: 325365738 Change-Id: I27a785164ad660a37159d5fb7793d2e2e2b8be5c
2024-02-14Merge "Cleanup payload selection flag usage" into main Treehugger Robot
2024-02-14Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: I82ffd41bd0cf6236cf97d2ba87ec30d4a3606f34
2024-02-14Merge "Remove direct reference to Activity getIntent()" into main Mark Renouf
2024-02-13Cleanup payload selection flag usage Andrey Epin
Remove direct payload selection flag usages. Bug: 302691505 Test: atest IntentResolver-tests-unit Change-Id: I473e6d3fcbc0dbe8ad61c28e010e72c2b984cbea
2024-02-13Merge "Use new shareousel API constants" into main Treehugger Robot
2024-02-13Use new shareousel API constants Andrey Epin
Bug: 302691505 Test: Manual existing functionality testing with a test app. Change-Id: Ic16c866b866cc5d3645f1f2dbf63170a8023b78e
2024-02-13Remove direct reference to Activity getIntent() Mark Renouf
ActivityLaunch provides activity-scoped values from launch time. This abstraction is important for testability, allowing us to consistently test startup conditions in isolation without involving actually starting an activity, or depending on the state of the system in any way. Test: atest IntentResolver-tests-activity Test: atest IntentResolver-tests-unit Change-Id: Iec8b6b7067c6535f723ab47d712e1a937000e1c4
2024-02-13Start shareousel with initial selection visible Steve Elliott
Bug: 302691505 Flag: ACONFIG android.service.chooser.chooser_payload_toggling DEVELOPMENT Test: N/A - code isn't live Change-Id: Ia410469744675be255dab6470a773ec46367d392
2024-02-12Show payload toggling UI Andrey Epin
Show payload toggling UI if the flag is enabled. Bug: 302691505 Test: enable feature flag and verify that payload toggling UI is gets shown Change-Id: If3c70088e58977f5345066d5abec31e298e1f4fe
2024-02-12Add preview type to payload toggling UI. Andrey Epin
Bug: 302691505 Test: atest IntentResolver-tests-unit Change-Id: I2341ce0c7129ac9ee454e134c2626c2d6b960ce4
2024-02-12Add observable custom actions to v2 action factory Andrey Epin
The new code is not yet used. Bug: 302691505 Test: atest IntentResolver-tests-unit Change-Id: I32aa2c2c10cc1c19a534116ebeabd4777b8d47ca
2024-02-12Initialize PlayloadToggleInteractor in PreviewViewModel Andrey Epin
Initialize PlayloadToggleInteractor in PreviewViewModel when the flag is enabled. Bug: 302691505 Test: IntentResolver-tests-unit (Both V2 flag values) Test: IntentResolver-tests-integration (Both V2 flag values) Test: IntentResolver-tests-activity (Both V2 flag values) Test: Functinality smoke test (orentation change, different preview types, target selection flow) for both V2 flag values. Change-Id: I5899b0dd25b9482e56d17bdcad57a0aaa4600734
2024-02-12Additional Details for Sharesheet App Callbacks Mark Renouf
Bug: 263474465 Test: atest ShareResultSenderImplTest Change-Id: Icb61fa49dd2989cc50d7024da19d863e6c2fc189
2024-02-12Merge "Makes default sharesheet show metadata text below title" into main Matt Casey
2024-02-12Merge "Remove shareousel preview action button" into main Treehugger Robot