Expose DhcpInfo parcelable interface implementation methods

Parcelable class requires a CREATOR field be exposed.

Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests
      atest android.net.cts

Change-Id: I41c68406d09014dda99f337add8c0db0298b0582
This commit is contained in:
Aaron Huang
2020-01-09 20:52:55 +08:00
parent 8124da436a
commit cf22d1a29f

View File

@@ -16,8 +16,8 @@
package android.net; package android.net;
import android.os.Parcelable;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable;
/** /**
* A simple object for retrieving the results of a DHCP request. * A simple object for retrieving the results of a DHCP request.
@@ -67,12 +67,12 @@ public class DhcpInfo implements Parcelable {
buf.append(NetworkUtils.intToInetAddress(addr).getHostAddress()); buf.append(NetworkUtils.intToInetAddress(addr).getHostAddress());
} }
/** Implement the Parcelable interface {@hide} */ /** Implement the Parcelable interface */
public int describeContents() { public int describeContents() {
return 0; return 0;
} }
/** Implement the Parcelable interface {@hide} */ /** Implement the Parcelable interface */
public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(ipAddress); dest.writeInt(ipAddress);
dest.writeInt(gateway); dest.writeInt(gateway);
@@ -83,7 +83,7 @@ public class DhcpInfo implements Parcelable {
dest.writeInt(leaseDuration); dest.writeInt(leaseDuration);
} }
/** Implement the Parcelable interface {@hide} */ /** Implement the Parcelable interface */
public static final @android.annotation.NonNull Creator<DhcpInfo> CREATOR = public static final @android.annotation.NonNull Creator<DhcpInfo> CREATOR =
new Creator<DhcpInfo>() { new Creator<DhcpInfo>() {
public DhcpInfo createFromParcel(Parcel in) { public DhcpInfo createFromParcel(Parcel in) {