Use if instead of switch for resources
Converting to Soong will move some code from directly compiled into the app to compiled into an Android library and then shared between the app and the tests. This will cause resource IDs in the library to become non-final, which means they can no longer be used in case statements. Convert affect case statements to if blocks. Test: m RunSettingsRoboTests Change-Id: I25742a374f06d3fa4decbfc0d223a350acc50881
This commit is contained in:
@@ -207,16 +207,12 @@ public class PrivateDnsModeDialogPreference extends CustomDialogPreferenceCompat
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
switch (checkedId) {
|
||||
case R.id.private_dns_mode_off:
|
||||
mMode = PRIVATE_DNS_MODE_OFF;
|
||||
break;
|
||||
case R.id.private_dns_mode_opportunistic:
|
||||
mMode = PRIVATE_DNS_MODE_OPPORTUNISTIC;
|
||||
break;
|
||||
case R.id.private_dns_mode_provider:
|
||||
mMode = PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
|
||||
break;
|
||||
if (checkedId == R.id.private_dns_mode_off) {
|
||||
mMode = PRIVATE_DNS_MODE_OFF;
|
||||
} else if (checkedId == R.id.private_dns_mode_opportunistic) {
|
||||
mMode = PRIVATE_DNS_MODE_OPPORTUNISTIC;
|
||||
} else if (checkedId == R.id.private_dns_mode_provider) {
|
||||
mMode = PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
|
||||
}
|
||||
updateDialogInfo();
|
||||
}
|
||||
|
Reference in New Issue
Block a user