diff options
| author | 2019-10-01 15:53:57 -0700 | |
|---|---|---|
| committer | 2019-10-04 16:18:27 -0700 | |
| commit | 1575e5d30cf49eb509eba9964d874fbe22a87a21 (patch) | |
| tree | 747e7f13432507769fe1ed7831548b7b8327d5c0 | |
| parent | a55998b536bcef8009dc6c9780a8192d2fa969b4 (diff) | |
[MAC rand] Repurpose existing field
Repurposing an old field to suit the new design of throttling MAC
address changes based on DHCP lease duration.
Bug: 141950243
Test: unit tests
Change-Id: Ide71816895eb088f728105d1f675a6823490423f
| -rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 2afb14a12110..05a6a39167b6 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -1038,10 +1038,10 @@ public class WifiConfiguration implements Parcelable { /** * @hide - * The wall clock time of when |mRandomizedMacAddress| last changed. - * Used to determine when we should re-randomize in aggressive mode. + * The wall clock time of when |mRandomizedMacAddress| should be re-randomized in aggressive + * randomization mode. */ - public long randomizedMacLastModifiedTimeMs = 0; + public long randomizedMacExpirationTimeMs = 0; /** * @hide @@ -1902,8 +1902,9 @@ public class WifiConfiguration implements Parcelable { } sbuf.append(" macRandomizationSetting: ").append(macRandomizationSetting).append("\n"); sbuf.append(" mRandomizedMacAddress: ").append(mRandomizedMacAddress).append("\n"); - sbuf.append(" randomizedMacLastModifiedTimeMs: ").append(randomizedMacLastModifiedTimeMs) - .append("\n"); + sbuf.append(" randomizedMacExpirationTimeMs: ") + .append(randomizedMacExpirationTimeMs == 0 ? "<none>" + : TimeUtils.logTimeOfDay(randomizedMacExpirationTimeMs)).append("\n"); sbuf.append(" KeyMgmt:"); for (int k = 0; k < this.allowedKeyManagement.size(); k++) { if (this.allowedKeyManagement.get(k)) { @@ -2429,7 +2430,7 @@ public class WifiConfiguration implements Parcelable { recentFailure.setAssociationStatus(source.recentFailure.getAssociationStatus()); mRandomizedMacAddress = source.mRandomizedMacAddress; macRandomizationSetting = source.macRandomizationSetting; - randomizedMacLastModifiedTimeMs = source.randomizedMacLastModifiedTimeMs; + randomizedMacExpirationTimeMs = source.randomizedMacExpirationTimeMs; requirePMF = source.requirePMF; updateIdentifier = source.updateIdentifier; } @@ -2504,7 +2505,7 @@ public class WifiConfiguration implements Parcelable { dest.writeParcelable(mRandomizedMacAddress, flags); dest.writeInt(macRandomizationSetting); dest.writeInt(osu ? 1 : 0); - dest.writeLong(randomizedMacLastModifiedTimeMs); + dest.writeLong(randomizedMacExpirationTimeMs); } /** Implement the Parcelable interface {@hide} */ @@ -2579,7 +2580,7 @@ public class WifiConfiguration implements Parcelable { config.mRandomizedMacAddress = in.readParcelable(null); config.macRandomizationSetting = in.readInt(); config.osu = in.readInt() != 0; - config.randomizedMacLastModifiedTimeMs = in.readLong(); + config.randomizedMacExpirationTimeMs = in.readLong(); return config; } |