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

Commit c3a4cf72 authored by Christopher Dombroski's avatar Christopher Dombroski Committed by hamzeh
Browse files

[RESTRICT AUTOMERGE]: Merge commit '217f31fb'...

[RESTRICT AUTOMERGE]: Merge commit '217f31fb' into OP_REQUEST_INSTALL_PACKAGES-denied

* commit '217f31fb':
  [RESTRICT AUTOMERGE]: OP_REQUEST_INSTALL_PACKAGES denied by default

Some system apps may download unknown content and the user should
be explicitly asked whether they trust these files. System apps should
explicitly use the extra NOT_UNKNOWN_SOURCE to bypass this check.

Test: Builds, boots, existing tests pass:
atest CtsPackageInstallTestCases

Locally verified they pass if CtsPackageInstallTestCases.apk was signed by
the platform cert.

Bug: 123700348
Change-Id: I56cd3ad2f3e3b0b7487b91966eb9a0f0dbc432f5
(cherry picked from commit fec8435d)
parent 8c0ef16a
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserManager;
import android.provider.Settings;
import android.support.annotation.NonNull;
@@ -526,16 +525,6 @@ public class PackageInstallerActivity extends OverlayTouchActivity implements On
                mOriginatingUid, mOriginatingPackage);
        switch (appOpMode) {
            case AppOpsManager.MODE_DEFAULT:
                try {
                    int result = mIpm.checkUidPermission(
                            Manifest.permission.REQUEST_INSTALL_PACKAGES, mOriginatingUid);
                    if (result == PackageManager.PERMISSION_GRANTED) {
                        initiateInstall();
                        break;
                    }
                } catch (RemoteException exc) {
                    Log.e(TAG, "Unable to talk to package manager");
                }
                mAppOpsManager.setMode(appOpCode, mOriginatingUid,
                        mOriginatingPackage, AppOpsManager.MODE_ERRORED);
                // fall through