Add a keep connected for test reason

This has been sorely needed for a while. Instead of filing requests
for each of your networks in a CSTest, which is fiddly at best and
sometimes almost impossible (because you can't single out the network),
you can now add this flag and be done with it.

Test: CSKeepConnectedTest
Change-Id: Ie168fe1f3a17de035fdf05e3d6580d3262a3448e
This commit is contained in:
Chalard Jean
2023-10-06 19:16:54 +09:00
parent 026ca940d9
commit c517fb1247
3 changed files with 70 additions and 4 deletions

View File

@@ -44,7 +44,8 @@ public final class NetworkScore implements Parcelable {
@Retention(RetentionPolicy.SOURCE)
@IntDef(value = {
KEEP_CONNECTED_NONE,
KEEP_CONNECTED_FOR_HANDOVER
KEEP_CONNECTED_FOR_HANDOVER,
KEEP_CONNECTED_FOR_TEST
})
public @interface KeepConnectedReason { }
@@ -57,6 +58,12 @@ public final class NetworkScore implements Parcelable {
* is being considered for handover.
*/
public static final int KEEP_CONNECTED_FOR_HANDOVER = 1;
/**
* Keep this network connected even if there is no outstanding request for it, because it
* is used in a test and it's not necessarily easy to file the right request for it.
* @hide
*/
public static final int KEEP_CONNECTED_FOR_TEST = 2;
// Agent-managed policies
// This network should lose to a wifi that has ever been validated