Add dhcp in advanced settings toggle.
Test: Unit Test Fix: 329002870 Change-Id: I5c57deb1e8ed0dd59a7699b56f5eb99ca29876b8
This commit is contained in:
@@ -63,4 +63,32 @@ class WifiPrivacyPreferenceController(context: Context, preferenceKey: String) :
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val PREF_SEND_DHCP_HOST_NAME_ENABLE = 0
|
||||
private const val PREF_SEND_DHCP_HOST_NAME_DISABLE = 1
|
||||
|
||||
/**
|
||||
* Returns preference index value.
|
||||
*
|
||||
* @param isSendDhcpHostnameEnabled determines whether device name can be sent.
|
||||
* @return index value of preference
|
||||
*/
|
||||
fun translateSendDhcpHostnameEnabledToPrefValue(
|
||||
isSendDhcpHostnameEnabled: Boolean
|
||||
): Int {
|
||||
return if (isSendDhcpHostnameEnabled) PREF_SEND_DHCP_HOST_NAME_ENABLE
|
||||
else PREF_SEND_DHCP_HOST_NAME_DISABLE
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether device name can be sent.
|
||||
*
|
||||
* @param prefDhcpRandomized is preference index value
|
||||
* @return is send dhcp host name enabled
|
||||
*/
|
||||
fun translatePrefValueToSendDhcpHostnameEnabled(prefDhcpRandomized: Int): Boolean {
|
||||
return prefDhcpRandomized == PREF_SEND_DHCP_HOST_NAME_ENABLE
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user