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

Commit 90cc54ec authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge "Make PackageInstaller prompt properly"

parents 45dde31b 84bb6e7b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -80,7 +80,10 @@ public class InstallStart extends Activity {
        final int originatingUid = getOriginatingUid(sourceInfo);
        boolean isTrustedSource = false;
        if (sourceInfo != null && sourceInfo.isPrivilegedApp()) {
            isTrustedSource = intent.getBooleanExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, false);
            isTrustedSource = intent.getBooleanExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, false) || (
                    originatingUid != Process.INVALID_UID && checkPermission(
                            Manifest.permission.INSTALL_PACKAGES, -1 /* pid */, originatingUid)
                            == PackageManager.PERMISSION_GRANTED);
        }

        if (!isTrustedSource && originatingUid != Process.INVALID_UID) {
+4 −0
Original line number Diff line number Diff line
@@ -297,6 +297,10 @@ public class PackageInstallerActivity extends AlertActivity {
                return false;
            }
        }
        if (mSourceInfo != null && checkPermission(Manifest.permission.INSTALL_PACKAGES,
                -1 /* pid */, mSourceInfo.uid) == PackageManager.PERMISSION_GRANTED) {
            return false;
        }
        return true;
    }