Merge changes from topic 'disabled-reason'
am: d0fc3f1383
Change-Id: I09e7dff673a56fb3c51cde827ae783da32407a70
This commit is contained in:
@@ -1301,6 +1301,7 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
setConnectChoice(source.getConnectChoice());
|
setConnectChoice(source.getConnectChoice());
|
||||||
setConnectChoiceTimestamp(source.getConnectChoiceTimestamp());
|
setConnectChoiceTimestamp(source.getConnectChoiceTimestamp());
|
||||||
setHasEverConnected(source.getHasEverConnected());
|
setHasEverConnected(source.getHasEverConnected());
|
||||||
|
setNotRecommended(source.isNotRecommended());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeToParcel(Parcel dest) {
|
public void writeToParcel(Parcel dest) {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertArrayEquals;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
import android.net.wifi.WifiConfiguration.NetworkSelectionStatus;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -66,4 +67,35 @@ public class WifiConfigurationTest {
|
|||||||
|
|
||||||
assertArrayEquals(bytes, rebytes);
|
assertArrayEquals(bytes, rebytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testNetworkSelectionStatusCopy() {
|
||||||
|
NetworkSelectionStatus networkSelectionStatus = new NetworkSelectionStatus();
|
||||||
|
networkSelectionStatus.setNotRecommended(true);
|
||||||
|
|
||||||
|
NetworkSelectionStatus copy = new NetworkSelectionStatus();
|
||||||
|
copy.copy(networkSelectionStatus);
|
||||||
|
|
||||||
|
assertEquals(networkSelectionStatus.isNotRecommended(), copy.isNotRecommended());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testNetworkSelectionStatusParcel() {
|
||||||
|
NetworkSelectionStatus networkSelectionStatus = new NetworkSelectionStatus();
|
||||||
|
networkSelectionStatus.setNotRecommended(true);
|
||||||
|
|
||||||
|
Parcel parcelW = Parcel.obtain();
|
||||||
|
networkSelectionStatus.writeToParcel(parcelW);
|
||||||
|
byte[] bytes = parcelW.marshall();
|
||||||
|
parcelW.recycle();
|
||||||
|
|
||||||
|
Parcel parcelR = Parcel.obtain();
|
||||||
|
parcelR.unmarshall(bytes, 0, bytes.length);
|
||||||
|
parcelR.setDataPosition(0);
|
||||||
|
|
||||||
|
NetworkSelectionStatus copy = new NetworkSelectionStatus();
|
||||||
|
copy.readFromParcel(parcelR);
|
||||||
|
|
||||||
|
assertEquals(networkSelectionStatus.isNotRecommended(), copy.isNotRecommended());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user