Merge "Store the randomized MAC last modified time"

This commit is contained in:
Oscar Shu
2020-09-21 20:11:19 +00:00
committed by Android (Google) Code Review

View File

@@ -1206,11 +1206,17 @@ public class WifiConfiguration implements Parcelable {
/**
* @hide
* The wall clock time of when |mRandomizedMacAddress| should be re-randomized in aggressive
* randomization mode.
* The wall clock time of when |mRandomizedMacAddress| should be re-randomized in enhanced
* MAC randomization mode.
*/
public long randomizedMacExpirationTimeMs = 0;
/**
* The wall clock time of when |mRandomizedMacAddress| is last modified.
* @hide
*/
public long randomizedMacLastModifiedTimeMs = 0;
/**
* @hide
* Checks if the given MAC address can be used for Connected Mac Randomization
@@ -2281,6 +2287,9 @@ public class WifiConfiguration implements Parcelable {
sbuf.append(" randomizedMacExpirationTimeMs: ")
.append(randomizedMacExpirationTimeMs == 0 ? "<none>"
: logTimeOfDay(randomizedMacExpirationTimeMs)).append("\n");
sbuf.append(" randomizedMacLastModifiedTimeMs: ")
.append(randomizedMacLastModifiedTimeMs == 0 ? "<none>"
: logTimeOfDay(randomizedMacLastModifiedTimeMs)).append("\n");
sbuf.append(" KeyMgmt:");
for (int k = 0; k < this.allowedKeyManagement.size(); k++) {
if (this.allowedKeyManagement.get(k)) {
@@ -2837,6 +2846,7 @@ public class WifiConfiguration implements Parcelable {
mRandomizedMacAddress = source.mRandomizedMacAddress;
macRandomizationSetting = source.macRandomizationSetting;
randomizedMacExpirationTimeMs = source.randomizedMacExpirationTimeMs;
randomizedMacLastModifiedTimeMs = source.randomizedMacLastModifiedTimeMs;
requirePmf = source.requirePmf;
updateIdentifier = source.updateIdentifier;
carrierId = source.carrierId;
@@ -2911,6 +2921,7 @@ public class WifiConfiguration implements Parcelable {
dest.writeInt(macRandomizationSetting);
dest.writeInt(osu ? 1 : 0);
dest.writeLong(randomizedMacExpirationTimeMs);
dest.writeLong(randomizedMacLastModifiedTimeMs);
dest.writeInt(carrierId);
dest.writeString(mPasspointUniqueId);
}
@@ -2985,6 +2996,7 @@ public class WifiConfiguration implements Parcelable {
config.macRandomizationSetting = in.readInt();
config.osu = in.readInt() != 0;
config.randomizedMacExpirationTimeMs = in.readLong();
config.randomizedMacLastModifiedTimeMs = in.readLong();
config.carrierId = in.readInt();
config.mPasspointUniqueId = in.readString();
return config;