Merge "SurfaceControl: Add setDropInputMode api" into rvc-dev
This commit is contained in:
@@ -255,6 +255,7 @@ filegroup {
|
||||
":framework_native_aidl",
|
||||
":gatekeeper_aidl",
|
||||
":gsiservice_aidl",
|
||||
":guiconstants_aidl",
|
||||
":incidentcompanion_aidl",
|
||||
":installd_aidl",
|
||||
":keystore_aidl",
|
||||
|
||||
@@ -42,6 +42,7 @@ import android.graphics.PixelFormat;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.gui.DropInputMode;
|
||||
import android.hardware.display.DeviceProductInfo;
|
||||
import android.hardware.display.DisplayedContentSample;
|
||||
import android.hardware.display.DisplayedContentSamplingAttributes;
|
||||
@@ -49,7 +50,6 @@ import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Trace;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
import android.util.SparseIntArray;
|
||||
@@ -141,7 +141,8 @@ public final class SurfaceControl implements Parcelable {
|
||||
int layerStack);
|
||||
private static native void nativeSetTrustedOverlay(long transactionObj, long nativeObject,
|
||||
boolean isTrustedOverlay);
|
||||
|
||||
private static native void nativeSetDropInputMode(
|
||||
long transactionObj, long nativeObject, int flags);
|
||||
private static native boolean nativeClearContentFrameStats(long nativeObject);
|
||||
private static native boolean nativeGetContentFrameStats(long nativeObject, WindowContentFrameStats outStats);
|
||||
private static native boolean nativeClearAnimationFrameStats();
|
||||
@@ -3050,6 +3051,17 @@ public final class SurfaceControl implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the input event drop mode on this SurfaceControl and its children. The caller must
|
||||
* hold the ACCESS_SURFACE_FLINGER permission. See {@code InputEventDropMode}.
|
||||
* @hide
|
||||
*/
|
||||
public Transaction setDropInputMode(SurfaceControl sc, @DropInputMode int mode) {
|
||||
checkPreconditions(sc);
|
||||
nativeSetDropInputMode(mNativeObject, sc.mNativeObject, mode);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the other transaction into this transaction, clearing the
|
||||
* other transaction as if it had been applied.
|
||||
|
||||
@@ -671,6 +671,13 @@ static void nativeSetFixedTransformHint(JNIEnv* env, jclass clazz, jlong transac
|
||||
transaction->setFixedTransformHint(ctrl, transformHint);
|
||||
}
|
||||
|
||||
static void nativeSetDropInputMode(JNIEnv* env, jclass clazz, jlong transactionObj,
|
||||
jlong nativeObject, jint mode) {
|
||||
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
|
||||
SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl*>(nativeObject);
|
||||
transaction->setDropInputMode(ctrl, static_cast<gui::DropInputMode>(mode));
|
||||
}
|
||||
|
||||
static jlongArray nativeGetPhysicalDisplayIds(JNIEnv* env, jclass clazz) {
|
||||
const auto displayIds = SurfaceComposerClient::getPhysicalDisplayIds();
|
||||
jlongArray array = env->NewLongArray(displayIds.size());
|
||||
@@ -1495,6 +1502,7 @@ static jlong nativeGetHandle(JNIEnv* env, jclass clazz, jlong nativeObject) {
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static const JNINativeMethod sSurfaceControlMethods[] = {
|
||||
// clang-format off
|
||||
{"nativeCreate", "(Landroid/view/SurfaceSession;Ljava/lang/String;IIIIJLandroid/os/Parcel;)J",
|
||||
(void*)nativeCreate },
|
||||
{"nativeReadFromParcel", "(Landroid/os/Parcel;)J",
|
||||
@@ -1678,6 +1686,9 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
|
||||
(void*)nativeSetFixedTransformHint},
|
||||
{"nativeSetTrustedOverlay", "(JJZ)V",
|
||||
(void*)nativeSetTrustedOverlay },
|
||||
{"nativeSetDropInputMode", "(JJI)V",
|
||||
(void*)nativeSetDropInputMode},
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
int register_android_view_SurfaceControl(JNIEnv* env)
|
||||
|
||||
Reference in New Issue
Block a user