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

Commit f2d993ae authored by Alec Mouri's avatar Alec Mouri
Browse files

Remove Point#dump

This is in response to API feedback - dump() methods for most of the
public classes describe complex internal state, which does not fit for
the Point class. Point#dump does not need to exist anyways, because
1. Point#toString exists, and
2. Point#dump only printed out the x,y coordinates, which are already
part of the public api, so printing out a more concise string
representation is trivial.

So, this patch removes Point#dump and just has RemoteAnimationTarget
implement its own print method for Point, since it was the only caller.

Bug: 159683987
Test: builds
Change-Id: I5c947330768b3e4e450eba3971de939a904d30d4
parent 82231edf
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -15463,7 +15463,6 @@ package android.graphics {
    ctor public Point(int, int);
    ctor public Point(@NonNull android.graphics.Point);
    method public int describeContents();
    method public final void dump(@NonNull java.io.PrintWriter);
    method public final boolean equals(int, int);
    method public final void negate();
    method public final void offset(int, int);
+5 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ public class RemoteAnimationTarget implements Parcelable {
        pw.print(" clipRect="); clipRect.printShortString(pw);
        pw.print(" contentInsets="); contentInsets.printShortString(pw);
        pw.print(" prefixOrderIndex="); pw.print(prefixOrderIndex);
        pw.print(" position="); position.dump(pw);
        pw.print(" position="); printPoint(position, pw);
        pw.print(" sourceContainerBounds="); sourceContainerBounds.printShortString(pw);
        pw.print(" screenSpaceBounds="); screenSpaceBounds.printShortString(pw);
        pw.print(" localBounds="); localBounds.printShortString(pw);
@@ -303,6 +303,10 @@ public class RemoteAnimationTarget implements Parcelable {
        proto.end(token);
    }

    private static void printPoint(Point p, PrintWriter pw) {
        pw.print("["); pw.print(p.x); pw.print(","); pw.print(p.y); pw.print("]");
    }

    public static final @android.annotation.NonNull Creator<RemoteAnimationTarget> CREATOR
            = new Creator<RemoteAnimationTarget>() {
        public RemoteAnimationTarget createFromParcel(Parcel in) {
+0 −13
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@ import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;

import java.io.PrintWriter;

/**
 * Point holds two integer coordinates
 */
@@ -72,17 +70,6 @@ public class Point implements Parcelable {
        return this.x == x && this.y == y;
    }

    /**
     * Dumps a human-readable shortened string of the point into the given
     * stream
     *
     * @param pw The {@link PrintWriter} into which the string representation of
     *           the point will be written.
     */
    public final void dump(@NonNull PrintWriter pw) {
        pw.print("["); pw.print(x); pw.print(","); pw.print(y); pw.print("]");
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;