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

Commit d216f5f2 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6406468 from 7f488304 to sc-release

Change-Id: I0383ce788c5e2c6457b699ebbfe01d913b079d4c
parents d9ba175a 7f488304
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ android_app {
    manifest: "AndroidManifest.xml",
    // The permission configuration *must* be included to ensure security of the device
    required: ["NetworkPermissionConfig"],
    updatable: true,
}

// Android library to derive test APKs for integration tests
+7 −9
Original line number Diff line number Diff line
@@ -1861,15 +1861,13 @@ public class NetworkMonitorTest {
    @Test
    public void testReadAsString_StreamShorterThanLimit() throws Exception {
        final WrappedNetworkMonitor wnm = makeNotMeteredNetworkMonitor();
        final String content = "The HTTP response code is 200 but it is not a captive portal.";
        ByteArrayInputStream inputStream = new ByteArrayInputStream(
                content.getBytes(StandardCharsets.UTF_8));
        assertEquals(content, wnm.readAsString(inputStream, content.length(),
                StandardCharsets.UTF_8));
        // Reset the inputStream and test the case that the stream ends earlier than the limit.
        inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8));
        assertEquals(content, wnm.readAsString(inputStream, content.length() + 10,
                StandardCharsets.UTF_8));
        final byte[] content = "The HTTP response code is 200 but it is not a captive portal."
                .getBytes(StandardCharsets.UTF_8);
        assertEquals(new String(content), wnm.readAsString(new ByteArrayInputStream(content),
                content.length, StandardCharsets.UTF_8));
        // Test the case that the stream ends earlier than the limit.
        assertEquals(new String(content), wnm.readAsString(new ByteArrayInputStream(content),
                content.length + 10, StandardCharsets.UTF_8));
    }

    @Test