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

Commit d471c9e3 authored by RD Babiera's avatar RD Babiera
Browse files

DisplayPort alt mode and UsbPortStatus api doc fixes

Removes return Javadocs on methods that use intdef return types.
Fixes wording on getPlugState(), and adds new defintion to
PLUG_STATE_UNKNOWN.

Test: atest CtsUsbManagerTestCases
Bug: 265897347
Change-Id: Ic874a95ea2540b82a1fc8ea1f5544a87cdf7ac45
parent 833ba23f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5818,7 +5818,7 @@ package android.hardware.usb {
    method public boolean isHotPlugDetectActive();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.usb.DisplayPortAltModeInfo> CREATOR;
    field public static final int DISPLAYPORT_ALT_MODE_STATUS_CAPABLE = 2; // 0x2
    field public static final int DISPLAYPORT_ALT_MODE_STATUS_CAPABLE_DISABLED = 2; // 0x2
    field public static final int DISPLAYPORT_ALT_MODE_STATUS_ENABLED = 3; // 0x3
    field public static final int DISPLAYPORT_ALT_MODE_STATUS_NOT_CAPABLE = 1; // 0x1
    field public static final int DISPLAYPORT_ALT_MODE_STATUS_UNKNOWN = 0; // 0x0
+2 −10
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public final class DisplayPortAltModeInfo implements Parcelable {
     * as one of its capabilities, however may not yet have entered DisplayPort Alt Mode or has been
     * configured for data transmission.
     */
    public static final int DISPLAYPORT_ALT_MODE_STATUS_CAPABLE = 2;
    public static final int DISPLAYPORT_ALT_MODE_STATUS_CAPABLE_DISABLED = 2;

    /**
     * Port Partners:
@@ -113,7 +113,7 @@ public final class DisplayPortAltModeInfo implements Parcelable {
    @IntDef(prefix = { "DISPLAYPORT_ALT_MODE_STATUS_" }, value = {
            DISPLAYPORT_ALT_MODE_STATUS_UNKNOWN,
            DISPLAYPORT_ALT_MODE_STATUS_NOT_CAPABLE,
            DISPLAYPORT_ALT_MODE_STATUS_CAPABLE,
            DISPLAYPORT_ALT_MODE_STATUS_CAPABLE_DISABLED,
            DISPLAYPORT_ALT_MODE_STATUS_ENABLED,
    })
    @Retention(RetentionPolicy.SOURCE)
@@ -150,10 +150,6 @@ public final class DisplayPortAltModeInfo implements Parcelable {
    /**
     * Returns the DisplayPort Alt Mode Status for a port partner acting as a sink.
     *
     * @return {@link #DISPLAYPORT_ALT_MODE_STATUS_UNKNOWN}
     *        or {@link #DISPLAYPORT_ALT_MODE_STATUS_NOT_CAPABLE}
     *        or {@link #DISPLAYPORT_ALT_MODE_STATUS_CAPABLE}
     *        or {@link #DISPLAYPORT_ALT_MODE_STATUS_ENABLED}
     */
    public @DisplayPortAltModeStatus int getPartnerSinkStatus() {
        return mPartnerSinkStatus;
@@ -162,10 +158,6 @@ public final class DisplayPortAltModeInfo implements Parcelable {
    /**
     * Returns the DisplayPort Alt Mode Status for the attached cable
     *
     * @return {@link #DISPLAYPORT_ALT_MODE_STATUS_UNKNOWN}
     *        or {@link #DISPLAYPORT_ALT_MODE_STATUS_NOT_CAPABLE}
     *        or {@link #DISPLAYPORT_ALT_MODE_STATUS_CAPABLE}
     *        or {@link #DISPLAYPORT_ALT_MODE_STATUS_ENABLED}
     */
    public @DisplayPortAltModeStatus int getCableStatus() {
        return mCableStatus;
+3 −3
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ import static android.hardware.usb.UsbPortStatus.COMPLIANCE_WARNING_MISSING_RP;
import static android.hardware.usb.UsbPortStatus.COMPLIANCE_WARNING_OTHER;
import static android.hardware.usb.DisplayPortAltModeInfo.DISPLAYPORT_ALT_MODE_STATUS_UNKNOWN;
import static android.hardware.usb.DisplayPortAltModeInfo.DISPLAYPORT_ALT_MODE_STATUS_NOT_CAPABLE;
import static android.hardware.usb.DisplayPortAltModeInfo.DISPLAYPORT_ALT_MODE_STATUS_CAPABLE;
import static android.hardware.usb.DisplayPortAltModeInfo.DISPLAYPORT_ALT_MODE_STATUS_CAPABLE_DISABLED;
import static android.hardware.usb.DisplayPortAltModeInfo.DISPLAYPORT_ALT_MODE_STATUS_ENABLED;

import android.Manifest;
@@ -807,8 +807,8 @@ public final class UsbPort {
                return "Unknown";
            case DISPLAYPORT_ALT_MODE_STATUS_NOT_CAPABLE:
                return "Not Capable";
            case DISPLAYPORT_ALT_MODE_STATUS_CAPABLE:
                return "Capable";
            case DISPLAYPORT_ALT_MODE_STATUS_CAPABLE_DISABLED:
                return "Capable-Disabled";
            case DISPLAYPORT_ALT_MODE_STATUS_ENABLED:
                return "Enabled";
            default:
+2 −7
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ public final class UsbPortStatus implements Parcelable {

    /**
     * Indicates that the Type-C plug orientation cannot be
     * determined.
     * determined because the connected state of the device is unknown.
     */
    public static final int PLUG_STATE_UNKNOWN = 0;

@@ -600,13 +600,8 @@ public final class UsbPortStatus implements Parcelable {
    }

    /**
     * Returns the orientation state of the attached cable/adapter.
     * Returns the plug state of the attached cable/adapter.
     *
     * @return one of {@link #PLUG_STATE_UNKNOWN},
     *                {@link #PLUG_STATE_UNPLUGGED},
     *                {@link #PLUG_STATE_PLUGGED_ORIENTATION_UNKNOWN},
     *                {@link #PLUG_STATE_PLUGGED_ORIENTATION_NORMAL},
     *                {@link #PLUG_STATE_PLUGGED_ORIENTATION_FLIPPED},
     */
    public @PlugState int getPlugState() {
        return mPlugState;