diff options
-rw-r--r-- | tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java b/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java index f30c35aca8da..173338660113 100644 --- a/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java +++ b/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java @@ -186,7 +186,7 @@ public class SystemPreparer extends ExternalResource { private File copyResourceToTemp(String resourcePath) throws IOException { final File tempFile = mHostTempFolder.newFile(); final ClassLoader classLoader = getClass().getClassLoader(); - try (InputStream assetIs = classLoader.getResource(resourcePath).openStream(); + try (InputStream assetIs = classLoader.getResourceAsStream(resourcePath); FileOutputStream assetOs = new FileOutputStream(tempFile)) { if (assetIs == null) { throw new IllegalStateException("Failed to find resource " + resourcePath); |