MacAddress: add @NonNull annotations
This patch adds to the MacAddress class: - getAddressType() method which replaces addressType(), for naming consistency - @NonNull annotations on all input and output reference values for all public methods (@hide and public). TYPE_UNKNOWN, which currently cannot be observed with a non @hide method, is also removed from the public api. Bug: 71866627 Test: $ runtest frameworks-net Change-Id: I2af70408d46f431b7b32183e6b48ddae9a261a2c
This commit is contained in:
@@ -67,7 +67,7 @@ public class MacAddressTest {
|
||||
assertEquals(msg, t.expectedType, got);
|
||||
|
||||
if (got != MacAddress.TYPE_UNKNOWN) {
|
||||
assertEquals(got, MacAddress.fromBytes(t.addr).addressType());
|
||||
assertEquals(got, MacAddress.fromBytes(t.addr).getAddressType());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public class MacAddressTest {
|
||||
|
||||
assertTrue(stringRepr + " expected to be a locally assigned address",
|
||||
mac.isLocallyAssigned());
|
||||
assertEquals(MacAddress.TYPE_UNICAST, mac.addressType());
|
||||
assertEquals(MacAddress.TYPE_UNICAST, mac.getAddressType());
|
||||
assertTrue(stringRepr + " expected to begin with " + expectedLocalOui,
|
||||
stringRepr.startsWith(expectedLocalOui));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user