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

Commit a4b20522 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Clean up easy Bitmap dependencies

Bug: 150395371
Test: make

- Mark mDensity as package-protected, since it is not used elsewhere.
- Document getNativeInstance, getOpticalInsets, getNinePatchInsets,
  and scaleFromDensity - where they are called, and that they should not
  be called from outside the module.
- Mark setImmutable as private. No outside callers use it.

Change-Id: I85efe4829e2914222696aa659f8a21b699c3d788
parent 7d96ce57
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -90,8 +90,7 @@ public final class Bitmap implements Parcelable {

    private ColorSpace mColorSpace;

    /** @hide */
    public int mDensity = getDefaultDensity();
    /*package*/ int mDensity = getDefaultDensity();

    private static volatile int sDefaultDensity = -1;

@@ -174,7 +173,10 @@ public final class Bitmap implements Parcelable {

    /**
     * Return the pointer to the native object.
     *
     * @hide
     * Must be public for access from android.graphics.pdf,
     * but must not be called from outside the UI module.
     */
    public long getNativeInstance() {
        return mNativePtr;
@@ -1340,7 +1342,10 @@ public final class Bitmap implements Parcelable {
     * Populates a rectangle with the bitmap's optical insets.
     *
     * @param outInsets Rect to populate with optical insets
     *
     * @hide
     * Must be public for access from android.graphics.drawable,
     * but must not be called from outside the UI module.
     */
    public void getOpticalInsets(@NonNull Rect outInsets) {
        if (mNinePatchInsets == null) {
@@ -1350,7 +1355,11 @@ public final class Bitmap implements Parcelable {
        }
    }

    /** @hide */
    /**
     * @hide
     * Must be public for access from android.graphics.drawable,
     * but must not be called from outside the UI module.
     */
    public NinePatch.InsetStruct getNinePatchInsets() {
        return mNinePatchInsets;
    }
@@ -1456,10 +1465,8 @@ public final class Bitmap implements Parcelable {
     * to {@link #reconfigure(int, int, Config)}, {@link #setPixel(int, int, int)},
     * {@link #setPixels(int[], int, int, int, int, int, int)} and {@link #eraseColor(int)} will
     * fail and throw an IllegalStateException.
     *
     * @hide
     */
    public void setImmutable() {
    private void setImmutable() {
        if (isMutable()) {
            nativeSetImmutable(mNativePtr);
        }
@@ -1603,6 +1610,8 @@ public final class Bitmap implements Parcelable {

    /**
     * @hide
     * Must be public for access from android.graphics.drawable,
     * but must not be called from outside the UI module.
     */
    @UnsupportedAppUsage
    static public int scaleFromDensity(int size, int sdensity, int tdensity) {