summaryrefslogtreecommitdiff
path: root/java
AgeCommit message (Collapse)Author
2024-04-25Remove the profile tab button animation Andrey Epin
Initial activity animation caused button animation to be unnoticeable. Removing the button animation prevents buttons from "blinking" when the payload selection has changed. Bug: 325465291 Test: manual visual testing Change-Id: I340b38b07a324c1423c259a795c14d713002ed61
2024-04-25Merge "Remove obsolete headline views from preview UI variants" into main Andrey Yepin
2024-04-25Merge "Remove preview view from ChooserGridAdapter" 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-25Only show the shareoulsel card when the image is availble. Matt Casey
Remove red outlines while load is in progress. Also provide a color for the background when no shareousel state is available. Bug: 336849655 Test: Visual verification with ShareTest Flag: None Change-Id: I84a41350621d828a45f037b17350e495d382afc1
2024-04-25Merge "Fix incorrect cross-profile share check." into main Treehugger Robot
2024-04-24Merge "Import translations. DO NOT MERGE ANYWHERE" into main Treehugger Robot
2024-04-24Merge "Block taking recents screenshot if private profile available" into main Anna Zhuravleva
2024-04-24Block taking recents screenshot if private profile available Anna Zhuravleva
Sharesheet shows separate tab when private profile is on. User can move sharesheet to the background (e.g. by launching other app using shortcut) and then lock private profile. Recents preview screen shows screenshot of the Sharesheet at the last moment it was in foreground (when the space was unlocked). As a result Recents preview can leak whether private profile exists on device. This change sets setting to show blank screen in the recents when private profile is avaialble. Bug: 333387696 Test: manual, https://buganizer.corp.google.com/issues/333387696#comment8 Change-Id: I8758cd0a311ce93a03d998c4ada8999a6d02246d
2024-04-24Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: Ia37cc79460d973b71025fb8aa2c78bea0678ec3f
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
2024-04-23Remove obsolete headline views from preview UI variants Andrey Epin
With scrollable preview's been released, headline views within preview variants are obsolete and can be deleted. Bug: 287102904 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Test: manual functionality smoke test Change-Id: I26ad0afc4e3801c57025044107121bacff6dc860
2024-04-23Merge "Remove scrollable preview flag" into main Treehugger Robot
2024-04-22Remove preview view from ChooserGridAdapter Andrey Epin
Mechanical refactoring: * inline getSystemRowCount() and simplify the result code. * remove now unused VIEW_TYPE_CONTENT_PREVIEW view type and ChooserActivityDelegate methods. Bug: 287102904 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Test: manual functionality smoke test Change-Id: I63124e05652759eb508b99ba0ac771b1eacb1e77
2024-04-22Remove scrollable preview flag Andrey Epin
Bug: 287102904 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Change-Id: I028a246907a076680e26acdb816b3f32020fa772
2024-04-22Merge "Import translations. DO NOT MERGE ANYWHERE" into main Bill Yi
2024-04-22Merge "Payload selection change UI improvements." into main Treehugger Robot
2024-04-21Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: Id7810301f2e40d8dd290f8e399811137b29325bb
2024-04-19Merge "Fix "NoAppsAvailableEmptyStateProvider" message for Private" into main Mark Renouf
2024-04-19Fix "NoAppsAvailableEmptyStateProvider" message for Private Mark Renouf
Updates the logic to simplify and correct correct labels for private profile. When there is only a single visible profile (personal), the default empty state is returned, otherwise present the more informative "No work apps", "No private apps" or "No personal apps" is shown. To send an intent to share via Sharesheet which matches no installed apps: adb shell am start -a android.intent.action.CHOOSER --eu android.intent.extra.INTENT data:text/plain;base64,SGVsbG8sIFdvcmxkIQ== Explanation: ChooserActivity accepts EXTRA_INTENT containing either an Intent or a URI. In this case the data: uri is decoded and results in a string -as- the intent which doesn't match any apps. Bug: 334039327 Test: manual, see adb command Test: With work profile paused, and unpaused Test: With private profile locked, and unlocked Change-Id: I1e2565686fb8f7bcf15611541e905cf903e64704
2024-04-19Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: Id0c5c94a7ef4ea62a52c3332dc122e783662db32
2024-04-17Merge "Fix NPE when edit action is null" into main Alan Chen
2024-04-17Fix NPE when edit action is null Alan Chen
Make editButtonRunnable null when there is no valid editSharingTarget to prevent a NPE that will crash the app creating the sharesheet. This will remove the edit button in ChooserContentPreviewUi when no editor is available. Bug: 330383989 Test: manual - see recording in issue Change-Id: I3d84ce548bf303062bf6b3bd0a2e6c396ddbb86c
2024-04-17Merge "Update shareousel actions to align with mock" into main Matt Casey
2024-04-16Merge "Import translations. DO NOT MERGE ANYWHERE" into main Bill Yi
2024-04-16Merge "Update reselection action display per mock" into main Matt Casey
2024-04-15Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: Id1268e9e38f8ae2c4004086a48bdb39db118ddb4
2024-04-15Update shareousel actions to align with mock Matt Casey
Bug: 302691505 Test: Visual verification Flag: ACONFIG android.service.chooser.chooser_payload_toggling NEXTFOOD Change-Id: I86b8faf2c250fe1e6b6ca846d912669884156361
2024-04-15Add metadata text to shareousel UI Matt Casey
Test: atest ShareouselViewModelTest Test: Manual testing with ShareTest (updating string on toggle) Bug: 325463573 Bug: 325462259 Flag: ACONFIG android.service.chooser.chooser_payload_toggling NEXTFOOD Change-Id: I73d2ee2ad37321a8ebf9e559e37427563c2e2ffa
2024-04-15Update reselection action display per mock Matt Casey
Shaded background and padding aligning with app actions. Figma: https://www.figma.com/file/4xlTKN9jqhpq4X8Zb3v100/V-%E2%80%A2-Sharesheet?type=design&node-id=6-65768&mode=design&t=wNRwjFJ0LUT72JjP-0 Bug: 333992288 Test: Manual trigging with sharetest (with short and long modify labels) Flag: N/A Change-Id: I0236958976a8e4783f4c9af9398fe7e000fde9e1
2024-04-12Payload selection change UI improvements. Andrey Epin
The main idea is to postpone the new pager adapter (along with the list adapters) attachment to the view until the data is fully loaded thus minimizing the number of UI updates. The old adapter gets destroyed but kept attached to the view and the destroyed status of the list adapters is used to derived the appropriate UI state (make target views disabled). Profile tab switchng is disabled for an active (executing or pending) selection callback. This is due to synchronization challenges between the old (attached) and the new (detached) pager adapters, and difficulty of tracking loading state for multiple adapters in the legacy code. Known issues: * profile buttons does not have a disabled state; * profile buttons use drawable with a fade-in animation that causes a flashing effect; * target icons are animated in that causes a flashing effect; * UI is not disabled when launched into an active selection callback (i.e. when re-created on rotation); * there are some visual artifacts when navigating between tabs after a selection change has been changed. Bug: 325465291 Test: atest IntentResolver-tests-unit Test: atest IntentResolver-tests-activity Test: manual testing with ShatTest app Change-Id: Ic9caa7c229b5ec0547be43974fa0c3536ecde095
2024-04-11Merge "Add horizontal margins for shareousel actions." into main Matt Casey
2024-04-11Merge "Shareousel layout fixes for empty action row." into main Matt Casey
2024-04-11Add horizontal margins for shareousel actions. Matt Casey
Bug: 328790561 Test: Visual verification with ShareTest Flag: ACONFIG android.service.chooser.chooser_payload_toggling NEXTFOOD Change-Id: I758d3c99440eb0abd22aae45dd9b496543199a48
2024-04-11Shareousel layout fixes for empty action row. Matt Casey
Only show action row if it's non-empty. Move margin to only be added if there are actions. Bug: 328793346 Test: Visual verification with ShareTest Flag: ACONFIG android.service.chooser.chooser_payload_toggling NEXTFOOD Change-Id: I24464717f3a3f16e59348985ce3640d11c7e9853
2024-04-10Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: Ice00148d98dca75fa571e9505b0b2b20562186e7
2024-04-10Merge "Fix import order to finally agree with checkstyle and IDE rules" into ↵ Mark Renouf
main
2024-04-09Fix import order to finally agree with checkstyle and IDE rules Mark Renouf
[automated cleanup] $ find . -name "*.java" | xargs google-java-format --aosp --fix-imports-only --replace Bug: 333533940 Test: N/A Flag: None Change-Id: I6a3ebe44c43d80529c046916afbe71e5f148c543
2024-04-09Merge "Increase max text line height to 8 in portrait, 3 landscape" into main Matt Casey
2024-04-09Merge "Increase image preview height" into main Matt Casey
2024-04-08Increase max text line height to 8 in portrait, 3 landscape Matt Casey
Per PM/UX feedback. Bug: 333108781 Test: Manual verification with ShareTest. Flag: NONE Change-Id: I53dea71242c4b689819c65608174a836dca102f5
2024-04-08Increase image preview height Matt Casey
Per UX feedback. Bug: 333109123 Test: Manual testing with sharetest Flag: NONE Change-Id: I5e9abf758ab055e8ed491a1d0ccb0a5656000c4b
2024-04-04Add missing copyright headers Mark Renouf
Bug: NA Test: NA Change-Id: I1732d13e27fdceddea550f53ea160149bbc04044
2024-04-04Collapse v2 fork Mark Renouf
This is an internal merge of v2.* code back into a single set of code. The ChooserSelector mechanism is removed and usage of the 'modular_framework' AConfig flag is also removed. Test: atest --test-mapping packages/modules/IntentResolver Bug: NA Flag: None Change-Id: I8bb34613e5a042cfbcd8fe2654b8121560a47b03
2024-04-04ResolverActivity Profile integration Mark Renouf
* connects ResolverActivity with UserInteractor * replaces all existing references as the source of UserHandles * app continues to explicity use the same profile types as previous * updates Activity tests to use FakeUserRepository * removes ResolverWorkProfilePausedEmptyStateProvider * removes ResolverNoCrossProfileEmptyStateProvider * removes ActivityLogic * removes ResolverActivityLogic * removes TestResolverActivityLogic Bug: 300157408 Bug: 311348033 Test: atest IntentResolver-tests-activity:com.android.intentresolver.v2 Change-Id: Ia4a8bf458ebad12af06b1c6c1f0d8586be452d43
2024-04-03Switch UserRepository to started = WhileSubscribed Mark Renouf
Changes the StateFlow serving User info to remain active only `WhileSubscribed`, with a timeout to minimize repeated restarts while ensuring the flow is cancelled before the being frozen. Background: IntentResolver does not have a persistent background process. Leaving a hot flow started while in the background does not operate as expected. Once the process is frozen, several seconds after moving to the cached process state, no threads execute. The flow does not cancel or restart, broadcast receivers are not removed and sent broadcasts sent are queued and processed at once when execution resumes. Test: atest IntentResolver-tests-activity Bug: 330561320 Flag: ACONFIG intentresolver/com.android.intentresolver.enable_private_profile Change-Id: I1ebc8405807788e72da887829f9c43663bf10446
2024-04-03Simplify startup and Profile flow handling Mark Renouf
Instead of blocking to collect a set of intermediate values in ChooserHelper, simply allow the @JavaInterop classes to do this work instead. This greatly simplifies the startup code run from onCreate but does not affect latency, as the flows are still collected within the same call stack (onCreate) when needed. This change also removes an unneccesary intermediate StateFlow from ProfileAvailability. The flow was only used internally to collect the current value. Since ProfileAvailability is a @JavaInterop class (bridging blocking/suspending code), used from the Main thread only, we can simplify to `runBlocking { flow.first() }` where an immediate value is needed. Bug: 330561320 Test: atest IntentResolver-tests-activity Flag: ACONFIG intentresolver/com.android.intentresolver.enable_private_profile Change-Id: I88c5a96a57db32bb5eee90f5d94e1d56b224aa63
2024-04-02Add @Broadcast Handler, broadcastFlow() -> BroadcastSubscriber Mark Renouf
Provides a background handler (thread) for Broadcast delivery. Currently, broadcasts are flowed on a @Background CoroutineDispatcher but before that, they are delivered to the app via the Main thread Handler. This means broadcasts being processed during startup will get deferred until Main thread idle (generally, right after onResume) This change improves on broadcastFlow, providing a broadcast flow factory (BroadcastSubscriber), which registers Receivers with a singleton @Broadcast Handler. This makes broadcast delivery much more reliable and predictable. Test: manually. Observe broadcasts received while the process is frozen are now handled immediately after the unfreeze, and no longer blocked until after onResume. Bug: 330561320 Flag: ACONFIG intentresolver/com.android.intentresolver.enable_private_profile Change-Id: I8ecf151d3bf7627d9e3917fb9fecd78c1e201521
2024-04-01Import translations. DO NOT MERGE ANYWHERE Bill Yi
Auto-generated-cl: translation import Change-Id: I0f7790606919cc7154dd96b12008083089b5771b
2024-03-29Merge "Import translations. DO NOT MERGE ANYWHERE" into main Treehugger Robot