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

Commit f3a85cde authored by JW Wang's avatar JW Wang
Browse files

findNetworkStackApk returns an array of files (2/n)

This change handles the case of split APKs. All files starting with
"NetworkStack" will be returned as split APKs.

See b/159978937#comment6. NetworkStack is changed from a single APK to
split APKs. We need this change for install to succeed.

Bug: 159978937
Test: atest NetworkStagedRollbackTest
Change-Id: I20f5fee08ea208ba4dc7711d82a1718239c647c2
parent 46986caa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -61,11 +61,12 @@ public class NetworkStagedRollbackTest {
    private static final TestApp NETWORK_STACK = new TestApp("NetworkStack",
            getNetworkStackPackageName(), -1, false, findNetworkStackApk());

    private static File findNetworkStackApk() {
    private static File[] findNetworkStackApk() {
        for (String name : NETWORK_STACK_APK_NAMES) {
            final File apk = new File("/system/priv-app/" + name + "/" + name + ".apk");
            if (apk.isFile()) {
                return apk;
                final File dir = new File("/system/priv-app/" + name);
                return dir.listFiles((d, f) -> f.startsWith(name));
            }
        }
        throw new RuntimeException("Can't find NetworkStackApk");