Merge "[NS03] Mix in other CS-managed properties" am: 80e17b0086

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556101

Change-Id: I7b904af6c34190f53378cc1acc518840b527d434
This commit is contained in:
Chalard Jean
2021-03-19 10:52:23 +00:00
committed by Automerger Merge Worker
2 changed files with 16 additions and 1 deletions

View File

@@ -50,7 +50,8 @@ public final class NetworkAgentConfig implements Parcelable {
* ap in the wifi settings to trigger a connection is explicit. A 3rd party app asking to * ap in the wifi settings to trigger a connection is explicit. A 3rd party app asking to
* connect to a particular access point is also explicit, though this may change in the future * connect to a particular access point is also explicit, though this may change in the future
* as we want apps to use the multinetwork apis. * as we want apps to use the multinetwork apis.
* * TODO : this is a bad name, because it sounds like the user just tapped on the network.
* It's not necessarily the case ; auto-reconnection to WiFi has this true for example.
* @hide * @hide
*/ */
public boolean explicitlySelected; public boolean explicitlySelected;

View File

@@ -20,6 +20,8 @@ import android.annotation.NonNull;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import com.android.internal.annotations.VisibleForTesting;
/** /**
* Object representing the quality of a network as perceived by the user. * Object representing the quality of a network as perceived by the user.
* *
@@ -35,6 +37,10 @@ public final class NetworkScore implements Parcelable {
// Agent-managed policies // Agent-managed policies
// TODO : add them here, starting from 1 // TODO : add them here, starting from 1
/** @hide */
public static final int MIN_AGENT_MANAGED_POLICY = 0;
/** @hide */
public static final int MAX_AGENT_MANAGED_POLICY = -1;
// Bitmask of all the policies applied to this score. // Bitmask of all the policies applied to this score.
private final long mPolicies; private final long mPolicies;
@@ -54,6 +60,14 @@ public final class NetworkScore implements Parcelable {
return mLegacyInt; return mLegacyInt;
} }
/**
* @return whether this score has a particular policy.
*/
@VisibleForTesting
public boolean hasPolicy(final int policy) {
return 0 != (mPolicies & (1L << policy));
}
@Override @Override
public String toString() { public String toString() {
return "Score(" + mLegacyInt + ")"; return "Score(" + mLegacyInt + ")";