SurfaceControl: Add setDropInputMode api am: a84612483f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16740078 Change-Id: I58ac5d9d048ca1a30c15eccd9effdefe2922c148
This commit is contained in:
@@ -113,6 +113,7 @@ filegroup {
|
|||||||
":gatekeeper_aidl",
|
":gatekeeper_aidl",
|
||||||
":gsiservice_aidl",
|
":gsiservice_aidl",
|
||||||
":idmap2_aidl",
|
":idmap2_aidl",
|
||||||
|
":guiconstants_aidl",
|
||||||
":idmap2_core_aidl",
|
":idmap2_core_aidl",
|
||||||
":incidentcompanion_aidl",
|
":incidentcompanion_aidl",
|
||||||
":inputconstants_aidl",
|
":inputconstants_aidl",
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import android.graphics.PixelFormat;
|
|||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Region;
|
import android.graphics.Region;
|
||||||
|
import android.gui.DropInputMode;
|
||||||
import android.hardware.HardwareBuffer;
|
import android.hardware.HardwareBuffer;
|
||||||
import android.hardware.display.DeviceProductInfo;
|
import android.hardware.display.DeviceProductInfo;
|
||||||
import android.hardware.display.DisplayedContentSample;
|
import android.hardware.display.DisplayedContentSample;
|
||||||
@@ -150,7 +151,8 @@ public final class SurfaceControl implements Parcelable {
|
|||||||
float childRelativeTop, float childRelativeRight, float childRelativeBottom);
|
float childRelativeTop, float childRelativeRight, float childRelativeBottom);
|
||||||
private static native void nativeSetTrustedOverlay(long transactionObj, long nativeObject,
|
private static native void nativeSetTrustedOverlay(long transactionObj, long nativeObject,
|
||||||
boolean isTrustedOverlay);
|
boolean isTrustedOverlay);
|
||||||
|
private static native void nativeSetDropInputMode(
|
||||||
|
long transactionObj, long nativeObject, int flags);
|
||||||
private static native boolean nativeClearContentFrameStats(long nativeObject);
|
private static native boolean nativeClearContentFrameStats(long nativeObject);
|
||||||
private static native boolean nativeGetContentFrameStats(long nativeObject, WindowContentFrameStats outStats);
|
private static native boolean nativeGetContentFrameStats(long nativeObject, WindowContentFrameStats outStats);
|
||||||
private static native boolean nativeClearAnimationFrameStats();
|
private static native boolean nativeClearAnimationFrameStats();
|
||||||
@@ -3426,6 +3428,17 @@ public final class SurfaceControl implements Parcelable {
|
|||||||
return this;
|
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
|
* Merge the other transaction into this transaction, clearing the
|
||||||
* other transaction as if it had been applied.
|
* other transaction as if it had been applied.
|
||||||
|
|||||||
@@ -868,6 +868,13 @@ static void nativeSetFixedTransformHint(JNIEnv* env, jclass clazz, jlong transac
|
|||||||
transaction->setFixedTransformHint(ctrl, transformHint);
|
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) {
|
static jlongArray nativeGetPhysicalDisplayIds(JNIEnv* env, jclass clazz) {
|
||||||
const auto displayIds = SurfaceComposerClient::getPhysicalDisplayIds();
|
const auto displayIds = SurfaceComposerClient::getPhysicalDisplayIds();
|
||||||
jlongArray array = env->NewLongArray(displayIds.size());
|
jlongArray array = env->NewLongArray(displayIds.size());
|
||||||
@@ -1994,6 +2001,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
|
|||||||
(void*)nativeGetTransformHint },
|
(void*)nativeGetTransformHint },
|
||||||
{"nativeSetTrustedOverlay", "(JJZ)V",
|
{"nativeSetTrustedOverlay", "(JJZ)V",
|
||||||
(void*)nativeSetTrustedOverlay },
|
(void*)nativeSetTrustedOverlay },
|
||||||
|
{"nativeSetDropInputMode", "(JJI)V",
|
||||||
|
(void*)nativeSetDropInputMode},
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user