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

Commit 89325cf2 authored by JW Wang's avatar JW Wang
Browse files

Search more NetworkStack paths

The test failed because it can't find the apk file for NetworkStack.
Let's include more names for search.

Bug: 154792230
Test: atest NetworkStagedRollbackTest
Change-Id: I0909e531fcd0e99fcedb8d07ba0be01f4e762914
parent e43eb849
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -52,15 +52,21 @@ public class NetworkStagedRollbackTest {
    private static final String PROPERTY_WATCHDOG_REQUEST_TIMEOUT_MILLIS =
            "watchdog_request_timeout_millis";

    private static final String[] NETWORK_STACK_APK_NAMES = {
            "NetworkStack", "NetworkStackGoogle", "NetworkStackNext", "NetworkStackNextGoogle"
    };

    private static final TestApp NETWORK_STACK = new TestApp("NetworkStack",
            getNetworkStackPackageName(), -1, false, findNetworkStackApk());

    private static File findNetworkStackApk() {
        final File apk = new File("/system/priv-app/NetworkStack/NetworkStack.apk");
        for (String name : NETWORK_STACK_APK_NAMES) {
            final File apk = new File("/system/priv-app/" + name + "/" + name + ".apk");
            if (apk.isFile()) {
                return apk;
            }
        return new File("/system/priv-app/NetworkStackNext/NetworkStackNext.apk");
        }
        throw new RuntimeException("Can't find NetworkStackApk");
    }

    /**