Loading cmds/screencap/screencap.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ usage: %s [-ahp] [-d display-id] [FILENAME] -d: specify the display ID to capture%s see "dumpsys SurfaceFlinger --display-id" for valid display IDs. -p: outputs in png format. --hint-for-seamless If set will use the hintForSeamless path in SF --preserve-display-colors: Set to true to preserves the native display colorspace. Useful for mixed HDR + SDR content, using identical processing as the display's If FILENAME ends with .png it will be saved as a png. If FILENAME is not given, the results will be printed to stdout. Loading @@ -77,15 +78,15 @@ If FILENAME is not given, the results will be printed to stdout. namespace LongOpts { enum { Reserved = 255, HintForSeamless, PreservedDisplayColors, }; } static const struct option LONG_OPTIONS[] = {{"png", no_argument, nullptr, 'p'}, {"jpeg", no_argument, nullptr, 'j'}, {"help", no_argument, nullptr, 'h'}, {"hint-for-seamless", no_argument, nullptr, LongOpts::HintForSeamless}, {"preserve-display-colors", no_argument, nullptr, LongOpts::PreservedDisplayColors}, {0, 0, 0, 0}}; static int32_t flinger2bitmapFormat(aidl::android::hardware::graphics::common::PixelFormat f) { Loading Loading @@ -330,8 +331,8 @@ int main(int argc, char** argv) { } usage(pname, displayIdOpt); return 1; case LongOpts::HintForSeamless: captureArgs.hintForSeamlessTransition = true; case LongOpts::PreservedDisplayColors: captureArgs.preserveDisplayColors = true; break; } } Loading core/java/android/hardware/display/DisplayManagerInternal.java +17 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,23 @@ public abstract class DisplayManagerInternal { */ public abstract ScreenCaptureInternal.ScreenshotHardwareBuffer systemScreenshot(int displayId); /** * Captures a screenshot of the specified display for internal system use. * * <p>This method allows for more granular control over the screenshot process * compared to {@link #systemScreenshot(int)}. * * @param displayId The display id to take the screenshot of. * @param argsBuilder A {@link ScreenCaptureInternal.DisplayCaptureArgs.Builder} * to specify screenshot parameters. * @param callback A {@link ScreenCaptureInternal.ScreenCaptureListener} to receive * the screenshot result or an error. */ public abstract void systemScreenshot( int displayId, ScreenCaptureInternal.DisplayCaptureArgs.Builder argsBuilder, ScreenCaptureInternal.ScreenCaptureListener callback); /** * General screenshot functionality that excludes secure layers and applies appropriate rotation * that the device is currently in. Loading core/java/android/view/IWindowManager.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -72,11 +72,13 @@ import android.view.displayhash.VerifiedDisplayHash; import android.window.AddToSurfaceSyncGroupResult; import android.window.ConfigurationChangeSetting; import android.window.IGlobalDragListener; import android.window.IScreenCaptureCallback; import android.window.IScreenRecordingCallback; import android.window.ISurfaceSyncGroupCompletedListener; import android.window.ITaskFpsCallback; import android.window.ITrustedPresentationListener; import android.window.InputTransferToken; import android.window.ScreenCapture; import android.window.ScreenCaptureInternal; import android.window.TrustedPresentationThresholds; import android.window.WindowContextInfo; Loading Loading @@ -1118,6 +1120,12 @@ interface IWindowManager oneway void captureDisplay(int displayId, in @nullable ScreenCaptureInternal.CaptureArgs captureArgs, in ScreenCaptureInternal.ScreenCaptureListener listener); /** * Implements the ScreenCapture system API. */ oneway void screenCapture(in ScreenCapture.ScreenCaptureParams params, in IScreenCaptureCallback callback); /** * Returns {@code true} if the key will be handled globally and not forwarded to all apps. * Loading core/java/android/window/IScreenCaptureCallback.aidl 0 → 100644 +11 −0 Original line number Diff line number Diff line package android.window; import android.window.ScreenCapture; /** * {@hide} */ interface IScreenCaptureCallback { oneway void onSuccess(in ScreenCapture.ScreenCaptureResult result); oneway void onFailure(int errorCode); } core/java/android/window/ScreenCapture.aidl 0 → 100644 +5 −0 Original line number Diff line number Diff line package android.window; parcelable ScreenCapture.ScreenCaptureParams; parcelable ScreenCapture.ScreenCaptureResult; Loading
cmds/screencap/screencap.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ usage: %s [-ahp] [-d display-id] [FILENAME] -d: specify the display ID to capture%s see "dumpsys SurfaceFlinger --display-id" for valid display IDs. -p: outputs in png format. --hint-for-seamless If set will use the hintForSeamless path in SF --preserve-display-colors: Set to true to preserves the native display colorspace. Useful for mixed HDR + SDR content, using identical processing as the display's If FILENAME ends with .png it will be saved as a png. If FILENAME is not given, the results will be printed to stdout. Loading @@ -77,15 +78,15 @@ If FILENAME is not given, the results will be printed to stdout. namespace LongOpts { enum { Reserved = 255, HintForSeamless, PreservedDisplayColors, }; } static const struct option LONG_OPTIONS[] = {{"png", no_argument, nullptr, 'p'}, {"jpeg", no_argument, nullptr, 'j'}, {"help", no_argument, nullptr, 'h'}, {"hint-for-seamless", no_argument, nullptr, LongOpts::HintForSeamless}, {"preserve-display-colors", no_argument, nullptr, LongOpts::PreservedDisplayColors}, {0, 0, 0, 0}}; static int32_t flinger2bitmapFormat(aidl::android::hardware::graphics::common::PixelFormat f) { Loading Loading @@ -330,8 +331,8 @@ int main(int argc, char** argv) { } usage(pname, displayIdOpt); return 1; case LongOpts::HintForSeamless: captureArgs.hintForSeamlessTransition = true; case LongOpts::PreservedDisplayColors: captureArgs.preserveDisplayColors = true; break; } } Loading
core/java/android/hardware/display/DisplayManagerInternal.java +17 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,23 @@ public abstract class DisplayManagerInternal { */ public abstract ScreenCaptureInternal.ScreenshotHardwareBuffer systemScreenshot(int displayId); /** * Captures a screenshot of the specified display for internal system use. * * <p>This method allows for more granular control over the screenshot process * compared to {@link #systemScreenshot(int)}. * * @param displayId The display id to take the screenshot of. * @param argsBuilder A {@link ScreenCaptureInternal.DisplayCaptureArgs.Builder} * to specify screenshot parameters. * @param callback A {@link ScreenCaptureInternal.ScreenCaptureListener} to receive * the screenshot result or an error. */ public abstract void systemScreenshot( int displayId, ScreenCaptureInternal.DisplayCaptureArgs.Builder argsBuilder, ScreenCaptureInternal.ScreenCaptureListener callback); /** * General screenshot functionality that excludes secure layers and applies appropriate rotation * that the device is currently in. Loading
core/java/android/view/IWindowManager.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -72,11 +72,13 @@ import android.view.displayhash.VerifiedDisplayHash; import android.window.AddToSurfaceSyncGroupResult; import android.window.ConfigurationChangeSetting; import android.window.IGlobalDragListener; import android.window.IScreenCaptureCallback; import android.window.IScreenRecordingCallback; import android.window.ISurfaceSyncGroupCompletedListener; import android.window.ITaskFpsCallback; import android.window.ITrustedPresentationListener; import android.window.InputTransferToken; import android.window.ScreenCapture; import android.window.ScreenCaptureInternal; import android.window.TrustedPresentationThresholds; import android.window.WindowContextInfo; Loading Loading @@ -1118,6 +1120,12 @@ interface IWindowManager oneway void captureDisplay(int displayId, in @nullable ScreenCaptureInternal.CaptureArgs captureArgs, in ScreenCaptureInternal.ScreenCaptureListener listener); /** * Implements the ScreenCapture system API. */ oneway void screenCapture(in ScreenCapture.ScreenCaptureParams params, in IScreenCaptureCallback callback); /** * Returns {@code true} if the key will be handled globally and not forwarded to all apps. * Loading
core/java/android/window/IScreenCaptureCallback.aidl 0 → 100644 +11 −0 Original line number Diff line number Diff line package android.window; import android.window.ScreenCapture; /** * {@hide} */ interface IScreenCaptureCallback { oneway void onSuccess(in ScreenCapture.ScreenCaptureResult result); oneway void onFailure(int errorCode); }
core/java/android/window/ScreenCapture.aidl 0 → 100644 +5 −0 Original line number Diff line number Diff line package android.window; parcelable ScreenCapture.ScreenCaptureParams; parcelable ScreenCapture.ScreenCaptureResult;