Merge "Sanitize transactions in SSG" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a1b6788f68
@@ -280,7 +280,7 @@ public final class SurfaceControl implements Parcelable {
|
||||
private static native int nativeGetLayerId(long nativeObject);
|
||||
private static native void nativeAddTransactionCommittedListener(long nativeObject,
|
||||
TransactionCommittedListener listener);
|
||||
private static native void nativeSanitize(long transactionObject);
|
||||
private static native void nativeSanitize(long transactionObject, int pid, int uid);
|
||||
private static native void nativeSetDestinationFrame(long transactionObj, long nativeObject,
|
||||
int l, int t, int r, int b);
|
||||
private static native void nativeSetDefaultApplyToken(IBinder token);
|
||||
@@ -3960,8 +3960,8 @@ public final class SurfaceControl implements Parcelable {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public void sanitize() {
|
||||
nativeSanitize(mNativeObject);
|
||||
public void sanitize(int pid, int uid) {
|
||||
nativeSanitize(mNativeObject, pid, uid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -714,6 +714,7 @@ public final class SurfaceSyncGroup {
|
||||
public void onTransactionReady(Transaction t) {
|
||||
synchronized (mLock) {
|
||||
if (t != null) {
|
||||
t.sanitize(Binder.getCallingPid(), Binder.getCallingUid());
|
||||
// When an older parent sync group is added due to a child syncGroup
|
||||
// getting added to multiple groups, we need to maintain merge order
|
||||
// so the older parentSyncGroup transactions are overwritten by
|
||||
|
||||
@@ -972,9 +972,9 @@ static void nativeSurfaceFlushJankData(JNIEnv* env, jclass clazz, jlong nativeOb
|
||||
SurfaceComposerClient::Transaction::sendSurfaceFlushJankDataTransaction(ctrl);
|
||||
}
|
||||
|
||||
static void nativeSanitize(JNIEnv* env, jclass clazz, jlong transactionObj) {
|
||||
static void nativeSanitize(JNIEnv* env, jclass clazz, jlong transactionObj, jint pid, jint uid) {
|
||||
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
|
||||
transaction->sanitize();
|
||||
transaction->sanitize(pid, uid);
|
||||
}
|
||||
|
||||
static void nativeSetDestinationFrame(JNIEnv* env, jclass clazz, jlong transactionObj,
|
||||
@@ -2268,7 +2268,7 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
|
||||
(void*) nativeSetTrustedPresentationCallback },
|
||||
{"nativeClearTrustedPresentationCallback", "(JJ)V",
|
||||
(void*) nativeClearTrustedPresentationCallback },
|
||||
{"nativeSanitize", "(J)V",
|
||||
{"nativeSanitize", "(JII)V",
|
||||
(void*) nativeSanitize },
|
||||
{"nativeSetDestinationFrame", "(JJIIII)V",
|
||||
(void*)nativeSetDestinationFrame },
|
||||
|
||||
@@ -2675,7 +2675,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
void finishDrawingWindow(Session session, IWindow client,
|
||||
@Nullable SurfaceControl.Transaction postDrawTransaction, int seqId) {
|
||||
if (postDrawTransaction != null) {
|
||||
postDrawTransaction.sanitize();
|
||||
postDrawTransaction.sanitize(Binder.getCallingPid(), Binder.getCallingUid());
|
||||
}
|
||||
|
||||
final long origId = Binder.clearCallingIdentity();
|
||||
|
||||
Reference in New Issue
Block a user