Loading core/java/android/os/Parcel.java +24 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,10 @@ import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.AppOpsManager; import android.compat.annotation.UnsupportedAppUsage; import android.ravenwood.annotation.RavenwoodKeepWholeClass; import android.ravenwood.annotation.RavenwoodNativeSubstitutionClass; import android.ravenwood.annotation.RavenwoodReplace; import android.ravenwood.annotation.RavenwoodThrow; import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; Loading Loading @@ -228,6 +232,8 @@ import java.util.function.IntFunction; * {@link #readMap(Map, ClassLoader, Class, Class)}, * {@link #readSparseArray(ClassLoader, Class)}. */ @RavenwoodKeepWholeClass @RavenwoodNativeSubstitutionClass("com.android.hoststubgen.nativesubstitution.Parcel_host") public final class Parcel { private static final boolean DEBUG_RECYCLE = false; Loading Loading @@ -382,8 +388,10 @@ public final class Parcel { @CriticalNative private static native void nativeMarkSensitive(long nativePtr); @FastNative @RavenwoodThrow private static native void nativeMarkForBinder(long nativePtr, IBinder binder); @CriticalNative @RavenwoodThrow private static native boolean nativeIsForRpc(long nativePtr); @CriticalNative private static native int nativeDataSize(long nativePtr); Loading Loading @@ -415,14 +423,17 @@ public final class Parcel { private static native int nativeWriteFloat(long nativePtr, float val); @CriticalNative private static native int nativeWriteDouble(long nativePtr, double val); @RavenwoodThrow private static native void nativeSignalExceptionForError(int error); @FastNative private static native void nativeWriteString8(long nativePtr, String val); @FastNative private static native void nativeWriteString16(long nativePtr, String val); @FastNative @RavenwoodThrow private static native void nativeWriteStrongBinder(long nativePtr, IBinder val); @FastNative @RavenwoodThrow private static native void nativeWriteFileDescriptor(long nativePtr, FileDescriptor val); private static native byte[] nativeCreateByteArray(long nativePtr); Loading @@ -441,8 +452,10 @@ public final class Parcel { @FastNative private static native String nativeReadString16(long nativePtr); @FastNative @RavenwoodThrow private static native IBinder nativeReadStrongBinder(long nativePtr); @FastNative @RavenwoodThrow private static native FileDescriptor nativeReadFileDescriptor(long nativePtr); private static native long nativeCreate(); Loading @@ -452,7 +465,9 @@ public final class Parcel { private static native byte[] nativeMarshall(long nativePtr); private static native void nativeUnmarshall( long nativePtr, byte[] data, int offset, int length); @RavenwoodThrow private static native int nativeCompareData(long thisNativePtr, long otherNativePtr); @RavenwoodThrow private static native boolean nativeCompareDataInRange( long ptrA, int offsetA, long ptrB, int offsetB, int length); private static native void nativeAppendFrom( Loading @@ -461,13 +476,17 @@ public final class Parcel { private static native boolean nativeHasFileDescriptors(long nativePtr); private static native boolean nativeHasFileDescriptorsInRange( long nativePtr, int offset, int length); @RavenwoodThrow private static native void nativeWriteInterfaceToken(long nativePtr, String interfaceName); @RavenwoodThrow private static native void nativeEnforceInterface(long nativePtr, String interfaceName); @CriticalNative @RavenwoodThrow private static native boolean nativeReplaceCallingWorkSourceUid( long nativePtr, int workSourceUid); @CriticalNative @RavenwoodThrow private static native int nativeReadCallingWorkSourceUid(long nativePtr); /** Last time exception with a stack trace was written */ Loading @@ -476,6 +495,7 @@ public final class Parcel { private static final int WRITE_EXCEPTION_STACK_TRACE_THRESHOLD_MS = 1000; @CriticalNative @RavenwoodThrow private static native long nativeGetOpenAshmemSize(long nativePtr); public final static Parcelable.Creator<String> STRING_CREATOR Loading Loading @@ -634,10 +654,12 @@ public final class Parcel { /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @RavenwoodThrow public static native long getGlobalAllocSize(); /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @RavenwoodThrow public static native long getGlobalAllocCount(); /** Loading Loading @@ -2918,6 +2940,7 @@ public final class Parcel { * @see #writeNoException * @see #readException */ @RavenwoodReplace public final void writeException(@NonNull Exception e) { AppOpsManager.prefixParcelWithAppOpsIfNeeded(this); Loading Loading @@ -3017,6 +3040,7 @@ public final class Parcel { * @see #writeException * @see #readException */ @RavenwoodReplace public final void writeNoException() { AppOpsManager.prefixParcelWithAppOpsIfNeeded(this); Loading core/java/android/os/Parcelable.java +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.os; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.SystemApi; import android.ravenwood.annotation.RavenwoodKeepWholeClass; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -86,6 +87,7 @@ import java.lang.annotation.RetentionPolicy; * } * }</pre></section></div></div> */ @RavenwoodKeepWholeClass public interface Parcelable { /** @hide */ @IntDef(flag = true, prefix = { "PARCELABLE_" }, value = { Loading ravenwood/framework-minus-apex-ravenwood-policies.txt +0 −6 Original line number Diff line number Diff line Loading @@ -92,12 +92,6 @@ class com.android.internal.util.StringPool stubclass class com.android.internal.os.SomeArgs stubclass # Parcel class android.os.Parcel stubclass method writeException (Ljava/lang/Exception;)V @writeException$ravenwood method writeNoException ()V @writeNoException$ravenwood class android.os.Parcel !com.android.hoststubgen.nativesubstitution.Parcel_host class android.os.Parcelable stubclass class android.os.ParcelFormatException stubclass class android.os.BadParcelableException stubclass class android.os.BadTypeParcelableException stubclass Loading ravenwood/ravenwood-annotation-allowed-classes.txt +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ android.os.IBinder android.os.Looper android.os.Message android.os.MessageQueue android.os.Parcel android.os.Parcelable android.os.Process android.os.SystemClock android.os.ThreadLocalWorkSource Loading tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/Parcel_host.java +0 −55 Original line number Diff line number Diff line Loading @@ -15,9 +15,6 @@ */ package com.android.hoststubgen.nativesubstitution; import android.os.IBinder; import java.io.FileDescriptor; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Arrays; Loading Loading @@ -143,12 +140,6 @@ public class Parcel_host { public static void nativeMarkSensitive(long nativePtr) { getInstance(nativePtr).mSensitive = true; } public static void nativeMarkForBinder(long nativePtr, IBinder binder) { throw new RuntimeException("Not implemented yet"); } public static boolean nativeIsForRpc(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static int nativeDataSize(long nativePtr) { return getInstance(nativePtr).mSize; } Loading Loading @@ -236,9 +227,6 @@ public class Parcel_host { public static int nativeWriteDouble(long nativePtr, double val) { return nativeWriteLong(nativePtr, Double.doubleToLongBits(val)); } public static void nativeSignalExceptionForError(int error) { throw new RuntimeException("Not implemented yet"); } private static int align4(int val) { return ((val + 3) / 4) * 4; Loading @@ -256,12 +244,6 @@ public class Parcel_host { // Just reuse String8 nativeWriteString8(nativePtr, val); } public static void nativeWriteStrongBinder(long nativePtr, IBinder val) { throw new RuntimeException("Not implemented yet"); } public static void nativeWriteFileDescriptor(long nativePtr, FileDescriptor val) { throw new RuntimeException("Not implemented yet"); } public static byte[] nativeCreateByteArray(long nativePtr) { return nativeReadBlob(nativePtr); Loading Loading @@ -348,12 +330,6 @@ public class Parcel_host { public static String nativeReadString16(long nativePtr) { return nativeReadString8(nativePtr); } public static IBinder nativeReadStrongBinder(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static FileDescriptor nativeReadFileDescriptor(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static byte[] nativeMarshall(long nativePtr) { var p = getInstance(nativePtr); Loading @@ -367,13 +343,6 @@ public class Parcel_host { p.mPos += length; p.updateSize(); } public static int nativeCompareData(long thisNativePtr, long otherNativePtr) { throw new RuntimeException("Not implemented yet"); } public static boolean nativeCompareDataInRange( long ptrA, int offsetA, long ptrB, int offsetB, int length) { throw new RuntimeException("Not implemented yet"); } public static void nativeAppendFrom( long thisNativePtr, long otherNativePtr, int srcOffset, int length) { var dst = getInstance(thisNativePtr); Loading @@ -397,28 +366,4 @@ public class Parcel_host { // Assume false for now, because we don't support writing FDs yet. return false; } public static void nativeWriteInterfaceToken(long nativePtr, String interfaceName) { throw new RuntimeException("Not implemented yet"); } public static void nativeEnforceInterface(long nativePtr, String interfaceName) { throw new RuntimeException("Not implemented yet"); } public static boolean nativeReplaceCallingWorkSourceUid( long nativePtr, int workSourceUid) { throw new RuntimeException("Not implemented yet"); } public static int nativeReadCallingWorkSourceUid(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static long nativeGetOpenAshmemSize(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static long getGlobalAllocSize() { throw new RuntimeException("Not implemented yet"); } public static long getGlobalAllocCount() { throw new RuntimeException("Not implemented yet"); } } Loading
core/java/android/os/Parcel.java +24 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,10 @@ import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.AppOpsManager; import android.compat.annotation.UnsupportedAppUsage; import android.ravenwood.annotation.RavenwoodKeepWholeClass; import android.ravenwood.annotation.RavenwoodNativeSubstitutionClass; import android.ravenwood.annotation.RavenwoodReplace; import android.ravenwood.annotation.RavenwoodThrow; import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; Loading Loading @@ -228,6 +232,8 @@ import java.util.function.IntFunction; * {@link #readMap(Map, ClassLoader, Class, Class)}, * {@link #readSparseArray(ClassLoader, Class)}. */ @RavenwoodKeepWholeClass @RavenwoodNativeSubstitutionClass("com.android.hoststubgen.nativesubstitution.Parcel_host") public final class Parcel { private static final boolean DEBUG_RECYCLE = false; Loading Loading @@ -382,8 +388,10 @@ public final class Parcel { @CriticalNative private static native void nativeMarkSensitive(long nativePtr); @FastNative @RavenwoodThrow private static native void nativeMarkForBinder(long nativePtr, IBinder binder); @CriticalNative @RavenwoodThrow private static native boolean nativeIsForRpc(long nativePtr); @CriticalNative private static native int nativeDataSize(long nativePtr); Loading Loading @@ -415,14 +423,17 @@ public final class Parcel { private static native int nativeWriteFloat(long nativePtr, float val); @CriticalNative private static native int nativeWriteDouble(long nativePtr, double val); @RavenwoodThrow private static native void nativeSignalExceptionForError(int error); @FastNative private static native void nativeWriteString8(long nativePtr, String val); @FastNative private static native void nativeWriteString16(long nativePtr, String val); @FastNative @RavenwoodThrow private static native void nativeWriteStrongBinder(long nativePtr, IBinder val); @FastNative @RavenwoodThrow private static native void nativeWriteFileDescriptor(long nativePtr, FileDescriptor val); private static native byte[] nativeCreateByteArray(long nativePtr); Loading @@ -441,8 +452,10 @@ public final class Parcel { @FastNative private static native String nativeReadString16(long nativePtr); @FastNative @RavenwoodThrow private static native IBinder nativeReadStrongBinder(long nativePtr); @FastNative @RavenwoodThrow private static native FileDescriptor nativeReadFileDescriptor(long nativePtr); private static native long nativeCreate(); Loading @@ -452,7 +465,9 @@ public final class Parcel { private static native byte[] nativeMarshall(long nativePtr); private static native void nativeUnmarshall( long nativePtr, byte[] data, int offset, int length); @RavenwoodThrow private static native int nativeCompareData(long thisNativePtr, long otherNativePtr); @RavenwoodThrow private static native boolean nativeCompareDataInRange( long ptrA, int offsetA, long ptrB, int offsetB, int length); private static native void nativeAppendFrom( Loading @@ -461,13 +476,17 @@ public final class Parcel { private static native boolean nativeHasFileDescriptors(long nativePtr); private static native boolean nativeHasFileDescriptorsInRange( long nativePtr, int offset, int length); @RavenwoodThrow private static native void nativeWriteInterfaceToken(long nativePtr, String interfaceName); @RavenwoodThrow private static native void nativeEnforceInterface(long nativePtr, String interfaceName); @CriticalNative @RavenwoodThrow private static native boolean nativeReplaceCallingWorkSourceUid( long nativePtr, int workSourceUid); @CriticalNative @RavenwoodThrow private static native int nativeReadCallingWorkSourceUid(long nativePtr); /** Last time exception with a stack trace was written */ Loading @@ -476,6 +495,7 @@ public final class Parcel { private static final int WRITE_EXCEPTION_STACK_TRACE_THRESHOLD_MS = 1000; @CriticalNative @RavenwoodThrow private static native long nativeGetOpenAshmemSize(long nativePtr); public final static Parcelable.Creator<String> STRING_CREATOR Loading Loading @@ -634,10 +654,12 @@ public final class Parcel { /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @RavenwoodThrow public static native long getGlobalAllocSize(); /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @RavenwoodThrow public static native long getGlobalAllocCount(); /** Loading Loading @@ -2918,6 +2940,7 @@ public final class Parcel { * @see #writeNoException * @see #readException */ @RavenwoodReplace public final void writeException(@NonNull Exception e) { AppOpsManager.prefixParcelWithAppOpsIfNeeded(this); Loading Loading @@ -3017,6 +3040,7 @@ public final class Parcel { * @see #writeException * @see #readException */ @RavenwoodReplace public final void writeNoException() { AppOpsManager.prefixParcelWithAppOpsIfNeeded(this); Loading
core/java/android/os/Parcelable.java +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.os; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.SystemApi; import android.ravenwood.annotation.RavenwoodKeepWholeClass; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -86,6 +87,7 @@ import java.lang.annotation.RetentionPolicy; * } * }</pre></section></div></div> */ @RavenwoodKeepWholeClass public interface Parcelable { /** @hide */ @IntDef(flag = true, prefix = { "PARCELABLE_" }, value = { Loading
ravenwood/framework-minus-apex-ravenwood-policies.txt +0 −6 Original line number Diff line number Diff line Loading @@ -92,12 +92,6 @@ class com.android.internal.util.StringPool stubclass class com.android.internal.os.SomeArgs stubclass # Parcel class android.os.Parcel stubclass method writeException (Ljava/lang/Exception;)V @writeException$ravenwood method writeNoException ()V @writeNoException$ravenwood class android.os.Parcel !com.android.hoststubgen.nativesubstitution.Parcel_host class android.os.Parcelable stubclass class android.os.ParcelFormatException stubclass class android.os.BadParcelableException stubclass class android.os.BadTypeParcelableException stubclass Loading
ravenwood/ravenwood-annotation-allowed-classes.txt +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ android.os.IBinder android.os.Looper android.os.Message android.os.MessageQueue android.os.Parcel android.os.Parcelable android.os.Process android.os.SystemClock android.os.ThreadLocalWorkSource Loading
tools/hoststubgen/hoststubgen/helper-framework-runtime-src/framework/com/android/hoststubgen/nativesubstitution/Parcel_host.java +0 −55 Original line number Diff line number Diff line Loading @@ -15,9 +15,6 @@ */ package com.android.hoststubgen.nativesubstitution; import android.os.IBinder; import java.io.FileDescriptor; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Arrays; Loading Loading @@ -143,12 +140,6 @@ public class Parcel_host { public static void nativeMarkSensitive(long nativePtr) { getInstance(nativePtr).mSensitive = true; } public static void nativeMarkForBinder(long nativePtr, IBinder binder) { throw new RuntimeException("Not implemented yet"); } public static boolean nativeIsForRpc(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static int nativeDataSize(long nativePtr) { return getInstance(nativePtr).mSize; } Loading Loading @@ -236,9 +227,6 @@ public class Parcel_host { public static int nativeWriteDouble(long nativePtr, double val) { return nativeWriteLong(nativePtr, Double.doubleToLongBits(val)); } public static void nativeSignalExceptionForError(int error) { throw new RuntimeException("Not implemented yet"); } private static int align4(int val) { return ((val + 3) / 4) * 4; Loading @@ -256,12 +244,6 @@ public class Parcel_host { // Just reuse String8 nativeWriteString8(nativePtr, val); } public static void nativeWriteStrongBinder(long nativePtr, IBinder val) { throw new RuntimeException("Not implemented yet"); } public static void nativeWriteFileDescriptor(long nativePtr, FileDescriptor val) { throw new RuntimeException("Not implemented yet"); } public static byte[] nativeCreateByteArray(long nativePtr) { return nativeReadBlob(nativePtr); Loading Loading @@ -348,12 +330,6 @@ public class Parcel_host { public static String nativeReadString16(long nativePtr) { return nativeReadString8(nativePtr); } public static IBinder nativeReadStrongBinder(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static FileDescriptor nativeReadFileDescriptor(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static byte[] nativeMarshall(long nativePtr) { var p = getInstance(nativePtr); Loading @@ -367,13 +343,6 @@ public class Parcel_host { p.mPos += length; p.updateSize(); } public static int nativeCompareData(long thisNativePtr, long otherNativePtr) { throw new RuntimeException("Not implemented yet"); } public static boolean nativeCompareDataInRange( long ptrA, int offsetA, long ptrB, int offsetB, int length) { throw new RuntimeException("Not implemented yet"); } public static void nativeAppendFrom( long thisNativePtr, long otherNativePtr, int srcOffset, int length) { var dst = getInstance(thisNativePtr); Loading @@ -397,28 +366,4 @@ public class Parcel_host { // Assume false for now, because we don't support writing FDs yet. return false; } public static void nativeWriteInterfaceToken(long nativePtr, String interfaceName) { throw new RuntimeException("Not implemented yet"); } public static void nativeEnforceInterface(long nativePtr, String interfaceName) { throw new RuntimeException("Not implemented yet"); } public static boolean nativeReplaceCallingWorkSourceUid( long nativePtr, int workSourceUid) { throw new RuntimeException("Not implemented yet"); } public static int nativeReadCallingWorkSourceUid(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static long nativeGetOpenAshmemSize(long nativePtr) { throw new RuntimeException("Not implemented yet"); } public static long getGlobalAllocSize() { throw new RuntimeException("Not implemented yet"); } public static long getGlobalAllocCount() { throw new RuntimeException("Not implemented yet"); } }