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

Commit 42c3bc39 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

JavaDoc fixes

Consistently apply go/java-practices/javadoc based on API review
feedback.

Flag: EXEMPT javadoc change only
Bug: 324089586
Test: atest StrictModeTest
Change-Id: I8f7c6a74d201105cc49ee875974aea0b2f283f7b
parent be1f2377
Loading
Loading
Loading
Loading
+68 −68
Original line number Original line Diff line number Diff line
@@ -364,7 +364,7 @@ public final class StrictMode {
    public static final int NETWORK_POLICY_REJECT = 2;
    public static final int NETWORK_POLICY_REJECT = 2;


    /**
    /**
     * Detect explicit calls to {@link Runtime#gc()}.
     * Detects explicit calls to {@link Runtime#gc()}.
     */
     */
    @ChangeId
    @ChangeId
    @EnabledSince(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
    @EnabledSince(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
@@ -500,7 +500,7 @@ public final class StrictMode {
            private Executor mExecutor;
            private Executor mExecutor;


            /**
            /**
             * Create a Builder that detects nothing and has no violations. (but note that {@link
             * Creates a Builder that detects nothing and has no violations. (but note that {@link
             * #build} will default to enabling {@link #penaltyLog} if no other penalties are
             * #build} will default to enabling {@link #penaltyLog} if no other penalties are
             * specified)
             * specified)
             */
             */
@@ -508,7 +508,7 @@ public final class StrictMode {
                mMask = 0;
                mMask = 0;
            }
            }


            /** Initialize a Builder from an existing ThreadPolicy. */
            /** Initializes a Builder from an existing ThreadPolicy. */
            public Builder(ThreadPolicy policy) {
            public Builder(ThreadPolicy policy) {
                mMask = policy.mask;
                mMask = policy.mask;
                mListener = policy.mListener;
                mListener = policy.mListener;
@@ -516,7 +516,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect everything that's potentially suspect.
             * Detects everything that's potentially suspect.
             *
             *
             * <p>As of the Gingerbread release this includes network and disk operations but will
             * <p>As of the Gingerbread release this includes network and disk operations but will
             * likely expand in future releases.
             * likely expand in future releases.
@@ -543,52 +543,52 @@ public final class StrictMode {
                return this;
                return this;
            }
            }


            /** Disable the detection of everything. */
            /** Disables the detection of everything. */
            public @NonNull Builder permitAll() {
            public @NonNull Builder permitAll() {
                return disable(DETECT_THREAD_ALL);
                return disable(DETECT_THREAD_ALL);
            }
            }


            /** Enable detection of network operations. */
            /** Enables detection of network operations. */
            public @NonNull Builder detectNetwork() {
            public @NonNull Builder detectNetwork() {
                return enable(DETECT_THREAD_NETWORK);
                return enable(DETECT_THREAD_NETWORK);
            }
            }


            /** Disable detection of network operations. */
            /** Disables detection of network operations. */
            public @NonNull Builder permitNetwork() {
            public @NonNull Builder permitNetwork() {
                return disable(DETECT_THREAD_NETWORK);
                return disable(DETECT_THREAD_NETWORK);
            }
            }


            /** Enable detection of disk reads. */
            /** Enables detection of disk reads. */
            public @NonNull Builder detectDiskReads() {
            public @NonNull Builder detectDiskReads() {
                return enable(DETECT_THREAD_DISK_READ);
                return enable(DETECT_THREAD_DISK_READ);
            }
            }


            /** Disable detection of disk reads. */
            /** Disables detection of disk reads. */
            public @NonNull Builder permitDiskReads() {
            public @NonNull Builder permitDiskReads() {
                return disable(DETECT_THREAD_DISK_READ);
                return disable(DETECT_THREAD_DISK_READ);
            }
            }


            /** Enable detection of slow calls. */
            /** Enables detection of slow calls. */
            public @NonNull Builder detectCustomSlowCalls() {
            public @NonNull Builder detectCustomSlowCalls() {
                return enable(DETECT_THREAD_CUSTOM);
                return enable(DETECT_THREAD_CUSTOM);
            }
            }


            /** Disable detection of slow calls. */
            /** Disables detection of slow calls. */
            public @NonNull Builder permitCustomSlowCalls() {
            public @NonNull Builder permitCustomSlowCalls() {
                return disable(DETECT_THREAD_CUSTOM);
                return disable(DETECT_THREAD_CUSTOM);
            }
            }


            /** Disable detection of mismatches between defined resource types and getter calls. */
            /** Disables detection of mismatches between defined resource types and getter calls. */
            public @NonNull Builder permitResourceMismatches() {
            public @NonNull Builder permitResourceMismatches() {
                return disable(DETECT_THREAD_RESOURCE_MISMATCH);
                return disable(DETECT_THREAD_RESOURCE_MISMATCH);
            }
            }


            /** Detect unbuffered input/output operations. */
            /** Detects unbuffered input/output operations. */
            public @NonNull Builder detectUnbufferedIo() {
            public @NonNull Builder detectUnbufferedIo() {
                return enable(DETECT_THREAD_UNBUFFERED_IO);
                return enable(DETECT_THREAD_UNBUFFERED_IO);
            }
            }


            /** Disable detection of unbuffered input/output operations. */
            /** Disables detection of unbuffered input/output operations. */
            public @NonNull Builder permitUnbufferedIo() {
            public @NonNull Builder permitUnbufferedIo() {
                return disable(DETECT_THREAD_UNBUFFERED_IO);
                return disable(DETECT_THREAD_UNBUFFERED_IO);
            }
            }
@@ -609,32 +609,32 @@ public final class StrictMode {
                return enable(DETECT_THREAD_RESOURCE_MISMATCH);
                return enable(DETECT_THREAD_RESOURCE_MISMATCH);
            }
            }


            /** Enable detection of disk writes. */
            /** Enables detection of disk writes. */
            public @NonNull Builder detectDiskWrites() {
            public @NonNull Builder detectDiskWrites() {
                return enable(DETECT_THREAD_DISK_WRITE);
                return enable(DETECT_THREAD_DISK_WRITE);
            }
            }


            /** Disable detection of disk writes. */
            /** Disables detection of disk writes. */
            public @NonNull Builder permitDiskWrites() {
            public @NonNull Builder permitDiskWrites() {
                return disable(DETECT_THREAD_DISK_WRITE);
                return disable(DETECT_THREAD_DISK_WRITE);
            }
            }


            /**
            /**
             * Detect calls to {@link Runtime#gc()}.
             * Detects calls to {@link Runtime#gc()}.
             */
             */
            public @NonNull Builder detectExplicitGc() {
            public @NonNull Builder detectExplicitGc() {
                return enable(DETECT_THREAD_EXPLICIT_GC);
                return enable(DETECT_THREAD_EXPLICIT_GC);
            }
            }


            /**
            /**
             * Disable detection of calls to {@link Runtime#gc()}.
             * Disables detection of calls to {@link Runtime#gc()}.
             */
             */
            public @NonNull Builder permitExplicitGc() {
            public @NonNull Builder permitExplicitGc() {
                return disable(DETECT_THREAD_EXPLICIT_GC);
                return disable(DETECT_THREAD_EXPLICIT_GC);
            }
            }


            /**
            /**
             * Show an annoying dialog to the developer on detected violations, rate-limited to be
             * Shows an annoying dialog to the developer on detected violations, rate-limited to be
             * only a little annoying.
             * only a little annoying.
             */
             */
            public @NonNull Builder penaltyDialog() {
            public @NonNull Builder penaltyDialog() {
@@ -642,7 +642,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Crash the whole process on violation. This penalty runs at the end of all enabled
             * Crashes the whole process on violation. This penalty runs at the end of all enabled
             * penalties so you'll still get see logging or other violations before the process
             * penalties so you'll still get see logging or other violations before the process
             * dies.
             * dies.
             *
             *
@@ -654,7 +654,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Crash the whole process on any network usage. Unlike {@link #penaltyDeath}, this
             * Crashes the whole process on any network usage. Unlike {@link #penaltyDeath}, this
             * penalty runs <em>before</em> anything else. You must still have called {@link
             * penalty runs <em>before</em> anything else. You must still have called {@link
             * #detectNetwork} to enable this.
             * #detectNetwork} to enable this.
             *
             *
@@ -664,18 +664,18 @@ public final class StrictMode {
                return enable(PENALTY_DEATH_ON_NETWORK);
                return enable(PENALTY_DEATH_ON_NETWORK);
            }
            }


            /** Flash the screen during a violation. */
            /** Flashes the screen during a violation. */
            public @NonNull Builder penaltyFlashScreen() {
            public @NonNull Builder penaltyFlashScreen() {
                return enable(PENALTY_FLASH);
                return enable(PENALTY_FLASH);
            }
            }


            /** Log detected violations to the system log. */
            /** Logs detected violations to the system log. */
            public @NonNull Builder penaltyLog() {
            public @NonNull Builder penaltyLog() {
                return enable(PENALTY_LOG);
                return enable(PENALTY_LOG);
            }
            }


            /**
            /**
             * Enable detected violations log a stacktrace and timing data to the {@link
             * Enables detected violations log a stacktrace and timing data to the {@link
             * android.os.DropBoxManager DropBox} on policy violation. Intended mostly for platform
             * android.os.DropBoxManager DropBox} on policy violation. Intended mostly for platform
             * integrators doing beta user field data collection.
             * integrators doing beta user field data collection.
             */
             */
@@ -684,7 +684,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Call #{@link OnThreadViolationListener#onThreadViolation(Violation)} on specified
             * Calls #{@link OnThreadViolationListener#onThreadViolation(Violation)} on specified
             * executor every violation.
             * executor every violation.
             */
             */
            public @NonNull Builder penaltyListener(
            public @NonNull Builder penaltyListener(
@@ -714,7 +714,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Construct the ThreadPolicy instance.
             * Constructs the ThreadPolicy instance.
             *
             *
             * <p>Note: if no penalties are enabled before calling <code>build</code>, {@link
             * <p>Note: if no penalties are enabled before calling <code>build</code>, {@link
             * #penaltyLog} is implicitly set.
             * #penaltyLog} is implicitly set.
@@ -804,7 +804,7 @@ public final class StrictMode {
                mMask = 0;
                mMask = 0;
            }
            }


            /** Build upon an existing VmPolicy. */
            /** Builds upon an existing VmPolicy. */
            public Builder(VmPolicy base) {
            public Builder(VmPolicy base) {
                mMask = base.mask;
                mMask = base.mask;
                mClassInstanceLimitNeedCow = true;
                mClassInstanceLimitNeedCow = true;
@@ -814,7 +814,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Set an upper bound on how many instances of a class can be in memory at once. Helps
             * Sets an upper bound on how many instances of a class can be in memory at once. Helps
             * to prevent object leaks.
             * to prevent object leaks.
             */
             */
            public @NonNull Builder setClassInstanceLimit(Class klass, int instanceLimit) {
            public @NonNull Builder setClassInstanceLimit(Class klass, int instanceLimit) {
@@ -837,7 +837,7 @@ public final class StrictMode {
                return this;
                return this;
            }
            }


            /** Detect leaks of {@link android.app.Activity} subclasses. */
            /** Detects leaks of {@link android.app.Activity} subclasses. */
            public @NonNull Builder detectActivityLeaks() {
            public @NonNull Builder detectActivityLeaks() {
                return enable(DETECT_VM_ACTIVITY_LEAKS);
                return enable(DETECT_VM_ACTIVITY_LEAKS);
            }
            }
@@ -851,7 +851,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect reflective usage of APIs that are not part of the public Android SDK.
             * Detects reflective usage of APIs that are not part of the public Android SDK.
             *
             *
             * <p>Note that any non-SDK APIs that this processes accesses before this detection is
             * <p>Note that any non-SDK APIs that this processes accesses before this detection is
             * enabled may not be detected. To ensure that all such API accesses are detected,
             * enabled may not be detected. To ensure that all such API accesses are detected,
@@ -862,7 +862,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Permit reflective usage of APIs that are not part of the public Android SDK. Note
             * Permits reflective usage of APIs that are not part of the public Android SDK. Note
             * that this <b>only</b> affects {@code StrictMode}, the underlying runtime may
             * that this <b>only</b> affects {@code StrictMode}, the underlying runtime may
             * continue to restrict or warn on access to methods that are not part of the
             * continue to restrict or warn on access to methods that are not part of the
             * public SDK.
             * public SDK.
@@ -872,7 +872,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect everything that's potentially suspect.
             * Detects everything that's potentially suspect.
             *
             *
             * <p>In the Honeycomb release this includes leaks of SQLite cursors, Activities, and
             * <p>In the Honeycomb release this includes leaks of SQLite cursors, Activities, and
             * other closable objects but will likely expand in future releases.
             * other closable objects but will likely expand in future releases.
@@ -923,8 +923,8 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect when an {@link android.database.sqlite.SQLiteCursor} or other SQLite object is
             * Detects when an {@link android.database.sqlite.SQLiteCursor} or other SQLite
             * finalized without having been closed.
             * object is finalized without having been closed.
             *
             *
             * <p>You always want to explicitly close your SQLite cursors to avoid unnecessary
             * <p>You always want to explicitly close your SQLite cursors to avoid unnecessary
             * database contention and temporary memory leaks.
             * database contention and temporary memory leaks.
@@ -934,8 +934,8 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect when an {@link java.io.Closeable} or other object with an explicit termination
             * Detects when an {@link java.io.Closeable} or other object with an explicit
             * method is finalized without having been closed.
             * termination method is finalized without having been closed.
             *
             *
             * <p>You always want to explicitly close such objects to avoid unnecessary resources
             * <p>You always want to explicitly close such objects to avoid unnecessary resources
             * leaks.
             * leaks.
@@ -945,16 +945,16 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect when a {@link BroadcastReceiver} or {@link ServiceConnection} is leaked during
             * Detects when a {@link BroadcastReceiver} or {@link ServiceConnection} is leaked
             * {@link Context} teardown.
             * during {@link Context} teardown.
             */
             */
            public @NonNull Builder detectLeakedRegistrationObjects() {
            public @NonNull Builder detectLeakedRegistrationObjects() {
                return enable(DETECT_VM_REGISTRATION_LEAKS);
                return enable(DETECT_VM_REGISTRATION_LEAKS);
            }
            }


            /**
            /**
             * Detect when the calling application exposes a {@code file://} {@link android.net.Uri}
             * Detects when the calling application exposes a {@code file://}
             * to another app.
             * {@link android.net.Uri} to another app.
             *
             *
             * <p>This exposure is discouraged since the receiving app may not have access to the
             * <p>This exposure is discouraged since the receiving app may not have access to the
             * shared path. For example, the receiving app may not have requested the {@link
             * shared path. For example, the receiving app may not have requested the {@link
@@ -972,9 +972,9 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect any network traffic from the calling app which is not wrapped in SSL/TLS. This
             * Detects any network traffic from the calling app which is not wrapped in SSL/TLS.
             * can help you detect places that your app is inadvertently sending cleartext data
             * This can help you detect places that your app is inadvertently sending cleartext
             * across the network.
             * data across the network.
             *
             *
             * <p>Using {@link #penaltyDeath()} or {@link #penaltyDeathOnCleartextNetwork()} will
             * <p>Using {@link #penaltyDeath()} or {@link #penaltyDeathOnCleartextNetwork()} will
             * block further traffic on that socket to prevent accidental data leakage, in addition
             * block further traffic on that socket to prevent accidental data leakage, in addition
@@ -991,7 +991,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect when the calling application sends a {@code content://} {@link
             * Detects when the calling application sends a {@code content://} {@link
             * android.net.Uri} to another app without setting {@link
             * android.net.Uri} to another app without setting {@link
             * Intent#FLAG_GRANT_READ_URI_PERMISSION} or {@link
             * Intent#FLAG_GRANT_READ_URI_PERMISSION} or {@link
             * Intent#FLAG_GRANT_WRITE_URI_PERMISSION}.
             * Intent#FLAG_GRANT_WRITE_URI_PERMISSION}.
@@ -1007,7 +1007,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect any sockets in the calling app which have not been tagged using {@link
             * Detects any sockets in the calling app which have not been tagged using {@link
             * TrafficStats}. Tagging sockets can help you investigate network usage inside your
             * TrafficStats}. Tagging sockets can help you investigate network usage inside your
             * app, such as a narrowing down heavy usage to a specific library or component.
             * app, such as a narrowing down heavy usage to a specific library or component.
             *
             *
@@ -1027,7 +1027,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect any implicit reliance on Direct Boot automatic filtering
             * Detects any implicit reliance on Direct Boot automatic filtering
             * of {@link PackageManager} values. Violations are only triggered
             * of {@link PackageManager} values. Violations are only triggered
             * when implicit calls are made while the user is locked.
             * when implicit calls are made while the user is locked.
             * <p>
             * <p>
@@ -1050,7 +1050,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect access to filesystem paths stored in credential protected
             * Detects access to filesystem paths stored in credential protected
             * storage areas while the user is locked.
             * storage areas while the user is locked.
             * <p>
             * <p>
             * When a user is locked, credential protected storage is
             * When a user is locked, credential protected storage is
@@ -1071,7 +1071,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect attempts to invoke a method on a {@link Context} that is not suited for such
             * Detects attempts to invoke a method on a {@link Context} that is not suited for such
             * operation.
             * operation.
             * <p>An example of this is trying to obtain an instance of UI service (e.g.
             * <p>An example of this is trying to obtain an instance of UI service (e.g.
             * {@link android.view.WindowManager}) from a non-visual {@link Context}. This is not
             * {@link android.view.WindowManager}) from a non-visual {@link Context}. This is not
@@ -1085,7 +1085,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Disable detection of incorrect context use.
             * Disables detection of incorrect context use.
             *
             *
             * @see #detectIncorrectContextUse()
             * @see #detectIncorrectContextUse()
             *
             *
@@ -1097,7 +1097,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Detect when your app sends an unsafe {@link Intent}.
             * Detects when your app sends an unsafe {@link Intent}.
             * <p>
             * <p>
             * Violations may indicate security vulnerabilities in the design of
             * Violations may indicate security vulnerabilities in the design of
             * your app, where a malicious app could trick you into granting
             * your app, where a malicious app could trick you into granting
@@ -1138,7 +1138,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Permit your app to launch any {@link Intent} which originated
             * Permits your app to launch any {@link Intent} which originated
             * from outside your app.
             * from outside your app.
             * <p>
             * <p>
             * Disabling this check is <em>strongly discouraged</em>, as
             * Disabling this check is <em>strongly discouraged</em>, as
@@ -1213,13 +1213,13 @@ public final class StrictMode {
                return enable(PENALTY_DEATH_ON_FILE_URI_EXPOSURE);
                return enable(PENALTY_DEATH_ON_FILE_URI_EXPOSURE);
            }
            }


            /** Log detected violations to the system log. */
            /** Logs detected violations to the system log. */
            public @NonNull Builder penaltyLog() {
            public @NonNull Builder penaltyLog() {
                return enable(PENALTY_LOG);
                return enable(PENALTY_LOG);
            }
            }


            /**
            /**
             * Enable detected violations log a stacktrace and timing data to the {@link
             * Enables detected violations log a stacktrace and timing data to the {@link
             * android.os.DropBoxManager DropBox} on policy violation. Intended mostly for platform
             * android.os.DropBoxManager DropBox} on policy violation. Intended mostly for platform
             * integrators doing beta user field data collection.
             * integrators doing beta user field data collection.
             */
             */
@@ -1228,7 +1228,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Call #{@link OnVmViolationListener#onVmViolation(Violation)} on every violation.
             * Calls #{@link OnVmViolationListener#onVmViolation(Violation)} on every violation.
             */
             */
            public @NonNull Builder penaltyListener(
            public @NonNull Builder penaltyListener(
                    @NonNull Executor executor, @NonNull OnVmViolationListener listener) {
                    @NonNull Executor executor, @NonNull OnVmViolationListener listener) {
@@ -1257,7 +1257,7 @@ public final class StrictMode {
            }
            }


            /**
            /**
             * Construct the VmPolicy instance.
             * Constructs the VmPolicy instance.
             *
             *
             * <p>Note: if no penalties are enabled before calling <code>build</code>, {@link
             * <p>Note: if no penalties are enabled before calling <code>build</code>, {@link
             * #penaltyLog} is implicitly set.
             * #penaltyLog} is implicitly set.
@@ -1473,7 +1473,7 @@ public final class StrictMode {
    }
    }


    /**
    /**
     * Determine if the given app is "bundled" as part of the system image. These bundled apps are
     * Determines if the given app is "bundled" as part of the system image. These bundled apps are
     * developed in lock-step with the OS, and they aren't updated outside of an OTA, so we want to
     * developed in lock-step with the OS, and they aren't updated outside of an OTA, so we want to
     * chase any {@link StrictMode} regressions by enabling detection when running on {@link
     * chase any {@link StrictMode} regressions by enabling detection when running on {@link
     * Build#IS_USERDEBUG} or {@link Build#IS_ENG} builds.
     * Build#IS_USERDEBUG} or {@link Build#IS_ENG} builds.
@@ -1511,7 +1511,7 @@ public final class StrictMode {
    }
    }


    /**
    /**
     * Initialize default {@link ThreadPolicy} for the current thread.
     * Initializes default {@link ThreadPolicy} for the current thread.
     *
     *
     * @hide
     * @hide
     */
     */
@@ -1546,7 +1546,7 @@ public final class StrictMode {
    }
    }


    /**
    /**
     * Initialize default {@link VmPolicy} for the current VM.
     * Initializes default {@link VmPolicy} for the current VM.
     *
     *
     * @hide
     * @hide
     */
     */
@@ -2240,7 +2240,7 @@ public final class StrictMode {
    }
    }


    /**
    /**
     * Enable the recommended StrictMode defaults, with violations just being logged.
     * Enables the recommended StrictMode defaults, with violations just being logged.
     *
     *
     * <p>This catches disk and network access on the main thread, as well as leaked SQLite cursors
     * <p>This catches disk and network access on the main thread, as well as leaked SQLite cursors
     * and unclosed resources. This is simply a wrapper around {@link #setVmPolicy} and {@link
     * and unclosed resources. This is simply a wrapper around {@link #setVmPolicy} and {@link
@@ -2541,7 +2541,7 @@ public final class StrictMode {
    private static final SparseLongArray sRealLastVmViolationTime = new SparseLongArray();
    private static final SparseLongArray sRealLastVmViolationTime = new SparseLongArray();


    /**
    /**
     * Clamp the given map by removing elements with timestamp older than the given retainSince.
     * Clamps the given map by removing elements with timestamp older than the given retainSince.
     */
     */
    private static void clampViolationTimeMap(final @NonNull SparseLongArray violationTime,
    private static void clampViolationTimeMap(final @NonNull SparseLongArray violationTime,
            final long retainSince) {
            final long retainSince) {
@@ -2808,7 +2808,7 @@ public final class StrictMode {
            };
            };


    /**
    /**
     * Enter a named critical span (e.g. an animation)
     * Enters a named critical span (e.g. an animation)
     *
     *
     * <p>The name is an arbitary label (or tag) that will be applied to any strictmode violation
     * <p>The name is an arbitary label (or tag) that will be applied to any strictmode violation
     * that happens while this span is active. You must call finish() on the span when done.
     * that happens while this span is active. You must call finish() on the span when done.
@@ -3052,7 +3052,7 @@ public final class StrictMode {
        /** If this is a instance count violation, the number of instances in memory, else -1. */
        /** If this is a instance count violation, the number of instances in memory, else -1. */
        public long numInstances = -1;
        public long numInstances = -1;


        /** Create an instance of ViolationInfo initialized from an exception. */
        /** Creates an instance of ViolationInfo initialized from an exception. */
        ViolationInfo(Violation tr, int penaltyMask) {
        ViolationInfo(Violation tr, int penaltyMask) {
            this.mViolation = tr;
            this.mViolation = tr;
            this.mPenaltyMask = penaltyMask;
            this.mPenaltyMask = penaltyMask;
@@ -3127,8 +3127,8 @@ public final class StrictMode {
        }
        }


        /**
        /**
         * Add a {@link Throwable} from the current process that caused the underlying violation. We
         * Adds a {@link Throwable} from the current process that caused the underlying violation.
         * only preserve the stack trace elements.
         * We only preserve the stack trace elements.
         *
         *
         * @hide
         * @hide
         */
         */
@@ -3156,14 +3156,14 @@ public final class StrictMode {
            return result;
            return result;
        }
        }


        /** Create an instance of ViolationInfo initialized from a Parcel. */
        /** Creates an instance of ViolationInfo initialized from a Parcel. */
        @UnsupportedAppUsage
        @UnsupportedAppUsage
        public ViolationInfo(Parcel in) {
        public ViolationInfo(Parcel in) {
            this(in, false);
            this(in, false);
        }
        }


        /**
        /**
         * Create an instance of ViolationInfo initialized from a Parcel.
         * Creates an instance of ViolationInfo initialized from a Parcel.
         *
         *
         * @param unsetGatheringBit if true, the caller is the root caller and the gathering penalty
         * @param unsetGatheringBit if true, the caller is the root caller and the gathering penalty
         *     should be removed.
         *     should be removed.
@@ -3199,7 +3199,7 @@ public final class StrictMode {
            tags = in.readStringArray();
            tags = in.readStringArray();
        }
        }


        /** Save a ViolationInfo instance to a parcel. */
        /** Saves a ViolationInfo instance to a parcel. */
        @Override
        @Override
        public void writeToParcel(Parcel dest, int flags) {
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeSerializable(mViolation);
            dest.writeSerializable(mViolation);
@@ -3244,7 +3244,7 @@ public final class StrictMode {
            }
            }
        }
        }


        /** Dump a ViolationInfo instance to a Printer. */
        /** Dumps a ViolationInfo instance to a Printer. */
        public void dump(Printer pw, String prefix) {
        public void dump(Printer pw, String prefix) {
            pw.println(prefix + "stackTrace: " + getStackTrace());
            pw.println(prefix + "stackTrace: " + getStackTrace());
            pw.println(prefix + "penalty: " + mPenaltyMask);
            pw.println(prefix + "penalty: " + mPenaltyMask);