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

Commit c40f4c70 authored by Eugene Susla's avatar Eugene Susla Committed by Android (Google) Code Review
Browse files

Merge "Addresses further review comments from ag/8000041"

parents ecc40227 3156a4ce
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -177,11 +177,10 @@ public @interface DataClass {

    /**
     * @deprecated to be used by code generator exclusively
     * @hide
     */
    @Deprecated
    @Retention(RetentionPolicy.SOURCE)
    @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, ANNOTATION_TYPE, CONSTRUCTOR, TYPE})
    @Target({METHOD})
    @interface Generated {
        long time();
        String codegenVersion();
@@ -190,7 +189,6 @@ public @interface DataClass {

        /**
         * @deprecated to be used by code generator exclusively
         * @hide
         */
        @Deprecated
        @Retention(RetentionPolicy.SOURCE)
@@ -198,6 +196,22 @@ public @interface DataClass {
        @interface Member {}
    }

    /**
     * Opt out of generating {@link #genConstDefs IntDef/StringDef}s for annotated constant
     */
    @Retention(RetentionPolicy.SOURCE)
    @Target({FIELD})
    @interface SuppressConstDefsGeneration {}

    /**
     * A class-level annotation to suppress methods' generation by name
     */
    @Retention(RetentionPolicy.SOURCE)
    @Target({TYPE})
    @interface Suppress {
        String[] value();
    }

    /**
     * Callback used by {@link #genForEachField}.
     *
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import java.util.regex.Pattern;
/**
 * Describes a 2-way parcelling contract of type {@code T} into/out of a {@link Parcel}
 *
 * Implementations should be stateless.
 *
 * @param <T> the type being [un]parcelled
 */
public interface Parcelling<T> {
@@ -69,6 +71,7 @@ public interface Parcelling<T> {
         * instance or reflectively creating one.
         */
        public static <P extends Parcelling<?>> P getOrCreate(Class<P> clazz) {
            // No synchronization - creating an extra instance in a race case is ok
            P cached = get(clazz);
            if (cached != null) {
                return cached;
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ else

    header_and_eval m -j16 codegen_cli && \
        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/SampleDataClass.java && \
        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/SampleWithCustomBuilder.java && \
        cd $ANDROID_BUILD_TOP &&
        header_and_eval mmma -j16 frameworks/base/tests/Codegen && \
        header_and_eval adb install -r -t $ANDROID_PRODUCT_OUT/testcases/CodegenTests/arm64/CodegenTests.apk && \
+2 −2
Original line number Diff line number Diff line
@@ -31,11 +31,11 @@ import java.util.concurrent.atomic.AtomicInteger;
 *
 * Ignore {@link #sInstanceCount} - used for testing.
 */
public class DateParcelling implements Parcelling<Date> {
public class MyDateParcelling implements Parcelling<Date> {

    static AtomicInteger sInstanceCount = new AtomicInteger(0);

    public DateParcelling() {
    public MyDateParcelling() {
        sInstanceCount.getAndIncrement();
    }

+533 −267

File changed.

Preview size limit exceeded, changes collapsed.

Loading