Merge "Remove user-triggered disconnect counters" am: 2007ee8de3
am: b8d3324bb7
Change-Id: Iaf564f5428e3d91773bb0bd6743340f55dd192db
This commit is contained in:
@@ -746,50 +746,6 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
@SystemApi
|
@SystemApi
|
||||||
public int numAssociation;
|
public int numAssociation;
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
* Number of time user disabled WiFi while associated to this configuration with Low RSSI.
|
|
||||||
*/
|
|
||||||
public int numUserTriggeredWifiDisableLowRSSI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
* Number of time user disabled WiFi while associated to this configuration with Bad RSSI.
|
|
||||||
*/
|
|
||||||
public int numUserTriggeredWifiDisableBadRSSI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
* Number of time user disabled WiFi while associated to this configuration
|
|
||||||
* and RSSI was not HIGH.
|
|
||||||
*/
|
|
||||||
public int numUserTriggeredWifiDisableNotHighRSSI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
* Number of ticks associated to this configuration with Low RSSI.
|
|
||||||
*/
|
|
||||||
public int numTicksAtLowRSSI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
* Number of ticks associated to this configuration with Bad RSSI.
|
|
||||||
*/
|
|
||||||
public int numTicksAtBadRSSI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
* Number of ticks associated to this configuration
|
|
||||||
* and RSSI was not HIGH.
|
|
||||||
*/
|
|
||||||
public int numTicksAtNotHighRSSI;
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
* Number of time user (WifiManager) triggered association to this configuration.
|
|
||||||
* TODO: count this only for Wifi Settings uuid, so as to not count 3rd party apps
|
|
||||||
*/
|
|
||||||
public int numUserTriggeredJoinAttempts;
|
|
||||||
|
|
||||||
/** @hide
|
/** @hide
|
||||||
* Boost given to RSSI on a home network for the purpose of calculating the score
|
* Boost given to RSSI on a home network for the purpose of calculating the score
|
||||||
* This adds stickiness to home networks, as defined by:
|
* This adds stickiness to home networks, as defined by:
|
||||||
@@ -1630,16 +1586,6 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
sbuf.append('\n');
|
sbuf.append('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sbuf.append("triggeredLow: ").append(this.numUserTriggeredWifiDisableLowRSSI);
|
|
||||||
sbuf.append(" triggeredBad: ").append(this.numUserTriggeredWifiDisableBadRSSI);
|
|
||||||
sbuf.append(" triggeredNotHigh: ").append(this.numUserTriggeredWifiDisableNotHighRSSI);
|
|
||||||
sbuf.append('\n');
|
|
||||||
sbuf.append("ticksLow: ").append(this.numTicksAtLowRSSI);
|
|
||||||
sbuf.append(" ticksBad: ").append(this.numTicksAtBadRSSI);
|
|
||||||
sbuf.append(" ticksNotHigh: ").append(this.numTicksAtNotHighRSSI);
|
|
||||||
sbuf.append('\n');
|
|
||||||
sbuf.append("triggeredJoin: ").append(this.numUserTriggeredJoinAttempts);
|
|
||||||
sbuf.append('\n');
|
|
||||||
|
|
||||||
return sbuf.toString();
|
return sbuf.toString();
|
||||||
}
|
}
|
||||||
@@ -1946,13 +1892,6 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
numScorerOverride = source.numScorerOverride;
|
numScorerOverride = source.numScorerOverride;
|
||||||
numScorerOverrideAndSwitchedNetwork = source.numScorerOverrideAndSwitchedNetwork;
|
numScorerOverrideAndSwitchedNetwork = source.numScorerOverrideAndSwitchedNetwork;
|
||||||
numAssociation = source.numAssociation;
|
numAssociation = source.numAssociation;
|
||||||
numUserTriggeredWifiDisableLowRSSI = source.numUserTriggeredWifiDisableLowRSSI;
|
|
||||||
numUserTriggeredWifiDisableBadRSSI = source.numUserTriggeredWifiDisableBadRSSI;
|
|
||||||
numUserTriggeredWifiDisableNotHighRSSI = source.numUserTriggeredWifiDisableNotHighRSSI;
|
|
||||||
numTicksAtLowRSSI = source.numTicksAtLowRSSI;
|
|
||||||
numTicksAtBadRSSI = source.numTicksAtBadRSSI;
|
|
||||||
numTicksAtNotHighRSSI = source.numTicksAtNotHighRSSI;
|
|
||||||
numUserTriggeredJoinAttempts = source.numUserTriggeredJoinAttempts;
|
|
||||||
userApproved = source.userApproved;
|
userApproved = source.userApproved;
|
||||||
numNoInternetAccessReports = source.numNoInternetAccessReports;
|
numNoInternetAccessReports = source.numNoInternetAccessReports;
|
||||||
noInternetAccessExpected = source.noInternetAccessExpected;
|
noInternetAccessExpected = source.noInternetAccessExpected;
|
||||||
@@ -2018,13 +1957,6 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
dest.writeInt(numScorerOverride);
|
dest.writeInt(numScorerOverride);
|
||||||
dest.writeInt(numScorerOverrideAndSwitchedNetwork);
|
dest.writeInt(numScorerOverrideAndSwitchedNetwork);
|
||||||
dest.writeInt(numAssociation);
|
dest.writeInt(numAssociation);
|
||||||
dest.writeInt(numUserTriggeredWifiDisableLowRSSI);
|
|
||||||
dest.writeInt(numUserTriggeredWifiDisableBadRSSI);
|
|
||||||
dest.writeInt(numUserTriggeredWifiDisableNotHighRSSI);
|
|
||||||
dest.writeInt(numTicksAtLowRSSI);
|
|
||||||
dest.writeInt(numTicksAtBadRSSI);
|
|
||||||
dest.writeInt(numTicksAtNotHighRSSI);
|
|
||||||
dest.writeInt(numUserTriggeredJoinAttempts);
|
|
||||||
dest.writeInt(userApproved);
|
dest.writeInt(userApproved);
|
||||||
dest.writeInt(numNoInternetAccessReports);
|
dest.writeInt(numNoInternetAccessReports);
|
||||||
dest.writeInt(noInternetAccessExpected ? 1 : 0);
|
dest.writeInt(noInternetAccessExpected ? 1 : 0);
|
||||||
@@ -2090,13 +2022,6 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
config.numScorerOverride = in.readInt();
|
config.numScorerOverride = in.readInt();
|
||||||
config.numScorerOverrideAndSwitchedNetwork = in.readInt();
|
config.numScorerOverrideAndSwitchedNetwork = in.readInt();
|
||||||
config.numAssociation = in.readInt();
|
config.numAssociation = in.readInt();
|
||||||
config.numUserTriggeredWifiDisableLowRSSI = in.readInt();
|
|
||||||
config.numUserTriggeredWifiDisableBadRSSI = in.readInt();
|
|
||||||
config.numUserTriggeredWifiDisableNotHighRSSI = in.readInt();
|
|
||||||
config.numTicksAtLowRSSI = in.readInt();
|
|
||||||
config.numTicksAtBadRSSI = in.readInt();
|
|
||||||
config.numTicksAtNotHighRSSI = in.readInt();
|
|
||||||
config.numUserTriggeredJoinAttempts = in.readInt();
|
|
||||||
config.userApproved = in.readInt();
|
config.userApproved = in.readInt();
|
||||||
config.numNoInternetAccessReports = in.readInt();
|
config.numNoInternetAccessReports = in.readInt();
|
||||||
config.noInternetAccessExpected = in.readInt() != 0;
|
config.noInternetAccessExpected = in.readInt() != 0;
|
||||||
|
|||||||
69
wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
Normal file
69
wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package android.net.wifi;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit tests for {@link android.net.wifi.WifiConfiguration}.
|
||||||
|
*/
|
||||||
|
public class WifiConfigurationTest {
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check that parcel marshalling/unmarshalling works
|
||||||
|
*
|
||||||
|
* Create and populate a WifiConfiguration.
|
||||||
|
* Marshall and unmashall it, and expect to recover a copy of the original.
|
||||||
|
* Marshall the resulting object, and expect the bytes to match the
|
||||||
|
* first marshall result.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testWifiConfigurationParcel() {
|
||||||
|
String cookie = "C O.o |<IE";
|
||||||
|
WifiConfiguration config = new WifiConfiguration();
|
||||||
|
config.setPasspointManagementObjectTree(cookie);
|
||||||
|
Parcel parcelW = Parcel.obtain();
|
||||||
|
config.writeToParcel(parcelW, 0);
|
||||||
|
byte[] bytes = parcelW.marshall();
|
||||||
|
parcelW.recycle();
|
||||||
|
|
||||||
|
Parcel parcelR = Parcel.obtain();
|
||||||
|
parcelR.unmarshall(bytes, 0, bytes.length);
|
||||||
|
parcelR.setDataPosition(0);
|
||||||
|
WifiConfiguration reconfig = WifiConfiguration.CREATOR.createFromParcel(parcelR);
|
||||||
|
|
||||||
|
// lacking a useful config.equals, check one field near the end.
|
||||||
|
assertEquals(cookie, reconfig.getMoTree());
|
||||||
|
|
||||||
|
Parcel parcelWW = Parcel.obtain();
|
||||||
|
reconfig.writeToParcel(parcelWW, 0);
|
||||||
|
byte[] rebytes = parcelWW.marshall();
|
||||||
|
parcelWW.recycle();
|
||||||
|
|
||||||
|
assertArrayEquals(bytes, rebytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user