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

Commit a5f1c966 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "BinaryTransparencyService: Fix data apex check" into main

parents 6517fbf0 b72810e1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -612,7 +612,11 @@ public class BinaryTransparencyService extends SystemService {
                    pw.println("--- Package Installation Info ---");
                    pw.println("Current install location: "
                            + packageInfo.applicationInfo.sourceDir);
                    if (packageInfo.applicationInfo.sourceDir.startsWith("/data/apex/")) {
                    // Print more information for downloaded APEX
                    String sourceDir = packageInfo.applicationInfo.sourceDir;
                    if (packageInfo.isApex
                            && (sourceDir.startsWith("/data/apex")
                                    || sourceDir.startsWith("/dev/block/dm-"))) {
                        String origPackageFilepath = getOriginalApexPreinstalledLocation(
                                packageInfo.packageName);
                        pw.println("|--> Pre-installed package install location: "
+3 −2
Original line number Diff line number Diff line
@@ -189,9 +189,10 @@ public final class BinaryTransparencyHostTest extends BaseHostJUnit4Test {
    private void uninstallRebootlessApexThenReboot() throws DeviceNotAvailableException {
        // Reboot only if the APEX is not the pre-install one.
        CommandResult result = getDevice().executeShellV2Command(
                "pm list packages -f --apex-only |grep com.android.apex.cts.shim");
                "pm list packages -f --apex-only --show-versioncode "
                + " | grep com.android.apex.cts.shim");
        assertTrue(result.getStatus() == CommandStatus.SUCCESS);
        if (result.getStdout().contains("/data/apex/active/")) {
        if (result.getStdout().contains("versionCode:2")) {
            uninstallPackage("com.android.apex.cts.shim");
            getDevice().reboot();