summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-13.0.0_r52' of ↵George Zacharia2023-08-021-3/+6
|\ | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into t13.0 Android 13.0.0 Release 52 (TQ3A.230605.012) Change-Id: Ic80f318636f1f70bbd009504352ddde511d0dead
| * Remove extra mCropView.setExtraPaddingMatt Casey2023-03-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The extra padding is set (correctly) two lines above, then the wrong value was put in. Repro steps: - Take a long screenshot where the height of the content is less than the height of the screen (I used split screen to make this easier) - Observe whether the crop UI properly aligns to the image (see bug). Fix originally from Sony: https://android-review.git.corp.google.com/c/platform/frameworks/base/+/2401040 Bug: 266728115 Test: Manual steps described above. Change-Id: I87c800dbb9fbfd7d15b220dea925aa7b3d4744c8
| * Fetch context URL from the top-most app, send with share if available.Matt Casey2023-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add contextUrl to ScreenshotData. - Fork AssistContentRequester from launcher, adapt slightly for sysui dagger. - Request the assist content (async) if the task ID is available. - Set the URL as EXTRA_TEXT if available. Don't set the subject in the share if we have EXTRA_TEXT, as they seem to conflict with each other in some apps. - Slight refactor in ActionIntentCreator to make the various ways to create share intents clearer. Flag: All code changes (beyond variable existence) are protected by the SCREENSHOT_METADATA flag, currently disabled. The work profile screenshots flag is also required for this to work properly (in teamfood). Bug: 242791070 Test: atest com.android.systemui.screenshot Test: Verify that context URL from chrome passes all the way through when sharing with Gmail. Merged-In: I39c3503147631f4ef79088f23c201bbad7405d16 Change-Id: I39c3503147631f4ef79088f23c201bbad7405d16
| * [DO NOT MERGE] Replace UserHandle.CURRENT with UserTrackerAlex Stetson2023-01-171-2/+5
| | | | | | | | | | | | Bug: 249831072 Test: atest SystemUITests Change-Id: Id98ed38495feaab4780452ded14fe24b68ae6944
* | Merge tag 'android-13.0.0_r35' of ↵George Zacharia2023-04-031-27/+59
|\| | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into t13.0 Android 13.0.0 release 35 Change-Id: I709958b2f015d1774b2ece25894467c3a279f93c
| * Fix long screenshots actions for work profile.Matt Casey2022-11-071-29/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the ActionIntentExecutor for edit/share there as well. Logic changes are flagged (everything outside of that is just parameter passing). Shared element transition from work profile long screenshots -> markup wasn't working, so I've omitted it for now. Bug: 231957192 Test: Manual testing with and without the flag, work and personal profile long screenshots. Change-Id: I6d035bfd1838900f8004dbb5bc8f9ae5411e960d
| * Work profile screenshots: save to ownerMark Renouf2022-10-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a work profile screenshot is taken, propagate the owner UserHandle through to the Image export step. This change will write the image to the correct user profile and generate a URI with the userId embedded within using the form: content://10@media/external/images/media/000001.png Since URIs are user-specific, but not unique among users the userId prefix will carry this information through to downstream consumers. The ID can easily be retrieved from the URI using: int userId = ContentProvider.getUserIdFromUri(uri) If there is no userId within the URI, the return value will be the same as Process.myUserHandle(), the user of the current process. Because of this, an explicit UserHandle may not be needed if this information is conveyed entirely within the URI (it is included in this CL as-is). All behavior changes arising from these changes are currently gated on the SysUi flags: SCREENSHOT_REQUEST_PROCESSOR SCREENSHOT_WORK_PROFILE_POLICY This change does not include support for long screenshots nor fixes for screenshot actions (share, edit, etc). Bug: 159422805 Test: atest ImageExporterTest Change-Id: I641544f6a1b4685c743e7983d0af156e32796f56
* | SystemUI: screenshot: disable magnification for partial screenshotsCosmin Tanislav2022-10-181-0/+9
| | | | | | | | | | | | | | Partial screenshots are screen-size and don't need a magnifying glass. Change-Id: I472103352411d1482423230a4ff08ddda45cc53d (cherry picked from commit 92abcecfe2bd5a84a601a5eafd3ddf75c3968d38)
* | Screenshot: Append app name to filenameezio842022-10-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Author: ezio84 <brabus84@gmail.com> Date: Tue Dec 19 14:37:35 2017 +0100 Screenshot: append app name to filename Kang Samsung's idea. Change-Id: Ibc6a52b5e2597e6014a2da6a4211febe17ec02c7 Author: Wang Han <wanghan1995315@gmail.com> Date: Fri May 11 12:47:40 2018 +0200 SystemUI: Don't append app name to file on lockscreen When device is locked, current implementation will append the current app name to file when taking screenshot. This causes information leaks. To prevent this, we check for isKeyGuardLocked() and fall back not to append the app name when taking screenshot on lockscreen. Change-Id: I04498faf51986e1a3723a32befd97d29e1f3fe58 Author: DroidFreak32 <rushabshah32@gmail.com> Date: Thu Oct 4 11:33:07 2018 +0530 Screenshot: Append app name after screenshot date. Change-Id: I2ee5d65006ff22dfa381aae50e5757b8e7596e91 Author: ezio84 <brabus84@gmail.com> Date: Sat Jun 16 16:57:19 2018 +0200 GlobalScreenshot: Fix screenshot not saved with some languages like Virgin Islands English when taking a screenshot of the Settings app Change-Id: Ic04f66f5813b9597c96835d15c74509c93530a5c Author: Han Wang <416810799@qq.com> Date: Mon May 25 11:18:01 2020 +0200 SystemUI: Do not convert application name to ISO-8859-15 * ISO-8859-15 does not handle CJK chars, so all of them are 'unknown' and empty eventually. Change-Id: I27c689f5d737190d381146e49c1989e998b4f623 Author: LuK1337 <priv.luk@gmail.com> Date: Mon Aug 24 17:52:39 2020 +0200 SystemUI: Use TaskStackChangeListener API for contextual screenshot package name * This should hopefully fix mislabeled screenshots. Change-Id: Ifde106c0e306a6700081e4d724c1cf0c06dd126c Change-Id: Ic2a42536bf763a0c6f7fb9ac4bbbe84f73723f91
* | SystemUI: screenshot: remove misplaced call to set crop view paddingCosmin Tanislav2022-10-181-1/+0
|/ | | | | | | | This call to setExtraPadding() discards the previously set padding, making the screenshot crop view be able to select over the borders of the image. Remove it. Change-Id: I6cc28c79c2d9f4958215bb5957be6c9b2eab1002
* Adds two UiEvent IDs for actions on long screenshotsMark Renouf2021-10-201-2/+7
| | | | | | | | | | | | | | | | After completing a long screenshot, and viewing the result: SCREENSHOT_LONG_SCREEHSHOT_SAVE - Logged when the "Save" button is tapped SCREENSHOT_LONG_SCREENSHOT_EXIT - Logged then the "Cancel" button is tapped Bug: 200295026 Test: manually, make statsd_testdrive && statsd_testdrive 90 Change-Id: Iba841287a31853685cfe2596f5a591b31c1166af
* Revert "Fix shared transition offsets in landscape"Miranda Kephart2021-09-291-8/+1
| | | | | | | | | | This reverts commit 455fa76194a15ac873df6e43857f99c5c080515e. Reason for revert: Obsolete now that the offset issue is fixed in the framework Bug:190757843 Change-Id: I47dedda772d4b62dbf134f9ea5cc9293b27cb277
* Adds additional UiEvent logs for LongScreenshotActivityMark Renouf2021-08-201-0/+5
| | | | | | | | Record activity start, saved state restoring and exit signal Bug: 195013652 Test: manual via local dump of logging events Change-Id: I48b938ec76a9f8b33de65fdc280c6f7632da7790
* Merge "Revert "Replace cancel button with a delete icon."" into sc-devTreeHugger Robot2021-07-121-15/+2
|\
| * Revert "Replace cancel button with a delete icon."Matt Casey2021-07-091-15/+2
| | | | | | | | | | | | | | | | | | | | This reverts commit 02afe9b974b810b8641e845245c5e3397d134bdd. Reason for revert: Delete flow needed polish and ran into some unresolved bugs. Bug: 191889955 Bug: 193246084 Change-Id: I1c1f4dd6d3e9cc0fd3d4642651f679618723404b
* | Merge "Don't try to load a long screenshot image more than once" into sc-devMatt Casey2021-07-091-0/+5
|\ \
| * | Don't try to load a long screenshot image more than onceMatt Casey2021-07-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the preview already has a drawable onStart, there's nothing else to do. Previously we'd always try to load an image onStart which would break if onStart wasn't caused by either an initial load or a state restoration. Bug: 193045988 Test: When cropping long screenshot, swipe up to overview, then return. Previously, the activity would disappear, now it continues undisturbed. Change-Id: Ief1f10ce621e7f25bf3acbcf04ad3b6c04a28577
* | | Quiet down long screenshots logcat outputMark Renouf2021-07-091-21/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, a long screen shot flow generates only the following log entries: D Screenshot: ScrollCapture: connected to window [com.example/.ExampleActivity] D Screenshot: onCaptureStarted D Screenshot: end() I Screenshot: Completed: LongScreenshot{w=1080, h=5339} Tags covered: LongScreenshotActivity Screenshot ScrollCaptureConnection ScrollCaptureInternal ScrollCaptureViewSupport ScrollCaptureController ViewRenderer Bug: 190399332 Test: observe logcat during long screenshot Change-Id: Ia2b018224897ad1ca153967ff9f60340a64f4815
* | Merge "Replace cancel button with a delete icon." into sc-devMatt Casey2021-07-071-2/+15
|\|
| * Replace cancel button with a delete icon.Matt Casey2021-07-021-2/+15
| | | | | | | | | | | | | | | | | | Delete removes the *original* screenshot and then closes the activity. Bug: 191889955 Test: Take a screenshot, capture more, delete.. verify original image is gone. Change-Id: I2ac44c11dbf6228fa777c9d6d19bc4c481f87eac
* | Merge "Fix shared transition offsets in landscape" into sc-devMiranda Kephart2021-07-021-1/+8
|\ \ | |/ |/|
| * Fix shared transition offsets in landscapeMiranda Kephart2021-07-021-1/+8
| | | | | | | | | | | | Bug: 190757843 Test: manual Change-Id: I9c4d441ffbc455cf609936d96621322dd4a2d4ee
* | Add cancel button to long screenshot UIMatt Casey2021-06-291-0/+2
| | | | | | | | | | | | | | Bug: 191889955 Test: Do long screenshot, ensure nothing is saved when cancel is pressed. Change-Id: Iae75a9ad65b1a4c43e9d7b855a5aa7850681a4d0
* | Small fixes to screenshot->long screenshot transitionMiranda Kephart2021-06-281-2/+0
|/ | | | | | | | | | | Hide the enterTransitionView so it doesn't conflict with the "shared transition" view. Also turn off activity animations so that the LongScreenshotActivity appears immediately instead of fading in from the previous app. Bug: 183197533 Test: manual Change-Id: I6fba0012c72201f23c644148dde73a35627ee761
* Always save long screenshot temp file to the same placeMatt Casey2021-06-231-2/+2
| | | | | | | | | | | If we fail to clean up the file, they won't accumulate over time. Bug: 191499234 Test: adb shell ls /data/user_de/0/com.android.systemui/cache/long_screenshot_cache* to view files Test: Verify state restoration still works Test: Verify temp file disappears when activity is done. Test: Verify that temp file is overwritten when a new session begins. Change-Id: Ie15065ef9ff3db91852df1a0dc96afd494e85b8c
* Implement "shared element" SS->LSS transition in screenshotsMiranda Kephart2021-06-171-23/+17
| | | | | | | | | | | | Workaround for b/190806800; in order to get the transition from screenshots to the long screenshots activity to look the way we want, we fake the shared element transition by determining the destination for the preview in long screenshots, sending that back, and running the actual animation in screenshots. Bug: 183197533 Test: manual; visual verification in portrait and landscape Change-Id: I16d462789ec0fa9422cc1924e6df9649b89b9055
* Merge "Updated animation for long screenshot crop entrance." into sc-devMatt Casey2021-06-161-3/+4
|\
| * Updated animation for long screenshot crop entrance.Matt Casey2021-06-151-3/+4
| | | | | | | | | | | | | | | | | | | | Make the image expand out from the initial crop bounds, fade in crop handles. Bug: 183197533 Test: Invoke long screenshot, observe transition. Change-Id: I34b5171415b3a748eabad95ec4dc59c198220567
* | Fix LongScreenshotActivity rotationMatt Casey2021-06-161-14/+17
|/ | | | | | | | | | | - Always set image preview alpha. - Don't set the enter transition position if the screenshot isn't loaded. Bug: 191179430 Test: Rotate LongScreenshotActivity, observe no crashes and images show up. Change-Id: I1d8b84d6a23c7b9e5a011b48834d53bbb67819fd
* Screenshot to long screenshot shared transitionMiranda Kephart2021-06-091-7/+58
| | | | | | | Test: manual Bug: 183197533 Change-Id: I4bad5ba3db6d3808584bc1cccb5e3319789ff706
* Implement transition long screenshots->markupMiranda Kephart2021-05-101-31/+16
| | | | | | Bug: 183197012 Test: manual Change-Id: Ib05daf48970007ab3ab4df3253bbec937c02e69c
* Merge "Add transition between LongScreenshotActivity and editor" into sc-devMatt Casey2021-04-171-8/+62
|\
| * Add transition between LongScreenshotActivity and editorMatt Casey2021-04-151-8/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | Turned off by default. Add an ImageView for the shared element transition, position it based upon the crop bounds. Finish the activity if the activity stops and a transition has begun. Bug: 183197895 Test: Visual observation of transition Change-Id: I4286622c39f74ea2a0d6de71423fc58599e3d2db
* | Move scroll capture back to ScreenshotController.Matt Casey2021-04-161-44/+13
| | | | | | | | | | | | | | | | | | Makes timing more flexible for acquisition, allowing for delayed content loading. Bug: 173700533 Test: Verify scroll content still loads with longer timeouts Change-Id: I1cab53a6bda671854fb24203063c780923e34572
* | Hide CropView until the image is ready.Matt Casey2021-04-121-0/+2
|/ | | | | | | Test: Verify crop view shows up at the right time with a fresh long screenshot or reloading saved state Bug: 185115974 Change-Id: I18705e6a8c4a762abf30e2db22bc54d9a5db12aa
* Add extra padding to long screenshot cropMatt Casey2021-04-011-6/+9
| | | | | | | | | | Modify padding code to account for this handling properly. Test: Test on full width and full height images, ensure touch area expanded into padding, handles visible at edges. Bug: 183278748 Change-Id: I083527467940206286ec485f92e56f0c19327219
* Merge "Move image cleanup operations to onStop" into sc-devMatt Casey2021-03-231-7/+7
|\
| * Move image cleanup operations to onStopMatt Casey2021-03-201-7/+7
| | | | | | | | | | | | | | | | The Activity may still be visible onPause. Bug: 183277963 Test: Validate cleanup via logs, ensure image doesn't disappear Change-Id: I8976293c9c0e070d6bc08e08d177765311201cb8
* | Merge "Fix CropView sizing on full-width images" into sc-devMatt Casey2021-03-221-2/+4
|\ \
| * | Fix CropView sizing on full-width imagesMatt Casey2021-03-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Full width images happen when the long screenshot isn't particularly long, typically an error case. - Ensure that ImageView and CropView take up the whole space defined by constraints. - Set padding on ImageView, factor that padding into the image size computation for CropView. Bug: 183278746 Test: Validate correct crop bounds display on a full height and a full width long screenshot. Change-Id: I0f71ddc051f8cf6d295a348fe3cae3cbe00e4077
* | | Merge "Update long screenshot crop per mocks" into sc-devMatt Casey2021-03-221-7/+8
|\| |
| * | Update long screenshot crop per mocksMatt Casey2021-03-201-7/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Can crop on both axes (for alignment with markup) - Updated handle drawing - Vertical dragging is functionally the same, but horizontal dragging is allowed if vertical hasn't triggered (intentionally giving priority to vertical since that's the important function here). - Lots of refactoring in CropView to allow for this without filling it with switch statements. - Only showing magnifier for vertical cropping (for now). - Scrim the long screenshot image but nothing beyond that. - Lessen scrim opacity Bug: 180967468 Test: Manual testing Change-Id: I85593414ab5aca12b365da34529d2033226b1cfb
* / Layout and style updates for LongScreenshotActivityMatt Casey2021-03-191-6/+0
|/ | | | | | | | | | | - Give save button accent color. - Remove cancel button (may come back in another form later) - Share button becomes and icon on the right. - Edit button moves to the bottom, gets icon + text Bug: 180967468 Test: Visual eval with light and dark themes Change-Id: I19ccea06e7dbec47b26ffd0684ebb7e31bdfe8b4
* Properly handle empty response rect in ScrollCaptureControllerMatt Casey2021-03-171-4/+2
| | | | | | | | | Add tests for ScrollCaptureController for this bug and other typical flows. Bug: 182926096 Test: atest ScrollCaptureControllerTest Change-Id: Ica2104c7c98b99b9322a6efe6bbc5b33c01d8b86
* Splits up internal binder api for scroll captureMark Renouf2021-03-161-155/+228
| | | | | | | | | | | | | | | Splits the connection callback out from the session callbacks. Use ListenableFuture at the ScrollCaptureClient layer to safely chain together futures, provide a better exception handling/reporting path, and allow for cancellation of background tasks. Bug: 180671218 Test: atest ScrollCaptureClientTest ScrollCaptureConnectionTest Test: atest ScrollCaptureFrameworkSmokeTest Change-Id: Ibc8536d12a5554f62b3d7e1f4f717d3589ec45e0
* Set initial crop handles to original page locationMatt Casey2021-03-081-2/+10
| | | | | | | | | | | Treat the image tile set's 0 coordinate as the top and use pageSize to compute the bottom of the original screenshot. Bug: 179907401 Test: Verify potisitioning when scrolling from the top, bottom and middle. Change-Id: I44fca11474221b5d4249483bf22a88ede5e8104e
* Make CropView handle images that aren't full-heightMatt Casey2021-03-011-0/+25
| | | | | | | | | | | | | | | Compute the ImageView's extra top and bottom padding when it gets a drawable or does layout, pass that information to CropView to adjust its boundaries accordingly. Also give MagnifierView some elevation so it doesn't get obscured by the buttons. Bug: 180967209 Test: Take a long screenshot at the top of the settings app, observe that the image isn't full height, ensure that crop handles properly honor image bounds and those bounds are honored on export as well. Change-Id: Iac859995b362724a0db00b666a6ff970a0ccba1d
* Image state restoration for LongScreenshotActivityMatt Casey2021-03-011-39/+158
| | | | | | | | | | | | | | | | - When long screenshot is acquired, save image to a temporary file. - When restoring state, read in that bitmap. - Moved bitmap export code from ScrollCaptureController to LongScreenshotActivity because it needs to be able to export any drawable regardless of source. - Currently deleting the temporary file onDestroy. Bug: 181087631 Test: Enable "don't keep activities" debug setting. Take long screenshot, go to overview and return. Rotate UI. Verify that image restores along with crop bounds and export still works properly. Change-Id: I892ad78025c818c8c65d16f2844daa955cc0b005
* Follow-on fixes for long screenshot activityMatt Casey2021-02-221-14/+23
| | | | | | | | | | | | | | | | - Add takeScrollCaptureConnection() instead of accessing the static var directly. - Re-enable action buttons in the activity after export completes (fixes the flow where you go to share and then back out). - Fix share intent to properly used EXTRA_STREAM. Bug: 180756221 Bug: 180755704 Test: Take long screenshot, share and return to long screenshot activity, verify buttons still work. Share output to printer target, verify that content arrives properly. Change-Id: I1a0b20df50e7a7b6415d623920b84b07cddb0c80
* Move long screenshot UI to an ActivityMatt Casey2021-02-181-0/+201
Separate UI code from image acquisition. Using a static variable to get scroll capture connection from the Activity, can do something more elegant later. Doesn't do full activity restoration yet. Bug: 179906912 Test: Running through long screenshot flow, turning screen on/off, returning to task. Change-Id: If5715c7008bbf3a1c8918a202a733fb3f8e8f876