Loading common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java +14 −4 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,9 @@ import android.net.ScanResultInfoParcelable; import android.net.StaticIpConfiguration; import android.net.StaticIpConfiguration; import android.net.apf.ApfCapabilities; import android.net.apf.ApfCapabilities; import android.net.ip.IIpClient; import android.net.ip.IIpClient; import android.util.Log; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.ArrayList; import java.util.Arrays; import java.util.Arrays; Loading Loading @@ -61,6 +63,8 @@ import java.util.StringJoiner; * @hide * @hide */ */ public class ProvisioningConfiguration { public class ProvisioningConfiguration { private static final String TAG = "ProvisioningConfiguration"; // TODO: Delete this default timeout once those callers that care are // TODO: Delete this default timeout once those callers that care are // fixed to pass in their preferred timeout. // fixed to pass in their preferred timeout. // // Loading Loading @@ -281,7 +285,7 @@ public class ProvisioningConfiguration { public InformationElementParcelable toStableParcelable() { public InformationElementParcelable toStableParcelable() { final InformationElementParcelable p = new InformationElementParcelable(); final InformationElementParcelable p = new InformationElementParcelable(); p.id = mId; p.id = mId; p.payload = mPayload.clone(); p.payload = mPayload != null ? mPayload.clone() : null; return p; return p; } } Loading Loading @@ -367,12 +371,18 @@ public class ProvisioningConfiguration { private static byte[] convertToByteArray(final ByteBuffer buffer) { private static byte[] convertToByteArray(final ByteBuffer buffer) { if (buffer == null) return null; if (buffer == null) return null; byte[] bytes = new byte[buffer.limit()]; final byte[] bytes = new byte[buffer.limit()]; final ByteBuffer copy = buffer.asReadOnlyBuffer(); final ByteBuffer copy = buffer.asReadOnlyBuffer(); try { copy.position(0); copy.get(bytes); copy.get(bytes); } catch (BufferUnderflowException e) { Log.wtf(TAG, "Buffer under flow exception should never happen."); } finally { return bytes; return bytes; } } } } } public boolean mEnableIPv4 = true; public boolean mEnableIPv4 = true; public boolean mEnableIPv6 = true; public boolean mEnableIPv6 = true; Loading Loading
common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java +14 −4 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,9 @@ import android.net.ScanResultInfoParcelable; import android.net.StaticIpConfiguration; import android.net.StaticIpConfiguration; import android.net.apf.ApfCapabilities; import android.net.apf.ApfCapabilities; import android.net.ip.IIpClient; import android.net.ip.IIpClient; import android.util.Log; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.ArrayList; import java.util.Arrays; import java.util.Arrays; Loading Loading @@ -61,6 +63,8 @@ import java.util.StringJoiner; * @hide * @hide */ */ public class ProvisioningConfiguration { public class ProvisioningConfiguration { private static final String TAG = "ProvisioningConfiguration"; // TODO: Delete this default timeout once those callers that care are // TODO: Delete this default timeout once those callers that care are // fixed to pass in their preferred timeout. // fixed to pass in their preferred timeout. // // Loading Loading @@ -281,7 +285,7 @@ public class ProvisioningConfiguration { public InformationElementParcelable toStableParcelable() { public InformationElementParcelable toStableParcelable() { final InformationElementParcelable p = new InformationElementParcelable(); final InformationElementParcelable p = new InformationElementParcelable(); p.id = mId; p.id = mId; p.payload = mPayload.clone(); p.payload = mPayload != null ? mPayload.clone() : null; return p; return p; } } Loading Loading @@ -367,12 +371,18 @@ public class ProvisioningConfiguration { private static byte[] convertToByteArray(final ByteBuffer buffer) { private static byte[] convertToByteArray(final ByteBuffer buffer) { if (buffer == null) return null; if (buffer == null) return null; byte[] bytes = new byte[buffer.limit()]; final byte[] bytes = new byte[buffer.limit()]; final ByteBuffer copy = buffer.asReadOnlyBuffer(); final ByteBuffer copy = buffer.asReadOnlyBuffer(); try { copy.position(0); copy.get(bytes); copy.get(bytes); } catch (BufferUnderflowException e) { Log.wtf(TAG, "Buffer under flow exception should never happen."); } finally { return bytes; return bytes; } } } } } public boolean mEnableIPv4 = true; public boolean mEnableIPv4 = true; public boolean mEnableIPv6 = true; public boolean mEnableIPv6 = true; Loading