summaryrefslogtreecommitdiff
path: root/src/com/android
diff options
context:
space:
mode:
authorChalard Jean <jchalard@google.com>2020-05-29 04:21:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-29 04:21:59 +0000
commit3453e859fe4d3463a679acf098fb2cdfee86dacc (patch)
treeaffc40054e7f5aea9ec2686f0ad97304aed10978 /src/com/android
parentbd1eb4e698c942c567ff29f3e3c0f46c216c768c (diff)
parentc6ad18a80d6697ee9c72489e541ce86f42f7efd0 (diff)
Rename groupHint to cluster. am: c6ad18a80d
Change-Id: Id1a473f8285263ef95586be41c18450a6fcda08d
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/server/connectivity/ipmemorystore/IpMemoryStoreDatabase.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/com/android/server/connectivity/ipmemorystore/IpMemoryStoreDatabase.java b/src/com/android/server/connectivity/ipmemorystore/IpMemoryStoreDatabase.java
index 834aa2d..be338e5 100644
--- a/src/com/android/server/connectivity/ipmemorystore/IpMemoryStoreDatabase.java
+++ b/src/com/android/server/connectivity/ipmemorystore/IpMemoryStoreDatabase.java
@@ -78,11 +78,17 @@ public class IpMemoryStoreDatabase {
// is used to represent "infinite lease".
public static final String COLTYPE_ASSIGNEDV4ADDRESSEXPIRY = "BIGINT";
- // Please note that the group hint is only a *hint*, hence its name. The client can offer
- // this information to nudge the grouping in the decision it thinks is right, but it can't
- // decide for the memory store what is the same L3 network.
- public static final String COLNAME_GROUPHINT = "groupHint";
- public static final String COLTYPE_GROUPHINT = "TEXT";
+ // An optional cluster representing a notion of group owned by the client. The memory
+ // store uses this as a hint for grouping, but not as an overriding factor. The client
+ // can then use this to find networks belonging to a cluster. An example of this could
+ // be the SSID for WiFi, where same SSID-networks may not be the same L3 networks but
+ // it's still useful for managing networks.
+ // Note that "groupHint" is the legacy name of the column. The column should be renamed
+ // in the database – ALTER TABLE ${NetworkAttributesContract.TABLENAME RENAME} COLUMN
+ // groupHint TO cluster – but this has been postponed to reduce risk as the Mainline
+ // release winter imposes a lot of changes be pushed at the same time in the next release.
+ public static final String COLNAME_CLUSTER = "groupHint";
+ public static final String COLTYPE_CLUSTER = "TEXT";
public static final String COLNAME_DNSADDRESSES = "dnsAddresses";
// Stored in marshalled form as is
@@ -97,7 +103,7 @@ public class IpMemoryStoreDatabase {
+ COLNAME_EXPIRYDATE + " " + COLTYPE_EXPIRYDATE + ", "
+ COLNAME_ASSIGNEDV4ADDRESS + " " + COLTYPE_ASSIGNEDV4ADDRESS + ", "
+ COLNAME_ASSIGNEDV4ADDRESSEXPIRY + " " + COLTYPE_ASSIGNEDV4ADDRESSEXPIRY + ", "
- + COLNAME_GROUPHINT + " " + COLTYPE_GROUPHINT + ", "
+ + COLNAME_CLUSTER + " " + COLTYPE_CLUSTER + ", "
+ COLNAME_DNSADDRESSES + " " + COLTYPE_DNSADDRESSES + ", "
+ COLNAME_MTU + " " + COLTYPE_MTU + ")";
public static final String DROP_TABLE = "DROP TABLE IF EXISTS " + TABLENAME;
@@ -165,7 +171,7 @@ public class IpMemoryStoreDatabase {
try {
if (oldVersion < 2) {
// upgrade from version 1 to version 2
- // since we starts from version 2, do nothing here
+ // since we start from version 2, do nothing here
}
if (oldVersion < 3) {
@@ -250,8 +256,8 @@ public class IpMemoryStoreDatabase {
values.put(NetworkAttributesContract.COLNAME_ASSIGNEDV4ADDRESSEXPIRY,
attributes.assignedV4AddressExpiry);
}
- if (null != attributes.groupHint) {
- values.put(NetworkAttributesContract.COLNAME_GROUPHINT, attributes.groupHint);
+ if (null != attributes.cluster) {
+ values.put(NetworkAttributesContract.COLNAME_CLUSTER, attributes.cluster);
}
if (null != attributes.dnsAddresses) {
values.put(NetworkAttributesContract.COLNAME_DNSADDRESSES,
@@ -299,7 +305,7 @@ public class IpMemoryStoreDatabase {
NetworkAttributesContract.COLNAME_ASSIGNEDV4ADDRESS, 0);
final long assignedV4AddressExpiry = getLong(cursor,
NetworkAttributesContract.COLNAME_ASSIGNEDV4ADDRESSEXPIRY, 0);
- final String groupHint = getString(cursor, NetworkAttributesContract.COLNAME_GROUPHINT);
+ final String cluster = getString(cursor, NetworkAttributesContract.COLNAME_CLUSTER);
final byte[] dnsAddressesBlob =
getBlob(cursor, NetworkAttributesContract.COLNAME_DNSADDRESSES);
final int mtu = getInt(cursor, NetworkAttributesContract.COLNAME_MTU, -1);
@@ -309,7 +315,7 @@ public class IpMemoryStoreDatabase {
if (0 != assignedV4AddressExpiry) {
builder.setAssignedV4AddressExpiry(assignedV4AddressExpiry);
}
- builder.setGroupHint(groupHint);
+ builder.setCluster(cluster);
if (null != dnsAddressesBlob) {
builder.setDnsAddresses(decodeAddressList(dnsAddressesBlob));
}