summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/pm/BackgroundInstallControlService.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/pm/BackgroundInstallControlService.java b/services/core/java/com/android/server/pm/BackgroundInstallControlService.java
index 0bb05aab4394..1b34c703f663 100644
--- a/services/core/java/com/android/server/pm/BackgroundInstallControlService.java
+++ b/services/core/java/com/android/server/pm/BackgroundInstallControlService.java
@@ -231,6 +231,14 @@ public class BackgroundInstallControlService extends SystemService {
return;
}
+ // the installers without INSTALL_PACKAGES perm can't perform
+ // the installation in background. So we can just filter out them.
+ if (mPermissionManager.checkPermission(installerPackageName,
+ android.Manifest.permission.INSTALL_PACKAGES,
+ userId) != PackageManager.PERMISSION_GRANTED) {
+ return;
+ }
+
// convert up-time to current time.
final long installTimestamp = System.currentTimeMillis()
- (SystemClock.uptimeMillis() - appInfo.createTimestamp);