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

Commit 58b8a8fb authored by John Wu's avatar John Wu Committed by Android (Google) Code Review
Browse files

Merge changes Ib7ca9618,Iee223c5d into main

* changes:
  [HostStubGen] Remove stub usage in HSG tests
  [HostStubGen] Multiple improvements
parents 32502e49 a80c3333
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
+0 −2
Original line number Diff line number Diff line
@@ -6,8 +6,6 @@
--default-throw

# Uncomment below lines to enable each feature.
# --enable-non-stub-method-check
--no-non-stub-method-check

#--default-method-call-hook
#    com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall
+2 −6
Original line number Diff line number Diff line
@@ -118,7 +118,6 @@ java_binary_host {

java_test_host {
    name: "hoststubgentest",
    // main_class: "com.android.hoststubgen.Main",
    srcs: ["test/**/*.kt"],
    static_libs: [
        "hoststubgen",
@@ -143,8 +142,7 @@ hoststubgen_common_options = "$(location hoststubgen) " +
    // "--policy-override-file $(location framework-policy-override.txt) " +
    "@$(location :hoststubgen-standard-options) " +

    "--out-stub-jar $(location host_stub.jar) " +
    "--out-impl-jar $(location host_impl.jar) " +
    "--out-impl-jar $(location host.jar) " +

    // "--keep-all-classes " + // Used it for an experiment. See KeepAllClassesFilter.
    "--gen-keep-all-file $(location hoststubgen_keep_all.txt) " +
@@ -159,10 +157,8 @@ genrule_defaults {
    srcs: [
        ":hoststubgen-standard-options",
    ],
    // Create two jar files.
    out: [
        "host_stub.jar",
        "host_impl.jar",
        "host.jar",

        // Following files are created just as FYI.
        "hoststubgen_keep_all.txt",
+0 −43
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.hosttest.annotation;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * THIS ANNOTATION IS EXPERIMENTAL. REACH OUT TO g/ravenwood BEFORE USING IT, OR YOU HAVE ANY
 * QUESTIONS ABOUT IT.
 *
 * Mark a class, field or a method as "Stub", meaning tests can see the APIs.
 * When applied to a class, it will _not_ affect the visibility of its members. They need to be
 * individually marked.
 *
 * <p>In order to expose a class and all its members, use {@link HostSideTestWholeClassStub}
 * instead.
 *
 * @hide
 */
@Target({TYPE, FIELD, METHOD, CONSTRUCTOR})
@Retention(RetentionPolicy.CLASS)
public @interface HostSideTestStub {
}
+0 −35
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.hosttest.annotation;

import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * THIS ANNOTATION IS EXPERIMENTAL. REACH OUT TO g/ravenwood BEFORE USING IT, OR YOU HAVE ANY
 * QUESTIONS ABOUT IT.
 *
 * Same as {@link HostSideTestStub} but it'll change the visibility of all its members too.
 *
 * @hide
 */
@Target({TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface HostSideTestWholeClassStub {
}
Loading