summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Dombroski <cdombroski@google.com>2019-04-17 16:16:13 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-14 04:57:51 +0000
commit80aa96ebbf9e33a3fe4c446395d68e5c267462eb (patch)
treeb5325d60af43e6780255c47d66fef91bca15d557
parentb101f7ec0e6142b31946ae1a4da58ec4ef9ea690 (diff)
downloadandroid_packages_apps_PackageInstaller-80aa96ebbf9e33a3fe4c446395d68e5c267462eb.tar.gz
android_packages_apps_PackageInstaller-80aa96ebbf9e33a3fe4c446395d68e5c267462eb.tar.bz2
android_packages_apps_PackageInstaller-80aa96ebbf9e33a3fe4c446395d68e5c267462eb.zip
[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: I5a05b9a6d41bfbff9cd4cf2e26301dfa6fc64a9d (cherry picked from commit 4c5493f65ad4add90cc1e8ee02c0814fcf4f0c32)
-rw-r--r--src/com/android/packageinstaller/PackageInstallerActivity.java11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java
index 55b0d664..a2df8306 100644
--- a/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -39,7 +39,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;
@@ -529,16 +528,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