Merge "Screenshot - pass bitmap as bundled hardware buffer from Launcher" into rvc-dev am: 4fdd3c8e34
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11711139 Change-Id: I367032d906c1df667c05fc10fcbbed02dcadeff9
This commit is contained in:
@@ -23,10 +23,11 @@ import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.android.systemui.shared.recents.IPinnedStackAnimationListener;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
|
||||
/**
|
||||
* Temporary callbacks into SystemUI.
|
||||
* Next id = 26
|
||||
* Next id = 27
|
||||
*/
|
||||
interface ISystemUiProxy {
|
||||
|
||||
@@ -122,6 +123,9 @@ interface ISystemUiProxy {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
in Insets visibleInsets, int taskId) = 21;
|
||||
@@ -146,4 +150,10 @@ interface ISystemUiProxy {
|
||||
* @param rotation indicates which Surface.Rotation the gesture was started in
|
||||
*/
|
||||
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.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.view.ViewDebug;
|
||||
|
||||
import com.android.systemui.shared.recents.utilities.Utilities;
|
||||
@@ -52,8 +54,10 @@ public class Task {
|
||||
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")
|
||||
public final int id;
|
||||
@ViewDebug.ExportedProperty(category="recents")
|
||||
@@ -157,6 +161,48 @@ public class Task {
|
||||
private void updateHashCode() {
|
||||
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_")
|
||||
|
||||
Reference in New Issue
Block a user