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

Commit ae933504 authored by Ayush Sharma's avatar Ayush Sharma Committed by Android (Google) Code Review
Browse files

Merge "Fix deadlock between DPMS and AMS" into main

parents 93ae076b 058ebf6e
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -11004,25 +11004,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        }
    }
    private void dumpPerUserData(IndentingPrintWriter pw) {
    private void dumpPersonalAppInfoForSystemUserNoLock(IndentingPrintWriter pw) {
        wtfIfInLock();
        PersonalAppsSuspensionHelper.forUser(mContext, UserHandle.USER_SYSTEM).dump(pw);
    }
    private void dumpPerUserPolicyData(IndentingPrintWriter pw) {
        int userCount = mUserData.size();
        for (int i = 0; i < userCount; i++) {
            int userId = mUserData.keyAt(i);
            DevicePolicyData policy = getUserData(userId);
            policy.dump(pw);
            pw.println();
            if (userId == UserHandle.USER_SYSTEM) {
                pw.increaseIndent();
                PersonalAppsSuspensionHelper.forUser(mContext, userId).dump(pw);
                pw.decreaseIndent();
                pw.println();
            } else {
                // pm.getUnsuspendablePackages() will fail if it's called for a different user;
                // as this dump is mostly useful for system user anyways, we can just ignore the
                // others (rather than changing the permission check in the PM method)
                Slogf.d(LOG_TAG, "skipping PersonalAppsSuspensionHelper.dump() for user " + userId);
            }
        }
    }
@@ -11040,7 +11033,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                pw.println();
                mDeviceAdminServiceController.dump(pw);
                pw.println();
                dumpPerUserData(pw);
                dumpPerUserPolicyData(pw);
                pw.println();
                mConstants.dump(pw);
                pw.println();
@@ -11067,6 +11060,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                mStateCache.dump(pw);
                pw.println();
            }
            dumpPersonalAppInfoForSystemUserNoLock(pw);
            synchronized (mSubscriptionsChangedListenerLock) {
                pw.println("Subscription changed listener : " + mSubscriptionsChangedListener);