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

Commit 498c898a authored by Jakob Schneider's avatar Jakob Schneider
Browse files

Disable PIA v2 for archiving until it's supported.

Bug: 318521110
Test: ArchiveTest
Change-Id: Iba97dc8be67d9e6de2931dcddae4c3bfd666a861
parent 8fa5ce38
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ public class UninstallerActivity extends Activity {
        // be stale, if e.g. the app was uninstalled while the activity was destroyed.
        super.onCreate(null);

        if (usePiaV2() && !isTv()) {
        // TODO(b/318521110) Enable PIA v2 for archive dialog.
        if (usePiaV2() && !isTv() && !isArchiveDialog(getIntent())) {
            Log.i(TAG, "Using Pia V2");

            boolean returnResult = getIntent().getBooleanExtra(Intent.EXTRA_RETURN_RESULT, false);
@@ -224,6 +225,11 @@ public class UninstallerActivity extends Activity {
        showConfirmationDialog();
    }

    private boolean isArchiveDialog(Intent intent) {
        return (intent.getIntExtra(PackageInstaller.EXTRA_DELETE_FLAGS, 0)
                & PackageManager.DELETE_ARCHIVE) != 0;
    }

    /**
     * Parses specific {@link android.content.pm.PackageManager.DeleteFlags} from {@link Intent}
     * to archive an app if requested.