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

Commit 62fef350 authored by Wenhao Wang's avatar Wenhao Wang Committed by Android (Google) Code Review
Browse files

Merge "[BIC] Filter out REQUEST_INSTALL_PACKAGES perm" into udc-dev

parents d699207d e8170d76
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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);