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

Commit 90d3c037 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Temporarily disable to fix deadlock."

parents 87e1db35 3eef5a52
Loading
Loading
Loading
Loading
+17 −16
Original line number Diff line number Diff line
@@ -3058,22 +3058,23 @@ public class PackageManagerService extends IPackageManager.Stub {
     * purposefully done before acquiring {@link #mPackages} lock.
     */
    private int augmentFlagsForUser(int flags, int userId) {
        final IActivityManager am = ActivityManagerNative.getDefault();
        if (am == null) {
            // We must be early in boot, so the best we can do is assume the
            // user is fully running.
            return flags;
        }
        final long token = Binder.clearCallingIdentity();
        try {
            if (am.isUserRunning(userId, ActivityManager.FLAG_WITH_AMNESIA)) {
                flags |= PackageManager.FLAG_USER_RUNNING_WITH_AMNESIA;
            }
        } catch (RemoteException e) {
            throw e.rethrowAsRuntimeException();
        } finally {
            Binder.restoreCallingIdentity(token);
        }
        // TODO: bring back once locking fixed
//        final IActivityManager am = ActivityManagerNative.getDefault();
//        if (am == null) {
//            // We must be early in boot, so the best we can do is assume the
//            // user is fully running.
//            return flags;
//        }
//        final long token = Binder.clearCallingIdentity();
//        try {
//            if (am.isUserRunning(userId, ActivityManager.FLAG_WITH_AMNESIA)) {
//                flags |= PackageManager.FLAG_USER_RUNNING_WITH_AMNESIA;
//            }
//        } catch (RemoteException e) {
//            throw e.rethrowAsRuntimeException();
//        } finally {
//            Binder.restoreCallingIdentity(token);
//        }
        return flags;
    }