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

Commit 13b8fd16 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Postpone AppOps call to fix deadlock.

Fixes: 315229139
Test: presubmit
Change-Id: I7ac99c9e82cb8fb7e97eb3c25482156d08c529f8
parent 83be7645
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -2858,14 +2858,17 @@ final class InstallPackageHelper {
                mPm.notifyPackageChanged(packageName, request.getAppId());
            }

            for (int userId : firstUserIds) {
            // Apply restricted settings on potentially dangerous packages. Needs to happen
            // after appOpsManager is notified of the new package
            if (request.getPackageSource() == PackageInstaller.PACKAGE_SOURCE_LOCAL_FILE
                    || request.getPackageSource()
                    == PackageInstaller.PACKAGE_SOURCE_DOWNLOADED_FILE) {
                    enableRestrictedSettings(packageName, request.getAppId(), userId);
                final int appId = request.getAppId();
                mPm.mHandler.post(() -> {
                    for (int userId : firstUserIds) {
                        enableRestrictedSettings(packageName, appId, userId);
                    }
                });
            }

            // Log current value of "unknown sources" setting