Loading core/java/android/app/ActivityManager.java +16 −5 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.graphics.Matrix; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Icon; import android.hardware.HardwareBuffer; import android.os.BatteryStats; import android.os.Binder; import android.os.Build; Loading Loading @@ -2006,7 +2007,7 @@ public class ActivityManager { private final long mId; // Top activity in task when snapshot was taken private final ComponentName mTopActivityComponent; private final GraphicBuffer mSnapshot; private final HardwareBuffer mSnapshot; /** Indicates whether task was in landscape or portrait */ @Configuration.Orientation private final int mOrientation; Loading @@ -2029,7 +2030,7 @@ public class ActivityManager { private final ColorSpace mColorSpace; public TaskSnapshot(long id, @NonNull ComponentName topActivityComponent, GraphicBuffer snapshot, @NonNull ComponentName topActivityComponent, HardwareBuffer snapshot, @NonNull ColorSpace colorSpace, int orientation, int rotation, Point taskSize, Rect contentInsets, boolean isLowResolution, boolean isRealSnapshot, int windowingMode, int systemUiVisibility, boolean isTranslucent) { Loading Loading @@ -2084,14 +2085,24 @@ public class ActivityManager { /** * @return The graphic buffer representing the screenshot. * * Note: Prefer {@link #getHardwareBuffer}, which returns the internal object. This version * creates a new object. */ @UnsupportedAppUsage public GraphicBuffer getSnapshot() { return GraphicBuffer.createFromHardwareBuffer(mSnapshot); } /** * @return The hardware buffer representing the screenshot. */ public HardwareBuffer getHardwareBuffer() { return mSnapshot; } /** * @return The color space of graphic buffer representing the screenshot. * @return The color space of hardware buffer representing the screenshot. */ public ColorSpace getColorSpace() { return mColorSpace; Loading Loading @@ -2224,7 +2235,7 @@ public class ActivityManager { public static final class Builder { private long mId; private ComponentName mTopActivity; private GraphicBuffer mSnapshot; private HardwareBuffer mSnapshot; private ColorSpace mColorSpace; private int mOrientation; private int mRotation; Loading @@ -2246,7 +2257,7 @@ public class ActivityManager { return this; } public Builder setSnapshot(GraphicBuffer buffer) { public Builder setSnapshot(HardwareBuffer buffer) { mSnapshot = buffer; return this; } Loading core/java/android/app/TaskStackListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -155,9 +155,9 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { @UnsupportedAppUsage public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) throws RemoteException { if (Binder.getCallingPid() != android.os.Process.myPid() && snapshot != null && snapshot.getSnapshot() != null) { && snapshot != null && snapshot.getHardwareBuffer() != null) { // Preemptively clear any reference to the buffer snapshot.getSnapshot().destroy(); snapshot.getHardwareBuffer().close(); } } Loading core/java/android/hardware/display/DisplayManagerInternal.java +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public abstract class DisplayManagerInternal { * @param displayId The display id to take the screenshot of. * @return The buffer or null if we have failed. */ public abstract SurfaceControl.ScreenshotGraphicBuffer screenshot(int displayId); public abstract SurfaceControl.ScreenshotHardwareBuffer screenshot(int displayId); /** * Returns information about the specified logical display. Loading core/java/android/service/contentsuggestions/ContentSuggestionsService.java +2 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ import android.app.contentsuggestions.SelectionsRequest; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.ColorSpace; import android.graphics.GraphicBuffer; import android.hardware.HardwareBuffer; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading Loading @@ -62,7 +62,7 @@ public abstract class ContentSuggestionsService extends Service { private final IContentSuggestionsService mInterface = new IContentSuggestionsService.Stub() { @Override public void provideContextImage(int taskId, GraphicBuffer contextImage, public void provideContextImage(int taskId, HardwareBuffer contextImage, int colorSpaceId, Bundle imageContextRequestExtras) { if (imageContextRequestExtras.containsKey(ContentSuggestionsManager.EXTRA_BITMAP) && contextImage != null) { Loading core/java/android/service/contentsuggestions/IContentSuggestionsService.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ import android.app.contentsuggestions.IClassificationsCallback; import android.app.contentsuggestions.ISelectionsCallback; import android.app.contentsuggestions.ClassificationsRequest; import android.app.contentsuggestions.SelectionsRequest; import android.graphics.GraphicBuffer; import android.hardware.HardwareBuffer; import android.os.Bundle; /** Loading @@ -31,7 +31,7 @@ import android.os.Bundle; oneway interface IContentSuggestionsService { void provideContextImage( int taskId, in GraphicBuffer contextImage, in HardwareBuffer contextImage, int colorSpaceId, in Bundle imageContextRequestExtras); void suggestContentSelections( Loading Loading
core/java/android/app/ActivityManager.java +16 −5 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import android.graphics.Matrix; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Icon; import android.hardware.HardwareBuffer; import android.os.BatteryStats; import android.os.Binder; import android.os.Build; Loading Loading @@ -2006,7 +2007,7 @@ public class ActivityManager { private final long mId; // Top activity in task when snapshot was taken private final ComponentName mTopActivityComponent; private final GraphicBuffer mSnapshot; private final HardwareBuffer mSnapshot; /** Indicates whether task was in landscape or portrait */ @Configuration.Orientation private final int mOrientation; Loading @@ -2029,7 +2030,7 @@ public class ActivityManager { private final ColorSpace mColorSpace; public TaskSnapshot(long id, @NonNull ComponentName topActivityComponent, GraphicBuffer snapshot, @NonNull ComponentName topActivityComponent, HardwareBuffer snapshot, @NonNull ColorSpace colorSpace, int orientation, int rotation, Point taskSize, Rect contentInsets, boolean isLowResolution, boolean isRealSnapshot, int windowingMode, int systemUiVisibility, boolean isTranslucent) { Loading Loading @@ -2084,14 +2085,24 @@ public class ActivityManager { /** * @return The graphic buffer representing the screenshot. * * Note: Prefer {@link #getHardwareBuffer}, which returns the internal object. This version * creates a new object. */ @UnsupportedAppUsage public GraphicBuffer getSnapshot() { return GraphicBuffer.createFromHardwareBuffer(mSnapshot); } /** * @return The hardware buffer representing the screenshot. */ public HardwareBuffer getHardwareBuffer() { return mSnapshot; } /** * @return The color space of graphic buffer representing the screenshot. * @return The color space of hardware buffer representing the screenshot. */ public ColorSpace getColorSpace() { return mColorSpace; Loading Loading @@ -2224,7 +2235,7 @@ public class ActivityManager { public static final class Builder { private long mId; private ComponentName mTopActivity; private GraphicBuffer mSnapshot; private HardwareBuffer mSnapshot; private ColorSpace mColorSpace; private int mOrientation; private int mRotation; Loading @@ -2246,7 +2257,7 @@ public class ActivityManager { return this; } public Builder setSnapshot(GraphicBuffer buffer) { public Builder setSnapshot(HardwareBuffer buffer) { mSnapshot = buffer; return this; } Loading
core/java/android/app/TaskStackListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -155,9 +155,9 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { @UnsupportedAppUsage public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) throws RemoteException { if (Binder.getCallingPid() != android.os.Process.myPid() && snapshot != null && snapshot.getSnapshot() != null) { && snapshot != null && snapshot.getHardwareBuffer() != null) { // Preemptively clear any reference to the buffer snapshot.getSnapshot().destroy(); snapshot.getHardwareBuffer().close(); } } Loading
core/java/android/hardware/display/DisplayManagerInternal.java +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public abstract class DisplayManagerInternal { * @param displayId The display id to take the screenshot of. * @return The buffer or null if we have failed. */ public abstract SurfaceControl.ScreenshotGraphicBuffer screenshot(int displayId); public abstract SurfaceControl.ScreenshotHardwareBuffer screenshot(int displayId); /** * Returns information about the specified logical display. Loading
core/java/android/service/contentsuggestions/ContentSuggestionsService.java +2 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ import android.app.contentsuggestions.SelectionsRequest; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.ColorSpace; import android.graphics.GraphicBuffer; import android.hardware.HardwareBuffer; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading Loading @@ -62,7 +62,7 @@ public abstract class ContentSuggestionsService extends Service { private final IContentSuggestionsService mInterface = new IContentSuggestionsService.Stub() { @Override public void provideContextImage(int taskId, GraphicBuffer contextImage, public void provideContextImage(int taskId, HardwareBuffer contextImage, int colorSpaceId, Bundle imageContextRequestExtras) { if (imageContextRequestExtras.containsKey(ContentSuggestionsManager.EXTRA_BITMAP) && contextImage != null) { Loading
core/java/android/service/contentsuggestions/IContentSuggestionsService.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ import android.app.contentsuggestions.IClassificationsCallback; import android.app.contentsuggestions.ISelectionsCallback; import android.app.contentsuggestions.ClassificationsRequest; import android.app.contentsuggestions.SelectionsRequest; import android.graphics.GraphicBuffer; import android.hardware.HardwareBuffer; import android.os.Bundle; /** Loading @@ -31,7 +31,7 @@ import android.os.Bundle; oneway interface IContentSuggestionsService { void provideContextImage( int taskId, in GraphicBuffer contextImage, in HardwareBuffer contextImage, int colorSpaceId, in Bundle imageContextRequestExtras); void suggestContentSelections( Loading