/** Implement the Parcelable interface */ public void writeToParcel(Parcel dest, int flags) { dest.writeString(bssid); dest.writeInt(configured ? 1 : 0); dest.writeInt(ipAddress); dest.writeInt(linkSpeed); dest.writeInt(networkId); dest.writeInt(primary ? 1 : 0); dest.writeInt(priority); dest.writeInt(hiddenSsid ? 1 : 0); dest.writeString(security); dest.writeInt(seen ? 1 : 0); dest.writeInt(disabled ? 1 : 0); dest.writeInt(signal); dest.writeString(ssid); dest.writeString(status != null ? status.toString() : null); dest.writeString(mPassword); dest.writeInt(mConfigHadPassword ? 1 : 0); dest.writeInt(mWepPasswordType); }
public AccessPointState createFromParcel(Parcel in) { AccessPointState state = new AccessPointState(); state.bssid = in.readString(); state.configured = in.readInt() == 1; state.ipAddress = in.readInt(); state.linkSpeed = in.readInt(); state.networkId = in.readInt(); state.primary = in.readInt() == 1; state.priority = in.readInt(); state.hiddenSsid = in.readInt() == 1; state.security = in.readString(); state.seen = in.readInt() == 1; state.disabled = in.readInt() == 1; state.signal = in.readInt(); state.ssid = in.readString(); String statusStr = in.readString(); if (statusStr != null) { state.status = NetworkInfo.DetailedState.valueOf(statusStr); } state.mPassword = in.readString(); state.mConfigHadPassword = in.readInt() == 1; state.mWepPasswordType = in.readInt(); return state; }