diff options
| author | Mark Renouf <mrenouf@google.com> | 2019-12-18 21:34:52 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-12-18 21:34:52 +0000 |
| commit | 3095609f4e37ea737a81921af5e1d758d326fad4 (patch) | |
| tree | 8e18c53fe8e14b5f32fccdb436c925505e79b13f /core/java | |
| parent | 41ee2c2d20070a0c240dc2230b6c8bbddb8e9ada (diff) | |
| parent | 98ba8e690554917752cd010e2c15528ff5dbf3cb (diff) | |
Merge "Expose snapshotTask for use in WindowManager"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/ActivityManager.java | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 795f51ac5454..d74802c62f0f 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -2097,6 +2097,113 @@ public class ActivityManager { return new TaskSnapshot[size]; } }; + + /** Builder for a {@link TaskSnapshot} object */ + public static final class Builder { + private long mId; + private ComponentName mTopActivity; + private GraphicBuffer mSnapshot; + private ColorSpace mColorSpace; + private int mOrientation; + private Rect mContentInsets; + private boolean mReducedResolution; + private float mScaleFraction; + private boolean mIsRealSnapshot; + private int mWindowingMode; + private int mSystemUiVisibility; + private boolean mIsTranslucent; + private int mPixelFormat; + + public Builder setId(long id) { + mId = id; + return this; + } + + public Builder setTopActivityComponent(ComponentName name) { + mTopActivity = name; + return this; + } + + public Builder setSnapshot(GraphicBuffer buffer) { + mSnapshot = buffer; + return this; + } + + public Builder setColorSpace(ColorSpace colorSpace) { + mColorSpace = colorSpace; + return this; + } + + public Builder setOrientation(int orientation) { + mOrientation = orientation; + return this; + } + + public Builder setContentInsets(Rect contentInsets) { + mContentInsets = contentInsets; + return this; + } + + public Builder setReducedResolution(boolean reducedResolution) { + mReducedResolution = reducedResolution; + return this; + } + + public float getScaleFraction() { + return mScaleFraction; + } + + public Builder setScaleFraction(float scaleFraction) { + mScaleFraction = scaleFraction; + return this; + } + + public Builder setIsRealSnapshot(boolean realSnapshot) { + mIsRealSnapshot = realSnapshot; + return this; + } + + public Builder setWindowingMode(int windowingMode) { + mWindowingMode = windowingMode; + return this; + } + + public Builder setSystemUiVisibility(int systemUiVisibility) { + mSystemUiVisibility = systemUiVisibility; + return this; + } + + public Builder setIsTranslucent(boolean isTranslucent) { + mIsTranslucent = isTranslucent; + return this; + } + + public int getPixelFormat() { + return mPixelFormat; + } + + public Builder setPixelFormat(int pixelFormat) { + mPixelFormat = pixelFormat; + return this; + } + + public TaskSnapshot build() { + return new TaskSnapshot( + mId, + mTopActivity, + mSnapshot, + mColorSpace, + mOrientation, + mContentInsets, + mReducedResolution, + mScaleFraction, + mIsRealSnapshot, + mWindowingMode, + mSystemUiVisibility, + mIsTranslucent); + + } + } } /** @hide */ |
