summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2024-08-05Update excluded components from payload selection callback Andrey Yepin
Bug: 352496527 Test: atest IntentResolver-tests-unit Test: manual testing using ShareTest app Flag: com.android.intentresolver.shareousel_update_exclude_components_extra Change-Id: I610edf2c11a5beb114185c8724347b0eb0487ef1
2024-08-05Don't send target selection callbacks crossprofile Joshua Trask
Test: existing + new unit case in ShareResultSenderImplTest Bug: 319671608 Flag: EXEMPT bugfix Change-Id: I9e6f3a531ee6b35cd62a67f33836fa02ce7e70cf
2024-07-30Do not crash when fail to read from the additional content cursor Andrey Yepin
Bug: 354546194 Test: atest IntentResolver-tests-unit Flag: EXEMPT bugfix Change-Id: I5123fe6c1cabbbae7479d2cea8bd9e4b8ff0b4a8
2024-07-25Merge "Unified preview image loader." into main Treehugger Robot
2024-07-25Unified preview image loader. Andrey Epin
Replace ImagePreviewImageLoader and CachingPreviewImageLoader with the new class, PreviewImageLoader. Fix: 348665058 Fix: 343819590 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Test: inject debugging logs for image requests, loadings, and cancellations and verify common scenarios. Flag: com.android.intentresolver.preview_image_loader Change-Id: Ib54ea0d538cd2cbaef6041f09eeb2b9eb6ada4cf
2024-07-16Merge "Request preview size, WIDTH and HEIGHT columns for additional ↵ Andrey Yepin
content" into main
2024-07-15Update ImageLoader interface to receive preview sizes along with the URI Andrey Epin
The UI calculates and provides view sizes but they are not used by the existing ImageLoader implementations thus no functional change is expected. Bug: 348665058 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Test: inject debug logging and verify preview values being requested for app preview types Flag: EXEMPT refactor Change-Id: I0e282f773c424b6fe81587a71e1b8630452ac63c
2024-07-12Request preview size, WIDTH and HEIGHT columns for additional content Andrey Yepin
Fix: 352818692 Test: atest IntentResolver-tests-unit Flag: EXEMPT bugfix Change-Id: I0fb0c7916a428eca064bc08def049ae4bc59818a
2024-07-10Remove fix_partial_image_edit_transition Andrey Yepin
Launched. Bug: 339583191 Test: presubmits Flag: EXEMPT removing com.android.intentresolver.fix_partial_image_edit_transition Change-Id: I8e826f05690dcfdf4bed1cfcdf036218fe3b708e
2024-07-10Remove bespoke_label_view Andrey Yepin
Launched. Bug: 302188527 Test: presubmits Flag: EXEMPT removing com.android.intentresolver.bespoke_label_view Change-Id: Ia3f3b80b6e854f4ecd569936e144815e5ab592d7
2024-07-10Merge "Remove enable_sharesheet_metadata_extra" into main Matt Casey
2024-07-09Delete PreviewViewModel Andrey Epin
Merge PreviewViewModel functionality into ChooserViewModel. Make ImageLoader injectable; remove obsolete code. Bug: 348665058 Test: atest IntentResolver-tests-activity Test: atest IntentResolver-tests-unit Flag: EXEMPT refactor Change-Id: Icb18362763c19e97ac39cfa8112c9d0357f24e1e
2024-06-26Remove enable_sharesheet_metadata_extra Matt Casey
Test: atest ChooserRequestTest Test: atest SelectionChangeCallbackImplTest Bug: 318942069 Flag: android.service.chooser.enable_sharesheet_metadata_extra Change-Id: If7efc671a836723041905cb13467b71ac2cc39dd
2024-06-26Remove chooser_album_text flag Matt Casey
It has launched. Bug: 323380224 Test: Test album text functionality. Flag:  android.service.chooser.chooser_album_text Change-Id: I5c03dce5b7d362f008f4ab834fb6631cecdee386
2024-06-07Shareousel: Maintain cursor order for shated items Andrey Epin
Add a position property to PreviewModel class to track relative order of items. For each item, the initial value is artificial and derived from the order of the initially shared items and is updated upon reading the additional items cursor. Upon sharing, If the selection has not change, the items will be shared in their original order; If the selection has changed, the order of the items will be affected by the observed items order in the cursor. Fix: 329683774 Test: manual testing Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Flag: android.service.chooser.chooser_payload_toggling Change-Id: Ie552887702cde75cb1a05ed3ec5415f4f4a5c8dc
2024-06-06Fade in shareousel items as they load Matt Casey
Switched to a StateFlow with the intiial cached value when it exists so that we don't fade in when we immediately have the bitmap. Bug: 344961968 Test: atest ShareoulselViewModelTest Test: Manual test with ShareTest and slow fade times. Flag: android.service.chooser.chooser_payload_toggling Change-Id: I14c9c82343e7e8a9330695121eebe17c65f1dcb9
2024-06-05Hide check and border UI until image load attempt completes Matt Casey
Represent the bitmap load state with a nullable bitmap along with a bool indicating whether the load attempt is complete. Bug: 344961968 Test: atest ShareouselViewModelTest Test: Manual testing with ShareTest and high latency / load failure Flag: android.service.chooser.chooser_payload_toggling Change-Id: I4fd049977d9a0c837ad52fc0a3b5931d481072c3
2024-06-03Merge "Cache shortcut icons" into main Andrey Yepin
2024-05-31Merge "Fix shared element animation for partially visible image" into main Andrey Yepin
2024-05-30Cache shortcut icons Andrey Epin
Cache icons for shortcuts loaded from the system. Bug: 325465291 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Test: manual payload selection change testing Flag: android.service.chooser.chooser_payload_toggling Change-Id: I19bad04c88e636b17d48876069de47363e3a24ae
2024-05-30Merge "Disable sharing when device is under active FRP lock" into main Mark Renouf
2024-05-29Disable sharing when device is under active FRP lock Mark Renouf
Prevent FRP bypass scenarios involving share intents This CL includes a cleanup of our Settings abstraction to cover Global, Secure and System, and updates existing tests. Bug: 327645387 Test: atest IntentResolver-tests-unit Test: atest ChooserActivityTest#chooserDisabledWhileDeviceFrpLocked Flag: EXEMPT refactor Change-Id: I928b6ea68aa8d6d710dc51eb70acd2cc2ec682c3
2024-05-29Fix shared element animation for partially visible image Andrey Epin
When launching an image editor, do not run the shared element transition animation for a paritally visible image. Fix: 339583191 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Test: manual testing Flag: com.android.intentresolver.fix_partial_image_edit_transition Change-Id: Idbcf3712d4d13966e656387b803d56486fa8e1a2
2024-05-29Cursor continuously fetches new pages as the user scrolls Govinda Wasserman
Whenever the user gets more than half a page away from the center, the cursor will fetch the next page in that direction. Test: manual test with Share Test Test: atest IntentResolver-tests-unit BUG: 341923886 FIX: 341923886 Flag: android.service.chooser.chooser_payload_toggling Change-Id: Ifc9f651ccf028f25af8adfb7bc359977803d540a
2024-05-24Switch cursor fetching to use index instead of Uri Govinda Wasserman
Test: all existing tests pass BUG: 341923886 Flag: android.service.chooser.chooser_payload_toggling Change-Id: Ifab830654666f13137adef04c336d581cc7dda9d
2024-05-24Merge "Honor content types in shareousel" into main Treehugger Robot
2024-05-24Honor content types in shareousel Matt Casey
Test: atest ShareouselViewModelTest Test: Manual testing with ShareTest Flag: android.service.chooser.chooser_payload_toggling Bug: 341923652 Change-Id: I94b6a7273a708e20d145f4b56e91c41fc120ce58
2024-05-23Merge "Preload full set of preview image metadata pages" into main Treehugger Robot
2024-05-23Preload full set of preview image metadata pages Govinda Wasserman
This is the first step in mitigating the bottleneck of slow metadata loading by proactively loading pages to the max window size. Test: atest CursorPreviewsInteractorTest FetchPreviewsInteractorTest Test: manual test using ShareTest with high metadata latency BUG: 341923886 Flag: android.service.chooser.chooser_payload_toggling Change-Id: I1192e7bdf7db77573990745dd5b05d7ef86d7f20
2024-05-22Merge "Don't allow the only selected item to be unselected." into main Treehugger Robot
2024-05-22Don't allow the only selected item to be unselected. Matt Casey
Bug: 341923156 Test: atest SelectionInteractorTest Flag: None Change-Id: I5a67d6ad6b628ac5fa73c70e2ca2b8c6d04724ae
2024-05-21Add ImageLoader with improved caching and cancelling Govinda Wasserman
BUG: 339261453 FIX: 339261453 Test: atest CachingImagePreviewImageLoaderTest Test: atest IntentResolver-tests-activity Test: manual test using ShareTest Change-Id: I316a9f683a26f2f6d8599e0da4a45ca3f4e740ab
2024-05-13Merge "Read image size from URI metadata" into main Matt Casey
2024-05-13Merge "Switch to -nodeps flavor of mockito-kotlin" into main Mark Renouf
2024-05-10Read image size from URI metadata Andrey Epin
Read preview sizes from both URI metdata, and the additional content proivider response (the latter gets priority, when present); use them to set aspect ratio for the item preview. If the size is missing, fallback to default aspect ratio, 1:1. Bug: 339679442 Test: atest IntentResolver-tests-unit Test: manual testing with ShareTest app Change-Id: Ia6072620a79b5df0b4b4bc9ebd11fb3961cb18a6
2024-05-10Switch to -nodeps flavor of mockito-kotlin Mark Renouf
Bug: 339853443 Test: Treehugger presubmit Flag: TEST_ONLY Change-Id: I4a33919fec204d0c94d4c8b850fd243bbc01630f
2024-05-10Use preview uri for previews (instead of item uri) Andrey Epin
Fix: 339702714 Test: manual functionality testing (previes are get logaded). Test: atest IntentResolver-tests-unit Flag: aconfig intentresolver android.service.chooser.chooser_payload_toggling Nextfood Change-Id: I940feac51d088a3c00c53c54ed24b9584851b8da
2024-05-10Add support for preview size columns in the additional content query. Andrey Epin
Add support for MediaStore WIDTH and HEIGHT columns in the additional content query reponse. Parse those columns if they are present but do not actually use the values (yet). Bug: 339679442 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Change-Id: I2a3ebc2c166d1cb9203824b2ac1bf0f9c4ec76da
2024-05-06Merge "Do not animate target icons and labels after payload selection ↵ Treehugger Robot
change." into main
2024-05-06Merge "Private profile share policy delegates to parent profile" into main Mark Renouf
2024-05-06Do not animate target icons and labels after payload selection change. Andrey Epin
An shared icon cache is added to prevent icons reloading for the new list adapter instance. Bug: 325465291 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Change-Id: Ifba9ec221dd6c52f4aff1d3ff94729b61c24981a
2024-05-03Migrate to mockito-kotlin Mark Renouf
Flag: TEST_ONLY Bug: N/A Test: atest IntentResolver-tests-unit Change-Id: I9e49a4bdfe9ba8022a7b915d6aa3d79c8b992154
2024-05-03Fix Kotlin code style Mark Renouf
Command: find . -name '*.kt' | xargs $ANDROID_BUILD_TOP/external/ktfmt/ktfmt.py Flag: TEST_ONLY Bug: NONE Test: compile Change-Id: I5a39029649aa80d88448ecb697bacce518b6bd84
2024-05-03Private profile share policy delegates to parent profile Mark Renouf
This change enables the Private tab sharing to respect cross profile share policy and present an appropriate message when sharing is not available. When considering private profile as a source or target, the parent profile is substituded when checking whether any intents can be forwarded. Specialized subclasses of DevicePolicyBlockerEmptyState are eliminated in favor of creating instances as needed and returned by NoCrossProfileEmptyStateProvider. They are now initialized directly with the required content instead of resource Ids. Resource are moved to DevicePolicyResources where they are shared with ResolverActivity. When sharing content to Private from Work when blocked by policy the message will now correctly refer to 'Private apps'. Test: atest NoAppsAvailableEmptyStateProviderTest Test: manual, install TestDPC, setup private space; test verious permutations Flag: EXEMPT bugfix Bug: 324428064 Bug: 300157408 Change-Id: Ieb8e725191691ea92f2994a693086c2029452365
2024-04-29Merge "Deprecate MockitoKotlinHelpers" into main Mark Renouf
2024-04-29Merge "System action refinement." into main Joshua Trask
2024-04-25Deprecate MockitoKotlinHelpers Mark Renouf
Test: atest IntentResolver-tests-unit Bug: N/A Flag: NONE test only change Change-Id: I19b98753ecfc445ff9e93fb8f75c19447b299820
2024-04-25Merge "Remove obsolete headline views from preview UI variants" into main Andrey Yepin
2024-04-25System action refinement. Joshua Trask
This is an important bugfix since Android API docs imply that app developers may start a share session with an "incomplete" payload and rely on refinement to replace the content post-selection. System actions will similarly want to use "complete" (i.e., potentially-refined) payloads. The approach is based on the observation that our existing refinement flow, despite historically operating in terms of `TargetInfo` objects, is really a function (async) from a list of one or more matching intents to a refined intent filter-matching at least one of the sources, and we can use the same mechanism to request a refinement of the "target intent" we originally used to derive the system actions and then simply re-derive them by applying the same logic to the refined intent. Per feedback on the earlier prototypes (ag/26681688 and ag/26765080), this implementation explicitly tracks the requested "type" of selection when we initiate a refinement flow so that we can handle the result by-cases when we later `consume()` the result. Bug: 331206205 Flag: com.android.intentresolver.refine_system_actions DEVELOPMENT Test: existing refinement tests + manually exercised w/ShareTest app Change-Id: I83e5a2e088387c495dec7e41fee0e311a82644f1
2024-04-23Fix incorrect cross-profile share check. Mark Renouf
When this code was updated for new profiles infrastructure (ag/26444390) a mistake was made in the interpretation of (tabOwnerUserHandleForLaunch), mistaking it for 'tabOwner', ie: the user of the tab being presented. It is not. This value represents the user which launched share sheet. As a result, since this CL, no cross-profile "Blocked by IT" messages would appear when no targets are available for cross-profile sharing. The resulting UI would show an empty tab, or fall back to the "No Apps" UI message. While the UI has test coverage for this, the tests are run by forcing calls to the reponsible component to return true or false, without validation of the user ids provided. Bug: 335142494 Test: atest IntentResolver-tests-unit Flag: NONE Change-Id: I32f455611e6ae6307d49c86d480962e3426b54c3