Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1566e17e authored by John Wu's avatar John Wu
Browse files

[HostStubGen] Multiple improvements

1. Consolidate SubstituteAnd[Stub/Keep] into a single Substitute policy.
   There is little reason to support SubstituteKeep, so make Substitute
   implicitly Stub. In production, methods are never annotated with both
   Stub/Keep + Substitute anyways.
2. Update ClassFilter to support nested classes.
3. Rewrite AnnotationFilter with the following improvements:
   - Previously, when a method is annotated as Substitute, the method
     itself will get the Remove policy, and the replacement method will
     get the Stub/Keep policy. In the new implementation, the annotated
     method will preserve its Substitute policy, which will not only be
     useful for future improvements, but also be consistent with how
     text policy filter is implemented.
   - Process the entire class all at once and cache its results; the
     previous implementation re-run the same operations multiple times.
   - Previously, the annotation allowlist was not properly enforced when
     Substitute annotation is used.

Bug: 292141694
Flag: EXEMPT host test change only
Test: atest hoststubgen-test-tiny-test
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
Change-Id: Iee223c5d0814351eccdcfc884da64bc507af83b7
parent 10bf2e16
Loading
Loading
Loading
Loading
+1 −30
Original line number Diff line number Diff line
@@ -9,17 +9,13 @@ com.android.internal.logging.testing.FakeMetricsLogger
com.android.internal.logging.testing.UiEventLoggerFake
com.android.internal.os.AndroidPrintStream
com.android.internal.os.BatteryStatsHistory
com.android.internal.os.BatteryStatsHistory$TraceDelegate
com.android.internal.os.BatteryStatsHistory$VarintParceler
com.android.internal.os.BatteryStatsHistoryIterator
com.android.internal.os.Clock
com.android.internal.os.LongArrayMultiStateCounter
com.android.internal.os.LongArrayMultiStateCounter$LongArrayContainer
com.android.internal.os.LongMultiStateCounter
com.android.internal.os.MonotonicClock
com.android.internal.os.PowerProfile
com.android.internal.os.PowerStats
com.android.internal.os.PowerStats$Descriptor
com.android.internal.os.RuntimeInit
com.android.internal.power.EnergyConsumerStats
com.android.internal.power.ModemPowerProfile
@@ -123,15 +119,9 @@ android.os.BadTypeParcelableException
android.os.BaseBundle
android.os.BatteryConsumer
android.os.BatteryStats
android.os.BatteryStats$HistoryItem
android.os.BatteryStats$HistoryStepDetails
android.os.BatteryStats$HistoryTag
android.os.BatteryStats$LongCounter
android.os.BatteryStats$ProcessStateChange
android.os.BatteryUsageStats
android.os.BatteryUsageStatsQuery
android.os.Binder
android.os.Binder$IdentitySupplier
android.os.BluetoothBatteryStats
android.os.Broadcaster
android.os.Build
@@ -142,7 +132,6 @@ android.os.ConditionVariable
android.os.DeadObjectException
android.os.DeadSystemException
android.os.FileUtils
android.os.FileUtils$MemoryPipe
android.os.Handler
android.os.HandlerExecutor
android.os.HandlerThread
@@ -154,8 +143,6 @@ android.os.MessageQueue
android.os.PackageTagsList
android.os.Parcel
android.os.ParcelFileDescriptor
android.os.ParcelFileDescriptor$AutoCloseInputStream
android.os.ParcelFileDescriptor$AutoCloseOutputStream
android.os.ParcelFormatException
android.os.ParcelUuid
android.os.Parcelable
@@ -169,7 +156,6 @@ android.os.RemoteCallbackList
android.os.RemoteException
android.os.ResultReceiver
android.os.ServiceManager
android.os.ServiceManager$ServiceNotFoundException
android.os.ServiceSpecificException
android.os.StrictMode
android.os.SystemClock
@@ -180,18 +166,14 @@ android.os.TimestampedValue
android.os.Trace
android.os.TransactionTooLargeException
android.os.UserBatteryConsumer
android.os.UserBatteryConsumer$Builder
android.os.UidBatteryConsumer
android.os.UidBatteryConsumer$Builder
android.os.UserHandle
android.os.UserManager
android.os.VibrationAttributes
android.os.VibrationAttributes$Builder
android.os.WakeLockStats
android.os.WorkSource

android.content.ClipData
android.content.ClipData$Item
android.content.ClipDescription
android.content.ClipboardManager
android.content.ComponentName
@@ -208,11 +190,7 @@ android.content.pm.ApplicationInfo
android.content.pm.ComponentInfo
android.content.pm.PackageInfo
android.content.pm.PackageItemInfo
android.content.pm.PackageManager$Flags
android.content.pm.PackageManager$PackageInfoFlags
android.content.pm.PackageManager$ApplicationInfoFlags
android.content.pm.PackageManager$ComponentInfoFlags
android.content.pm.PackageManager$ResolveInfoFlags
android.content.pm.PackageManager
android.content.pm.PathPermission
android.content.pm.ProviderInfo
android.content.pm.ResolveInfo
@@ -223,7 +201,6 @@ android.content.pm.UserInfo
android.content.res.ApkAssets
android.content.res.AssetFileDescriptor
android.content.res.AssetManager
android.content.res.AssetManager$Builder
android.content.res.ColorStateList
android.content.res.ConfigurationBoundResourceCache
android.content.res.Configuration
@@ -237,7 +214,6 @@ android.content.res.FontScaleConverter
android.content.res.FontScaleConverterImpl
android.content.res.FontScaleConverterFactory
android.content.res.Resources
android.content.res.Resources$Theme
android.content.res.ResourceId
android.content.res.ResourcesImpl
android.content.res.ResourcesKey
@@ -260,7 +236,6 @@ android.database.CursorWrapper
android.database.DataSetObservable
android.database.DataSetObserver
android.database.MatrixCursor
android.database.MatrixCursor$RowBuilder
android.database.MergeCursor
android.database.Observable
android.database.SQLException
@@ -268,7 +243,6 @@ android.database.sqlite.SQLiteClosable
android.database.sqlite.SQLiteException

android.text.TextUtils
android.text.TextUtils$SimpleStringSplitter

android.accounts.Account

@@ -298,14 +272,11 @@ android.app.ComponentOptions
android.app.Instrumentation
android.app.LocaleConfig
android.app.ResourcesManager
android.app.ResourcesManager$UpdateHandler
android.app.WindowConfiguration

android.metrics.LogMaker

android.view.Display
android.view.Display$HdrCapabilities
android.view.Display$Mode
android.view.DisplayAdjustments
android.view.DisplayInfo
android.view.inputmethod.InputBinding
Loading