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

Commit 8d4355e6 authored by Winson Chiu's avatar Winson Chiu Committed by Automerger Merge Worker
Browse files

Merge "Revert "Only dump necessary info when specifying a package"" into sc-dev am: 7708fd97

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15433531

Change-Id: Iad44fd027e325f790ba5eba2b47bf7dfcdf99108
parents f315a466 7708fd97
Loading
Loading
Loading
Loading
+48 −88
Original line number Original line Diff line number Diff line
@@ -24838,12 +24838,12 @@ public class PackageManagerService extends IPackageManager.Stub
            pw.println("vers,1");
            pw.println("vers,1");
        }
        }
        if (!checkin
        // reader
                && dumpState.isDumping(DumpState.DUMP_VERSION)
        if (dumpState.isDumping(DumpState.DUMP_VERSION) && packageName == null) {
                && packageName == null) {
            if (!checkin) {
            // dump version information for all volumes with installed packages
                dump(DumpState.DUMP_VERSION, fd, pw, dumpState);
                dump(DumpState.DUMP_VERSION, fd, pw, dumpState);
            }
            }
        }
        if (!checkin
        if (!checkin
                && dumpState.isDumping(DumpState.DUMP_KNOWN_PACKAGES)
                && dumpState.isDumping(DumpState.DUMP_KNOWN_PACKAGES)
@@ -24873,8 +24873,7 @@ public class PackageManagerService extends IPackageManager.Stub
            ipw.decreaseIndent();
            ipw.decreaseIndent();
        }
        }
        if (dumpState.isDumping(DumpState.DUMP_VERIFIERS)
        if (dumpState.isDumping(DumpState.DUMP_VERIFIERS) && packageName == null) {
                && packageName == null) {
            final String requiredVerifierPackage = mRequiredVerifierPackage;
            final String requiredVerifierPackage = mRequiredVerifierPackage;
            if (!checkin) {
            if (!checkin) {
                if (dumpState.onTitlePrinted()) {
                if (dumpState.onTitlePrinted()) {
@@ -24895,8 +24894,7 @@ public class PackageManagerService extends IPackageManager.Stub
            }
            }
        }
        }
        if (dumpState.isDumping(DumpState.DUMP_DOMAIN_VERIFIER)
        if (dumpState.isDumping(DumpState.DUMP_DOMAIN_VERIFIER) && packageName == null) {
                && packageName == null) {
            final DomainVerificationProxy proxy = mDomainVerificationManager.getProxy();
            final DomainVerificationProxy proxy = mDomainVerificationManager.getProxy();
            final ComponentName verifierComponent = proxy.getComponentName();
            final ComponentName verifierComponent = proxy.getComponentName();
            if (verifierComponent != null) {
            if (verifierComponent != null) {
@@ -24923,13 +24921,11 @@ public class PackageManagerService extends IPackageManager.Stub
            }
            }
        }
        }
        if (dumpState.isDumping(DumpState.DUMP_LIBS)
        if (dumpState.isDumping(DumpState.DUMP_LIBS) && packageName == null) {
                && packageName == null) {
            dump(DumpState.DUMP_LIBS, fd, pw, dumpState);
            dump(DumpState.DUMP_LIBS, fd, pw, dumpState);
        }
        }
        if (dumpState.isDumping(DumpState.DUMP_FEATURES)
        if (dumpState.isDumping(DumpState.DUMP_FEATURES) && packageName == null) {
                && packageName == null) {
            if (dumpState.onTitlePrinted()) {
            if (dumpState.onTitlePrinted()) {
                pw.println();
                pw.println();
            }
            }
@@ -24939,7 +24935,12 @@ public class PackageManagerService extends IPackageManager.Stub
            synchronized (mAvailableFeatures) {
            synchronized (mAvailableFeatures) {
                for (FeatureInfo feat : mAvailableFeatures.values()) {
                for (FeatureInfo feat : mAvailableFeatures.values()) {
                    if (!checkin) {
                    if (checkin) {
                        pw.print("feat,");
                        pw.print(feat.name);
                        pw.print(",");
                        pw.println(feat.version);
                    } else {
                        pw.print("  ");
                        pw.print("  ");
                        pw.print(feat.name);
                        pw.print(feat.name);
                        if (feat.version > 0) {
                        if (feat.version > 0) {
@@ -24947,73 +24948,55 @@ public class PackageManagerService extends IPackageManager.Stub
                            pw.print(feat.version);
                            pw.print(feat.version);
                        }
                        }
                        pw.println();
                        pw.println();
                    } else {
                        pw.print("feat,");
                        pw.print(feat.name);
                        pw.print(",");
                        pw.println(feat.version);
                    }
                    }
                }
                }
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_ACTIVITY_RESOLVERS)) {
                && dumpState.isDumping(DumpState.DUMP_ACTIVITY_RESOLVERS)) {
            synchronized (mLock) {
            synchronized (mLock) {
                mComponentResolver.dumpActivityResolvers(pw, dumpState, packageName);
                mComponentResolver.dumpActivityResolvers(pw, dumpState, packageName);
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_RECEIVER_RESOLVERS)) {
                && dumpState.isDumping(DumpState.DUMP_RECEIVER_RESOLVERS)) {
            synchronized (mLock) {
            synchronized (mLock) {
                mComponentResolver.dumpReceiverResolvers(pw, dumpState, packageName);
                mComponentResolver.dumpReceiverResolvers(pw, dumpState, packageName);
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_SERVICE_RESOLVERS)) {
                && dumpState.isDumping(DumpState.DUMP_SERVICE_RESOLVERS)) {
            synchronized (mLock) {
            synchronized (mLock) {
                mComponentResolver.dumpServiceResolvers(pw, dumpState, packageName);
                mComponentResolver.dumpServiceResolvers(pw, dumpState, packageName);
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_CONTENT_RESOLVERS)) {
                && dumpState.isDumping(DumpState.DUMP_CONTENT_RESOLVERS)) {
            synchronized (mLock) {
            synchronized (mLock) {
                mComponentResolver.dumpProviderResolvers(pw, dumpState, packageName);
                mComponentResolver.dumpProviderResolvers(pw, dumpState, packageName);
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_PREFERRED)) {
                && dumpState.isDumping(DumpState.DUMP_PREFERRED)
                && packageName == null) {
            dump(DumpState.DUMP_PREFERRED, fd, pw, dumpState);
            dump(DumpState.DUMP_PREFERRED, fd, pw, dumpState);
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_PREFERRED_XML)) {
                && dumpState.isDumping(DumpState.DUMP_PREFERRED_XML)
                && packageName == null) {
            dump(DumpState.DUMP_PREFERRED_XML, fd, pw, dumpState);
            dump(DumpState.DUMP_PREFERRED_XML, fd, pw, dumpState);
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_DOMAIN_PREFERRED)) {
                && dumpState.isDumping(DumpState.DUMP_DOMAIN_PREFERRED)
                && packageName == null) {
            dump(DumpState.DUMP_DOMAIN_PREFERRED, fd, pw, dumpState);
            dump(DumpState.DUMP_DOMAIN_PREFERRED, fd, pw, dumpState);
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_PERMISSIONS)) {
                && dumpState.isDumping(DumpState.DUMP_PERMISSIONS)) {
            mSettings.dumpPermissions(pw, packageName, permissionNames, dumpState);
            mSettings.dumpPermissions(pw, packageName, permissionNames, dumpState);
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_PROVIDERS)) {
                && dumpState.isDumping(DumpState.DUMP_PROVIDERS)) {
            synchronized (mLock) {
            synchronized (mLock) {
                mComponentResolver.dumpContentProviders(pw, dumpState, packageName);
                mComponentResolver.dumpContentProviders(pw, dumpState, packageName);
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_KEYSETS)) {
                && dumpState.isDumping(DumpState.DUMP_KEYSETS)) {
            synchronized (mLock) {
            synchronized (mLock) {
                mSettings.getKeySetManagerService().dumpLPr(pw, packageName, dumpState);
                mSettings.getKeySetManagerService().dumpLPr(pw, packageName, dumpState);
            }
            }
@@ -25028,15 +25011,11 @@ public class PackageManagerService extends IPackageManager.Stub
            }
            }
        }
        }
        if (!checkin
        if (dumpState.isDumping(DumpState.DUMP_QUERIES)) {
                && dumpState.isDumping(DumpState.DUMP_QUERIES)
                && packageName == null) {
            dump(DumpState.DUMP_QUERIES, fd, pw, dumpState);
            dump(DumpState.DUMP_QUERIES, fd, pw, dumpState);
        }
        }
        if (!checkin
        if (dumpState.isDumping(DumpState.DUMP_SHARED_USERS)) {
                && dumpState.isDumping(DumpState.DUMP_SHARED_USERS)
                && packageName == null) {
            // This cannot be moved to ComputerEngine since the set of packages in the
            // This cannot be moved to ComputerEngine since the set of packages in the
            // SharedUserSetting do not have a copy.
            // SharedUserSetting do not have a copy.
            synchronized (mLock) {
            synchronized (mLock) {
@@ -25044,9 +25023,7 @@ public class PackageManagerService extends IPackageManager.Stub
            }
            }
        }
        }
        if (!checkin
        if (dumpState.isDumping(DumpState.DUMP_CHANGES)) {
                && dumpState.isDumping(DumpState.DUMP_CHANGES)
                && packageName == null) {
            if (dumpState.onTitlePrinted()) pw.println();
            if (dumpState.onTitlePrinted()) pw.println();
            pw.println("Package Changes:");
            pw.println("Package Changes:");
            synchronized (mLock) {
            synchronized (mLock) {
@@ -25073,9 +25050,7 @@ public class PackageManagerService extends IPackageManager.Stub
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_FROZEN) && packageName == null) {
                && dumpState.isDumping(DumpState.DUMP_FROZEN)
                && packageName == null) {
            // XXX should handle packageName != null by dumping only install data that
            // XXX should handle packageName != null by dumping only install data that
            // the given package is involved with.
            // the given package is involved with.
            if (dumpState.onTitlePrinted()) pw.println();
            if (dumpState.onTitlePrinted()) pw.println();
@@ -25096,9 +25071,7 @@ public class PackageManagerService extends IPackageManager.Stub
            ipw.decreaseIndent();
            ipw.decreaseIndent();
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_VOLUMES) && packageName == null) {
                && dumpState.isDumping(DumpState.DUMP_VOLUMES)
                && packageName == null) {
            if (dumpState.onTitlePrinted()) pw.println();
            if (dumpState.onTitlePrinted()) pw.println();
            final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "  ", 120);
            final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "  ", 120);
@@ -25117,31 +25090,24 @@ public class PackageManagerService extends IPackageManager.Stub
            ipw.decreaseIndent();
            ipw.decreaseIndent();
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_SERVICE_PERMISSIONS)
                && dumpState.isDumping(DumpState.DUMP_SERVICE_PERMISSIONS)
                && packageName == null) {
                && packageName == null) {
            synchronized (mLock) {
            synchronized (mLock) {
                mComponentResolver.dumpServicePermissions(pw, dumpState);
                mComponentResolver.dumpServicePermissions(pw, dumpState);
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_DEXOPT)) {
                && dumpState.isDumping(DumpState.DUMP_DEXOPT)
                && packageName == null) {
            if (dumpState.onTitlePrinted()) pw.println();
            if (dumpState.onTitlePrinted()) pw.println();
            dump(DumpState.DUMP_DEXOPT, fd, pw, dumpState);
            dump(DumpState.DUMP_DEXOPT, fd, pw, dumpState);
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_COMPILER_STATS)) {
                && dumpState.isDumping(DumpState.DUMP_COMPILER_STATS)
                && packageName == null) {
            if (dumpState.onTitlePrinted()) pw.println();
            if (dumpState.onTitlePrinted()) pw.println();
            dump(DumpState.DUMP_COMPILER_STATS, fd, pw, dumpState);
            dump(DumpState.DUMP_COMPILER_STATS, fd, pw, dumpState);
        }
        }
        if (dumpState.isDumping(DumpState.DUMP_MESSAGES)
        if (!checkin && dumpState.isDumping(DumpState.DUMP_MESSAGES) && packageName == null) {
                && packageName == null) {
            if (!checkin) {
            if (dumpState.onTitlePrinted()) pw.println();
            if (dumpState.onTitlePrinted()) pw.println();
            synchronized (mLock) {
            synchronized (mLock) {
                mSettings.dumpReadMessagesLPr(pw, dumpState);
                mSettings.dumpReadMessagesLPr(pw, dumpState);
@@ -25149,29 +25115,25 @@ public class PackageManagerService extends IPackageManager.Stub
            pw.println();
            pw.println();
            pw.println("Package warning messages:");
            pw.println("Package warning messages:");
            dumpCriticalInfo(pw, null);
            dumpCriticalInfo(pw, null);
            } else {
                dumpCriticalInfo(pw, "msg,");
        }
        }
        if (checkin && dumpState.isDumping(DumpState.DUMP_MESSAGES)) {
            dumpCriticalInfo(pw, "msg,");
        }
        }
        // PackageInstaller should be called outside of mPackages lock
        // PackageInstaller should be called outside of mPackages lock
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_INSTALLS) && packageName == null) {
                && dumpState.isDumping(DumpState.DUMP_INSTALLS)
                && packageName == null) {
            // XXX should handle packageName != null by dumping only install data that
            // XXX should handle packageName != null by dumping only install data that
            // the given package is involved with.
            // the given package is involved with.
            if (dumpState.onTitlePrinted()) pw.println();
            if (dumpState.onTitlePrinted()) pw.println();
            mInstallerService.dump(new IndentingPrintWriter(pw, "  ", 120));
            mInstallerService.dump(new IndentingPrintWriter(pw, "  ", 120));
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_APEX)) {
                && dumpState.isDumping(DumpState.DUMP_APEX)
                && packageName == null) {
            mApexManager.dump(pw, packageName);
            mApexManager.dump(pw, packageName);
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_PER_UID_READ_TIMEOUTS)
                && dumpState.isDumping(DumpState.DUMP_PER_UID_READ_TIMEOUTS)
                && packageName == null) {
                && packageName == null) {
            pw.println();
            pw.println();
            pw.println("Per UID read timeouts:");
            pw.println("Per UID read timeouts:");
@@ -25190,9 +25152,7 @@ public class PackageManagerService extends IPackageManager.Stub
            }
            }
        }
        }
        if (!checkin
        if (!checkin && dumpState.isDumping(DumpState.DUMP_SNAPSHOT_STATISTICS)) {
                && dumpState.isDumping(DumpState.DUMP_SNAPSHOT_STATISTICS)
                && packageName == null) {
            pw.println("Snapshot statistics");
            pw.println("Snapshot statistics");
            if (!mSnapshotEnabled) {
            if (!mSnapshotEnabled) {
                pw.println("  Snapshots disabled");
                pw.println("  Snapshots disabled");