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

Commit 4152d83a authored by Benjamin Franz's avatar Benjamin Franz
Browse files

Allow passing extras through InstallStart

Bug: 34599122
Test: manual
Change-Id: I8931633d8afc39f6384e456e22c7d263c3f9ab27
parent c3d223c7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -43,11 +43,21 @@ public class InstallStart extends Activity {

        Intent intent = getIntent();
        String callingPackage = getCallingPackage();

        // If the activity was started via a PackageInstaller session, we retrieve the calling
        // package from that session
        int sessionId = intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, -1);
        if (sessionId != -1) {
            PackageInstaller packageInstaller = getPackageManager().getPackageInstaller();
            callingPackage = packageInstaller.getSessionInfo(sessionId).getInstallerPackageName();
        }

        ApplicationInfo sourceInfo = getSourceInfo(callingPackage);
        int originatingUid = getOriginatingUid(sourceInfo);

        Intent nextActivity = new Intent(intent);
        nextActivity.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
        nextActivity.putExtras(intent.getExtras());

        // The the installation source as the nextActivity thinks this activity is the source, hence
        // set the originating UID and sourceInfo explicitly