Merge "Screenshot - pass bitmap as bundled hardware buffer from Launcher" into rvc-dev am: 4fdd3c8e34 am: 9db7e97167
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11711139 Change-Id: I0178a9ca9550a644bc10b33d674ad31d31b7d6ac
This commit is contained in:
@@ -8,10 +8,10 @@ import android.content.ComponentName;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Insets;
|
import android.graphics.Insets;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@@ -37,10 +37,12 @@ public class ScreenshotHelper {
|
|||||||
private int mSource;
|
private int mSource;
|
||||||
private boolean mHasStatusBar;
|
private boolean mHasStatusBar;
|
||||||
private boolean mHasNavBar;
|
private boolean mHasNavBar;
|
||||||
private Bitmap mBitmap;
|
private Bundle mBitmapBundle;
|
||||||
private Rect mBoundsInScreen;
|
private Rect mBoundsInScreen;
|
||||||
private Insets mInsets;
|
private Insets mInsets;
|
||||||
private int mTaskId;
|
private int mTaskId;
|
||||||
|
private int mUserId;
|
||||||
|
private ComponentName mTopComponent;
|
||||||
|
|
||||||
ScreenshotRequest(int source, boolean hasStatus, boolean hasNav) {
|
ScreenshotRequest(int source, boolean hasStatus, boolean hasNav) {
|
||||||
mSource = source;
|
mSource = source;
|
||||||
@@ -48,24 +50,29 @@ public class ScreenshotHelper {
|
|||||||
mHasNavBar = hasNav;
|
mHasNavBar = hasNav;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenshotRequest(
|
ScreenshotRequest(int source, Bundle bitmapBundle, Rect boundsInScreen, Insets insets,
|
||||||
int source, Bitmap bitmap, Rect boundsInScreen, Insets insets, int taskId) {
|
int taskId, int userId, ComponentName topComponent) {
|
||||||
mSource = source;
|
mSource = source;
|
||||||
mBitmap = bitmap;
|
mBitmapBundle = bitmapBundle;
|
||||||
mBoundsInScreen = boundsInScreen;
|
mBoundsInScreen = boundsInScreen;
|
||||||
mInsets = insets;
|
mInsets = insets;
|
||||||
mTaskId = taskId;
|
mTaskId = taskId;
|
||||||
|
mUserId = userId;
|
||||||
|
mTopComponent = topComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenshotRequest(Parcel in) {
|
ScreenshotRequest(Parcel in) {
|
||||||
mSource = in.readInt();
|
mSource = in.readInt();
|
||||||
mHasStatusBar = in.readBoolean();
|
mHasStatusBar = in.readBoolean();
|
||||||
mHasNavBar = in.readBoolean();
|
mHasNavBar = in.readBoolean();
|
||||||
|
|
||||||
if (in.readInt() == 1) {
|
if (in.readInt() == 1) {
|
||||||
mBitmap = in.readParcelable(Bitmap.class.getClassLoader());
|
mBitmapBundle = in.readBundle(getClass().getClassLoader());
|
||||||
mBoundsInScreen = in.readParcelable(Rect.class.getClassLoader());
|
mBoundsInScreen = in.readParcelable(Rect.class.getClassLoader());
|
||||||
mInsets = in.readParcelable(Insets.class.getClassLoader());
|
mInsets = in.readParcelable(Insets.class.getClassLoader());
|
||||||
mTaskId = in.readInt();
|
mTaskId = in.readInt();
|
||||||
|
mUserId = in.readInt();
|
||||||
|
mTopComponent = in.readParcelable(ComponentName.class.getClassLoader());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,8 +88,8 @@ public class ScreenshotHelper {
|
|||||||
return mHasNavBar;
|
return mHasNavBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap getBitmap() {
|
public Bundle getBitmapBundle() {
|
||||||
return mBitmap;
|
return mBitmapBundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rect getBoundsInScreen() {
|
public Rect getBoundsInScreen() {
|
||||||
@@ -97,6 +104,15 @@ public class ScreenshotHelper {
|
|||||||
return mTaskId;
|
return mTaskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getUserId() {
|
||||||
|
return mUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ComponentName getTopComponent() {
|
||||||
|
return mTopComponent;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -107,14 +123,16 @@ public class ScreenshotHelper {
|
|||||||
dest.writeInt(mSource);
|
dest.writeInt(mSource);
|
||||||
dest.writeBoolean(mHasStatusBar);
|
dest.writeBoolean(mHasStatusBar);
|
||||||
dest.writeBoolean(mHasNavBar);
|
dest.writeBoolean(mHasNavBar);
|
||||||
if (mBitmap == null) {
|
if (mBitmapBundle == null) {
|
||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
} else {
|
} else {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
dest.writeParcelable(mBitmap, 0);
|
dest.writeBundle(mBitmapBundle);
|
||||||
dest.writeParcelable(mBoundsInScreen, 0);
|
dest.writeParcelable(mBoundsInScreen, 0);
|
||||||
dest.writeParcelable(mInsets, 0);
|
dest.writeParcelable(mInsets, 0);
|
||||||
dest.writeInt(mTaskId);
|
dest.writeInt(mTaskId);
|
||||||
|
dest.writeInt(mUserId);
|
||||||
|
dest.writeParcelable(mTopComponent, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,19 +252,22 @@ public class ScreenshotHelper {
|
|||||||
/**
|
/**
|
||||||
* Request that provided image be handled as if it was a screenshot.
|
* Request that provided image be handled as if it was a screenshot.
|
||||||
*
|
*
|
||||||
* @param screenshot The bitmap to treat as the screen shot.
|
* @param screenshotBundle Bundle containing the buffer and color space of the screenshot.
|
||||||
* @param boundsInScreen The bounds in screen coordinates that the bitmap orginated from.
|
* @param boundsInScreen The bounds in screen coordinates that the bitmap orginated from.
|
||||||
* @param insets The insets that the image was shown with, inside the screenbounds.
|
* @param insets The insets that the image was shown with, inside the screenbounds.
|
||||||
* @param taskId The taskId of the task that the screen shot was taken of.
|
* @param taskId The taskId of the task that the screen shot was taken of.
|
||||||
|
* @param userId The userId of user running the task provided in taskId.
|
||||||
|
* @param topComponent The component name of the top component running in the task.
|
||||||
* @param handler A handler used in case the screenshot times out
|
* @param handler A handler used in case the screenshot times out
|
||||||
* @param completionConsumer Consumes `false` if a screenshot was not taken, and `true` if the
|
* @param completionConsumer Consumes `false` if a screenshot was not taken, and `true` if the
|
||||||
* screenshot was taken.
|
* screenshot was taken.
|
||||||
*/
|
*/
|
||||||
public void provideScreenshot(@NonNull Bitmap screenshot, @NonNull Rect boundsInScreen,
|
public void provideScreenshot(@NonNull Bundle screenshotBundle, @NonNull Rect boundsInScreen,
|
||||||
@NonNull Insets insets, int taskId, int source,
|
@NonNull Insets insets, int taskId, int userId, ComponentName topComponent, int source,
|
||||||
@NonNull Handler handler, @Nullable Consumer<Uri> completionConsumer) {
|
@NonNull Handler handler, @Nullable Consumer<Uri> completionConsumer) {
|
||||||
ScreenshotRequest screenshotRequest =
|
ScreenshotRequest screenshotRequest =
|
||||||
new ScreenshotRequest(source, screenshot, boundsInScreen, insets, taskId);
|
new ScreenshotRequest(source, screenshotBundle, boundsInScreen, insets, taskId,
|
||||||
|
userId, topComponent);
|
||||||
takeScreenshot(WindowManager.TAKE_SCREENSHOT_PROVIDED_IMAGE, SCREENSHOT_TIMEOUT_MS,
|
takeScreenshot(WindowManager.TAKE_SCREENSHOT_PROVIDED_IMAGE, SCREENSHOT_TIMEOUT_MS,
|
||||||
handler, screenshotRequest, completionConsumer);
|
handler, screenshotRequest, completionConsumer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,11 @@ import android.os.Bundle;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
import com.android.systemui.shared.recents.IPinnedStackAnimationListener;
|
import com.android.systemui.shared.recents.IPinnedStackAnimationListener;
|
||||||
|
import com.android.systemui.shared.recents.model.Task;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temporary callbacks into SystemUI.
|
* Temporary callbacks into SystemUI.
|
||||||
* Next id = 26
|
* Next id = 27
|
||||||
*/
|
*/
|
||||||
interface ISystemUiProxy {
|
interface ISystemUiProxy {
|
||||||
|
|
||||||
@@ -122,6 +123,9 @@ interface ISystemUiProxy {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the provided image as if it was a screenshot.
|
* Handle the provided image as if it was a screenshot.
|
||||||
|
*
|
||||||
|
* Deprecated, use handleImageBundleAsScreenshot with image bundle and UserTask
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
void handleImageAsScreenshot(in Bitmap screenImage, in Rect locationInScreen,
|
void handleImageAsScreenshot(in Bitmap screenImage, in Rect locationInScreen,
|
||||||
in Insets visibleInsets, int taskId) = 21;
|
in Insets visibleInsets, int taskId) = 21;
|
||||||
@@ -146,4 +150,10 @@ interface ISystemUiProxy {
|
|||||||
* @param rotation indicates which Surface.Rotation the gesture was started in
|
* @param rotation indicates which Surface.Rotation the gesture was started in
|
||||||
*/
|
*/
|
||||||
void onQuickSwitchToNewTask(int rotation) = 25;
|
void onQuickSwitchToNewTask(int rotation) = 25;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the provided image as if it was a screenshot.
|
||||||
|
*/
|
||||||
|
void handleImageBundleAsScreenshot(in Bundle screenImageBundle, in Rect locationInScreen,
|
||||||
|
in Insets visibleInsets, in Task.TaskKey task) = 26;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.systemui.shared.recents.model;
|
||||||
|
|
||||||
|
parcelable Task.TaskKey;
|
||||||
@@ -26,6 +26,8 @@ import android.content.Intent;
|
|||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.view.ViewDebug;
|
import android.view.ViewDebug;
|
||||||
|
|
||||||
import com.android.systemui.shared.recents.utilities.Utilities;
|
import com.android.systemui.shared.recents.utilities.Utilities;
|
||||||
@@ -52,8 +54,10 @@ public class Task {
|
|||||||
void onTaskWindowingModeChanged();
|
void onTaskWindowingModeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The Task Key represents the unique primary key for the task */
|
/**
|
||||||
public static class TaskKey {
|
* The Task Key represents the unique primary key for the task
|
||||||
|
*/
|
||||||
|
public static class TaskKey implements Parcelable {
|
||||||
@ViewDebug.ExportedProperty(category="recents")
|
@ViewDebug.ExportedProperty(category="recents")
|
||||||
public final int id;
|
public final int id;
|
||||||
@ViewDebug.ExportedProperty(category="recents")
|
@ViewDebug.ExportedProperty(category="recents")
|
||||||
@@ -157,6 +161,48 @@ public class Task {
|
|||||||
private void updateHashCode() {
|
private void updateHashCode() {
|
||||||
mHashCode = Objects.hash(id, windowingMode, userId);
|
mHashCode = Objects.hash(id, windowingMode, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<TaskKey> CREATOR =
|
||||||
|
new Parcelable.Creator<TaskKey>() {
|
||||||
|
@Override
|
||||||
|
public TaskKey createFromParcel(Parcel source) {
|
||||||
|
return TaskKey.readFromParcel(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TaskKey[] newArray(int size) {
|
||||||
|
return new TaskKey[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void writeToParcel(Parcel parcel, int flags) {
|
||||||
|
parcel.writeInt(id);
|
||||||
|
parcel.writeInt(windowingMode);
|
||||||
|
parcel.writeTypedObject(baseIntent, flags);
|
||||||
|
parcel.writeInt(userId);
|
||||||
|
parcel.writeLong(lastActiveTime);
|
||||||
|
parcel.writeInt(displayId);
|
||||||
|
parcel.writeTypedObject(sourceComponent, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static TaskKey readFromParcel(Parcel parcel) {
|
||||||
|
int id = parcel.readInt();
|
||||||
|
int windowingMode = parcel.readInt();
|
||||||
|
Intent baseIntent = parcel.readTypedObject(Intent.CREATOR);
|
||||||
|
int userId = parcel.readInt();
|
||||||
|
long lastActiveTime = parcel.readLong();
|
||||||
|
int displayId = parcel.readInt();
|
||||||
|
ComponentName sourceComponent = parcel.readTypedObject(ComponentName.CREATOR);
|
||||||
|
|
||||||
|
return new TaskKey(id, windowingMode, baseIntent, sourceComponent, userId,
|
||||||
|
lastActiveTime, displayId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewDebug.ExportedProperty(deepExport=true, prefix="key_")
|
@ViewDebug.ExportedProperty(deepExport=true, prefix="key_")
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ import com.android.systemui.settings.CurrentUserTracker;
|
|||||||
import com.android.systemui.shared.recents.IOverviewProxy;
|
import com.android.systemui.shared.recents.IOverviewProxy;
|
||||||
import com.android.systemui.shared.recents.IPinnedStackAnimationListener;
|
import com.android.systemui.shared.recents.IPinnedStackAnimationListener;
|
||||||
import com.android.systemui.shared.recents.ISystemUiProxy;
|
import com.android.systemui.shared.recents.ISystemUiProxy;
|
||||||
|
import com.android.systemui.shared.recents.model.Task;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
import com.android.systemui.shared.system.QuickStepContract;
|
import com.android.systemui.shared.system.QuickStepContract;
|
||||||
import com.android.systemui.stackdivider.Divider;
|
import com.android.systemui.stackdivider.Divider;
|
||||||
@@ -383,8 +384,7 @@ public class OverviewProxyService extends CurrentUserTracker implements
|
|||||||
@Override
|
@Override
|
||||||
public void handleImageAsScreenshot(Bitmap screenImage, Rect locationInScreen,
|
public void handleImageAsScreenshot(Bitmap screenImage, Rect locationInScreen,
|
||||||
Insets visibleInsets, int taskId) {
|
Insets visibleInsets, int taskId) {
|
||||||
mScreenshotHelper.provideScreenshot(screenImage, locationInScreen, visibleInsets,
|
// Deprecated
|
||||||
taskId, SCREENSHOT_OVERVIEW, mHandler, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -434,6 +434,21 @@ public class OverviewProxyService extends CurrentUserTracker implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleImageBundleAsScreenshot(Bundle screenImageBundle, Rect locationInScreen,
|
||||||
|
Insets visibleInsets, Task.TaskKey task) {
|
||||||
|
mScreenshotHelper.provideScreenshot(
|
||||||
|
screenImageBundle,
|
||||||
|
locationInScreen,
|
||||||
|
visibleInsets,
|
||||||
|
task.id,
|
||||||
|
task.userId,
|
||||||
|
task.sourceComponent,
|
||||||
|
SCREENSHOT_OVERVIEW,
|
||||||
|
mHandler,
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean verifyCaller(String reason) {
|
private boolean verifyCaller(String reason) {
|
||||||
final int callerId = Binder.getCallingUserHandle().getIdentifier();
|
final int callerId = Binder.getCallingUserHandle().getIdentifier();
|
||||||
if (callerId != mCurrentBoundedUserId) {
|
if (callerId != mCurrentBoundedUserId) {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import android.app.ActivityOptions;
|
|||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
@@ -494,8 +495,10 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handleImageAsScreenshot(Bitmap screenshot, Rect screenshotScreenBounds,
|
void handleImageAsScreenshot(Bitmap screenshot, Rect screenshotScreenBounds,
|
||||||
Insets visibleInsets, int taskId, Consumer<Uri> finisher, Runnable onComplete) {
|
Insets visibleInsets, int taskId, int userId, ComponentName topComponent,
|
||||||
// TODO use taskId and visibleInsets
|
Consumer<Uri> finisher, Runnable onComplete) {
|
||||||
|
// TODO: use task Id, userId, topComponent for smart handler
|
||||||
|
// TODO: use visibleInsets for animation
|
||||||
mOnCompleteRunnable = onComplete;
|
mOnCompleteRunnable = onComplete;
|
||||||
takeScreenshot(screenshot, finisher, screenshotScreenBounds);
|
takeScreenshot(screenshot, finisher, screenshotScreenBounds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import android.animation.AnimatorSet;
|
|||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
@@ -234,8 +235,10 @@ public class GlobalScreenshotLegacy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handleImageAsScreenshot(Bitmap screenshot, Rect screenshotScreenBounds,
|
void handleImageAsScreenshot(Bitmap screenshot, Rect screenshotScreenBounds,
|
||||||
Insets visibleInsets, int taskId, Consumer<Uri> finisher) {
|
Insets visibleInsets, int taskId, int userId, ComponentName topComponent,
|
||||||
// TODO use taskId and visibleInsets
|
Consumer<Uri> finisher) {
|
||||||
|
// TODO: use task Id, userId, topComponent for smart handler
|
||||||
|
// TODO: use visibleInsets for animation
|
||||||
takeScreenshot(screenshot, finisher, false, false, screenshotScreenBounds);
|
takeScreenshot(screenshot, finisher, false, false, screenshotScreenBounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static com.android.internal.util.ScreenshotHelper.SCREENSHOT_MSG_PROCESS_
|
|||||||
import static com.android.internal.util.ScreenshotHelper.SCREENSHOT_MSG_URI;
|
import static com.android.internal.util.ScreenshotHelper.SCREENSHOT_MSG_URI;
|
||||||
|
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Insets;
|
import android.graphics.Insets;
|
||||||
@@ -37,6 +38,7 @@ import android.view.WindowManager;
|
|||||||
|
|
||||||
import com.android.internal.logging.UiEventLogger;
|
import com.android.internal.logging.UiEventLogger;
|
||||||
import com.android.internal.util.ScreenshotHelper;
|
import com.android.internal.util.ScreenshotHelper;
|
||||||
|
import com.android.systemui.shared.recents.utilities.BitmapUtil;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@@ -107,16 +109,19 @@ public class TakeScreenshotService extends Service {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WindowManager.TAKE_SCREENSHOT_PROVIDED_IMAGE:
|
case WindowManager.TAKE_SCREENSHOT_PROVIDED_IMAGE:
|
||||||
Bitmap screenshot = screenshotRequest.getBitmap();
|
Bitmap screenshot = BitmapUtil.bundleToHardwareBitmap(
|
||||||
|
screenshotRequest.getBitmapBundle());
|
||||||
Rect screenBounds = screenshotRequest.getBoundsInScreen();
|
Rect screenBounds = screenshotRequest.getBoundsInScreen();
|
||||||
Insets insets = screenshotRequest.getInsets();
|
Insets insets = screenshotRequest.getInsets();
|
||||||
int taskId = screenshotRequest.getTaskId();
|
int taskId = screenshotRequest.getTaskId();
|
||||||
|
int userId = screenshotRequest.getUserId();
|
||||||
|
ComponentName topComponent = screenshotRequest.getTopComponent();
|
||||||
if (useCornerFlow) {
|
if (useCornerFlow) {
|
||||||
mScreenshot.handleImageAsScreenshot(
|
mScreenshot.handleImageAsScreenshot(screenshot, screenBounds, insets,
|
||||||
screenshot, screenBounds, insets, taskId, uriConsumer, onComplete);
|
taskId, userId, topComponent, uriConsumer, onComplete);
|
||||||
} else {
|
} else {
|
||||||
mScreenshotLegacy.handleImageAsScreenshot(
|
mScreenshotLegacy.handleImageAsScreenshot(screenshot, screenBounds, insets,
|
||||||
screenshot, screenBounds, insets, taskId, uriConsumer);
|
taskId, userId, topComponent, uriConsumer);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user