Grant access to the URI when forwarding intent from InstallStart to

InstallInstalling

Otherwise the URI grant might be taken away before InstallInstalling can
open it.

Fixes: 163274739
Test: atest CtsPackageInstallTestCases
Change-Id: Ibd9ffc253358606b8ae2ea41a875fcb1a1efcb2b
This commit is contained in:
Philip P. Moltmann
2020-11-04 14:53:34 -08:00
parent 143108846a
commit a87968d4fb

View File

@@ -108,7 +108,8 @@ public class InstallStart extends Activity {
}
Intent nextActivity = new Intent(intent);
nextActivity.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
nextActivity.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT
| Intent.FLAG_GRANT_READ_URI_PERMISSION);
// The the installation source as the nextActivity thinks this activity is the source, hence
// set the originating UID and sourceInfo explicitly