Merge "Include NetworkCapabilities and LinkProperties in DataStallReport."
This commit is contained in:
commit
287c4adbc9
1 changed files with 141 additions and 28 deletions
|
|
@ -252,8 +252,8 @@ public class ConnectivityDiagnosticsManager {
|
|||
@NonNull PersistableBundle additionalInfo) {
|
||||
mNetwork = network;
|
||||
mReportTimestamp = reportTimestamp;
|
||||
mLinkProperties = linkProperties;
|
||||
mNetworkCapabilities = networkCapabilities;
|
||||
mLinkProperties = new LinkProperties(linkProperties);
|
||||
mNetworkCapabilities = new NetworkCapabilities(networkCapabilities);
|
||||
mAdditionalInfo = additionalInfo;
|
||||
}
|
||||
|
||||
|
|
@ -433,6 +433,12 @@ public class ConnectivityDiagnosticsManager {
|
|||
/** The detection method used to identify the suspected data stall */
|
||||
@DetectionMethod private final int mDetectionMethod;
|
||||
|
||||
/** LinkProperties available on the Network at the reported timestamp */
|
||||
@NonNull private final LinkProperties mLinkProperties;
|
||||
|
||||
/** NetworkCapabilities available on the Network at the reported timestamp */
|
||||
@NonNull private final NetworkCapabilities mNetworkCapabilities;
|
||||
|
||||
/** PersistableBundle that may contain additional information on the suspected data stall */
|
||||
@NonNull private final PersistableBundle mStallDetails;
|
||||
|
||||
|
|
@ -446,16 +452,23 @@ public class ConnectivityDiagnosticsManager {
|
|||
* @param network The Network for which this DataStallReport applies
|
||||
* @param reportTimestamp The timestamp for the report
|
||||
* @param detectionMethod The detection method used to identify this data stall
|
||||
* @param linkProperties The LinkProperties available on network at reportTimestamp
|
||||
* @param networkCapabilities The NetworkCapabilities available on network at
|
||||
* reportTimestamp
|
||||
* @param stallDetails A PersistableBundle that may contain additional info about the report
|
||||
*/
|
||||
public DataStallReport(
|
||||
@NonNull Network network,
|
||||
long reportTimestamp,
|
||||
@DetectionMethod int detectionMethod,
|
||||
@NonNull LinkProperties linkProperties,
|
||||
@NonNull NetworkCapabilities networkCapabilities,
|
||||
@NonNull PersistableBundle stallDetails) {
|
||||
mNetwork = network;
|
||||
mReportTimestamp = reportTimestamp;
|
||||
mDetectionMethod = detectionMethod;
|
||||
mLinkProperties = new LinkProperties(linkProperties);
|
||||
mNetworkCapabilities = new NetworkCapabilities(networkCapabilities);
|
||||
mStallDetails = stallDetails;
|
||||
}
|
||||
|
||||
|
|
@ -487,6 +500,26 @@ public class ConnectivityDiagnosticsManager {
|
|||
return mDetectionMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the LinkProperties available when this report was taken.
|
||||
*
|
||||
* @return LinkProperties available on the Network at the reported timestamp
|
||||
*/
|
||||
@NonNull
|
||||
public LinkProperties getLinkProperties() {
|
||||
return new LinkProperties(mLinkProperties);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the NetworkCapabilities when this report was taken.
|
||||
*
|
||||
* @return NetworkCapabilities available on the Network at the reported timestamp
|
||||
*/
|
||||
@NonNull
|
||||
public NetworkCapabilities getNetworkCapabilities() {
|
||||
return new NetworkCapabilities(mNetworkCapabilities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a PersistableBundle with additional info for this report.
|
||||
*
|
||||
|
|
@ -513,12 +546,20 @@ public class ConnectivityDiagnosticsManager {
|
|||
return mReportTimestamp == that.mReportTimestamp
|
||||
&& mDetectionMethod == that.mDetectionMethod
|
||||
&& mNetwork.equals(that.mNetwork)
|
||||
&& mLinkProperties.equals(that.mLinkProperties)
|
||||
&& mNetworkCapabilities.equals(that.mNetworkCapabilities)
|
||||
&& persistableBundleEquals(mStallDetails, that.mStallDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mNetwork, mReportTimestamp, mDetectionMethod, mStallDetails);
|
||||
return Objects.hash(
|
||||
mNetwork,
|
||||
mReportTimestamp,
|
||||
mDetectionMethod,
|
||||
mLinkProperties,
|
||||
mNetworkCapabilities,
|
||||
mStallDetails);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
|
@ -533,6 +574,8 @@ public class ConnectivityDiagnosticsManager {
|
|||
dest.writeParcelable(mNetwork, flags);
|
||||
dest.writeLong(mReportTimestamp);
|
||||
dest.writeInt(mDetectionMethod);
|
||||
dest.writeParcelable(mLinkProperties, flags);
|
||||
dest.writeParcelable(mNetworkCapabilities, flags);
|
||||
dest.writeParcelable(mStallDetails, flags);
|
||||
}
|
||||
|
||||
|
|
@ -544,6 +587,8 @@ public class ConnectivityDiagnosticsManager {
|
|||
in.readParcelable(null),
|
||||
in.readLong(),
|
||||
in.readInt(),
|
||||
in.readParcelable(null),
|
||||
in.readParcelable(null),
|
||||
in.readParcelable(null));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue