Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fc5438d authored by Rambo Wang's avatar Rambo Wang
Browse files

Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier

MatchAllNetworkSpecifier is a subclass of NetworkSpecifer. The method
satisfiedBy should be renamed to canBeSatisfiedBy together with other
subclass of NetworkSpecifer in b/152238712.

Add annotation @Overide for the method to make sure it will not get
ignored when refactor in the future.

Bug: 154956584
Test: atest android.net.MatchAllNetworkSpecifierTest
Change-Id: Ibe32fd50fae43aa635c1c0dad66eaea82011c8b7
parent bbb5a3c7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -43,7 +43,8 @@ public final class MatchAllNetworkSpecifier extends NetworkSpecifier implements
    }

    /** @hide */
    public boolean satisfiedBy(NetworkSpecifier other) {
    @Override
    public boolean canBeSatisfiedBy(NetworkSpecifier other) {
        /*
         * The method is called by a NetworkRequest to see if it is satisfied by a proposed
         * network (e.g. as offered by a network factory). Since MatchAllNetweorkSpecifier must
+2 −2
Original line number Diff line number Diff line
@@ -39,12 +39,12 @@ class MatchAllNetworkSpecifierTest {
    }

    @Test(expected = IllegalStateException::class)
    fun testSatisfiedBy() {
    fun testCanBeSatisfiedBy() {
        val specifier = MatchAllNetworkSpecifier()
        val discoverySession = Mockito.mock(DiscoverySession::class.java)
        val peerHandle = Mockito.mock(PeerHandle::class.java)
        val wifiAwareNetworkSpecifier = WifiAwareNetworkSpecifier.Builder(discoverySession,
                peerHandle).build()
        specifier.satisfiedBy(wifiAwareNetworkSpecifier)
        specifier.canBeSatisfiedBy(wifiAwareNetworkSpecifier)
    }
}