Merge changes from topic 'disabled-reason' am: d0fc3f1383
am: b858ffbe42
Change-Id: I5138cd1713ccecac8fa304275aec88734c040ffb
This commit is contained in:
@@ -1301,6 +1301,7 @@ public class WifiConfiguration implements Parcelable {
|
||||
setConnectChoice(source.getConnectChoice());
|
||||
setConnectChoiceTimestamp(source.getConnectChoiceTimestamp());
|
||||
setHasEverConnected(source.getHasEverConnected());
|
||||
setNotRecommended(source.isNotRecommended());
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.net.wifi.WifiConfiguration.NetworkSelectionStatus;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -66,4 +67,35 @@ public class WifiConfigurationTest {
|
||||
|
||||
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