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

Commit b596198d authored by Carl Shapiro's avatar Carl Shapiro
Browse files

Remove functionality related to external allocation tracking.

The android.os.Debug class exposed two interfaces related to external
allocation.  The first interface provided a counter of global external
allocation events.  This change makes the global counter getters
constantly return 0 and stubs out the counter setters.  The second
interface attempted to provide a counter of per-thread external
allocation events.  That interface was never implemented.  This change
makes the per-thread counter getters constantly return -1 and stubs
out the setters.

Change-Id: I240fe9bf05297a83607a4350d40d20581e2a9e2f
parent ed4127cc
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -138970,7 +138970,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139014,7 +139014,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139025,7 +139025,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139036,7 +139036,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139047,7 +139047,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139058,7 +139058,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139069,7 +139069,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139080,7 +139080,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139091,7 +139091,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139102,7 +139102,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139113,7 +139113,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -139124,7 +139124,7 @@
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -252121,7 +252121,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="arg0" type="T">
<parameter name="t" type="T">
</parameter>
</method>
</interface>
+124 −24
Original line number Diff line number Diff line
@@ -559,18 +559,55 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo
        /* cumulative elapsed time for class initialization, in usec */
        return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_TIME);
    }

    /**
     * Returns the global count of external allocation requests.  Now
     * that external allocation tracking no longer exists this method
     * always returns 0.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static int getGlobalExternalAllocCount() {
        return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_EXT_ALLOCATED_OBJECTS);
        return 0;
    }

    /**
     * Returns the global count of bytes externally allocated.  Now
     * that external allocation tracking no longer exists this method
     * always returns 0.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static int getGlobalExternalAllocSize() {
        return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_EXT_ALLOCATED_BYTES);
        return 0;
    }

    /**
     * Returns the global count of freed external allocation requests.
     * Now that external allocation tracking no longer exists this
     * method always returns 0.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static int getGlobalExternalFreedCount() {
        return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_EXT_FREED_OBJECTS);
        return 0;
    }

    /**
     * Returns the global count of freed bytes from external
     * allocation requests.  Now that external allocation tracking no
     * longer exists this method always returns 0.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static int getGlobalExternalFreedSize() {
        return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_EXT_FREED_BYTES);
        return 0;
    }

    public static int getGlobalGcInvocationCount() {
        return VMDebug.getAllocCount(VMDebug.KIND_GLOBAL_GC_INVOCATIONS);
    }
@@ -580,12 +617,31 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo
    public static int getThreadAllocSize() {
        return VMDebug.getAllocCount(VMDebug.KIND_THREAD_ALLOCATED_BYTES);
    }

    /**
     * Returns the count of external allocation requests made by the
     * current thread.  Now that external allocation tracking no
     * longer exists this method always returns 0.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static int getThreadExternalAllocCount() {
        return VMDebug.getAllocCount(VMDebug.KIND_THREAD_EXT_ALLOCATED_OBJECTS);
        return 0;
    }

    /**
     * Returns the global count of bytes externally allocated.  Now
     * that external allocation tracking no longer exists this method
     * always returns 0.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static int getThreadExternalAllocSize() {
        return VMDebug.getAllocCount(VMDebug.KIND_THREAD_EXT_ALLOCATED_BYTES);
        return 0;
    }

    public static int getThreadGcInvocationCount() {
        return VMDebug.getAllocCount(VMDebug.KIND_THREAD_GC_INVOCATIONS);
    }
@@ -608,18 +664,47 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo
    public static void resetGlobalClassInitTime() {
        VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_CLASS_INIT_TIME);
    }
    public static void resetGlobalExternalAllocCount() {
        VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_EXT_ALLOCATED_OBJECTS);
    }
    public static void resetGlobalExternalAllocSize() {
        VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_EXT_ALLOCATED_BYTES);
    }
    public static void resetGlobalExternalFreedCount() {
        VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_EXT_FREED_OBJECTS);
    }
    public static void resetGlobalExternalFreedSize() {
        VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_EXT_FREED_BYTES);
    }

    /**
     * Resets the global count of external allocation requests.  Now
     * that external allocation tracking has been removed this method
     * has no effect.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static void resetGlobalExternalAllocCount() {}

    /**
     * Resets the global count of bytes externally allocated.  Now
     * that external allocation tracking has been removed this method
     * has no effect.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static void resetGlobalExternalAllocSize() {}

    /**
     * Resets the global count of freed external allocations.  Now
     * that external allocation tracking has been removed this method
     * has no effect.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static void resetGlobalExternalFreedCount() {}

    /**
     * Resets the global count counter of freed bytes from external
     * allocations.  Now that external allocation tracking has been
     * removed this method has no effect.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static void resetGlobalExternalFreedSize() {}

    public static void resetGlobalGcInvocationCount() {
        VMDebug.resetAllocCount(VMDebug.KIND_GLOBAL_GC_INVOCATIONS);
    }
@@ -629,12 +714,27 @@ href="{@docRoot}guide/developing/tools/traceview.html">Traceview: A Graphical Lo
    public static void resetThreadAllocSize() {
        VMDebug.resetAllocCount(VMDebug.KIND_THREAD_ALLOCATED_BYTES);
    }
    public static void resetThreadExternalAllocCount() {
        VMDebug.resetAllocCount(VMDebug.KIND_THREAD_EXT_ALLOCATED_OBJECTS);
    }
    public static void resetThreadExternalAllocSize() {
        VMDebug.resetAllocCount(VMDebug.KIND_THREAD_EXT_ALLOCATED_BYTES);
    }

    /**
     * Resets the count of external allocation requests made by the
     * current thread.  Now that external allocation tracking has been
     * removed this method has no effect.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static void resetThreadExternalAllocCount() {}

    /**
     * Resets the count of bytes externally allocated by the current
     * thread.  Now that external allocation tracking has been removed
     * this method has no effect.
     *
     * @deprecated This method is now obsolete.
     */
    @Deprecated
    public static void resetThreadExternalAllocSize() {}

    public static void resetThreadGcInvocationCount() {
        VMDebug.resetAllocCount(VMDebug.KIND_THREAD_GC_INVOCATIONS);
    }