Loading services/core/java/com/android/server/pm/IncrementalStates.java +6 −5 Original line number Diff line number Diff line Loading @@ -61,12 +61,12 @@ public final class IncrementalStates { public IncrementalStates() { // By default the package is not startable and not fully loaded (i.e., is loading) this(false, true); this(false, true, 0); } public IncrementalStates(boolean isStartable, boolean isLoading) { public IncrementalStates(boolean isStartable, boolean isLoading, float loadingProgress) { mStartableState = new StartableState(isStartable); mLoadingState = new LoadingState(isLoading); mLoadingState = new LoadingState(isLoading, loadingProgress); mStatusConsumer = new StatusConsumer(); } Loading Loading @@ -405,9 +405,10 @@ public final class IncrementalStates { private boolean mIsLoading; private float mProgress; LoadingState(boolean isLoading) { LoadingState(boolean isLoading, float loadingProgress) { mIsLoading = isLoading; mProgress = isLoading ? 0 : 1; // loading progress is reset to 1 if loading has finished mProgress = isLoading ? loadingProgress : 1; } public boolean isLoading() { Loading services/core/java/com/android/server/pm/Settings.java +11 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ import android.os.SystemClock; import android.os.Trace; import android.os.UserHandle; import android.os.UserManager; import android.os.incremental.IncrementalManager; import android.os.storage.StorageManager; import android.os.storage.VolumeInfo; import android.service.pm.PackageServiceDumpProto; Loading Loading @@ -2957,6 +2958,8 @@ public final class Settings implements Watchable, Snappable { if (pkg.isPackageLoading()) { serializer.attributeBoolean(null, "isLoading", true); } serializer.attributeFloat(null, "loadingProgress", pkg.getIncrementalStates().getProgress()); writeUsesStaticLibLPw(serializer, pkg.usesStaticLibraries, pkg.usesStaticLibrariesVersions); Loading Loading @@ -3699,6 +3702,7 @@ public final class Settings implements Watchable, Snappable { boolean installedForceQueryable = false; boolean isStartable = false; boolean isLoading = false; float loadingProgress = 0; try { name = parser.getAttributeValue(null, ATTR_NAME); realName = parser.getAttributeValue(null, "realName"); Loading @@ -3717,6 +3721,7 @@ public final class Settings implements Watchable, Snappable { installedForceQueryable = parser.getAttributeBoolean(null, "forceQueryable", false); isStartable = parser.getAttributeBoolean(null, "isStartable", false); isLoading = parser.getAttributeBoolean(null, "isLoading", false); loadingProgress = parser.getAttributeFloat(null, "loadingProgress", 0); if (primaryCpuAbiString == null && legacyCpuAbiString != null) { primaryCpuAbiString = legacyCpuAbiString; Loading Loading @@ -3864,7 +3869,8 @@ public final class Settings implements Watchable, Snappable { packageSetting.secondaryCpuAbiString = secondaryCpuAbiString; packageSetting.updateAvailable = updateAvailable; packageSetting.forceQueryableOverride = installedForceQueryable; packageSetting.incrementalStates = new IncrementalStates(isStartable, isLoading); packageSetting.incrementalStates = new IncrementalStates(isStartable, isLoading, loadingProgress); // Handle legacy string here for single-user mode final String enabledStr = parser.getAttributeValue(null, ATTR_ENABLED); if (enabledStr != null) { Loading Loading @@ -4814,6 +4820,10 @@ public final class Settings implements Watchable, Snappable { pw.print(prefix); pw.print(" installerAttributionTag="); pw.println(ps.installSource.installerAttributionTag); } if (IncrementalManager.isIncrementalPath(ps.getPathString())) { pw.print(prefix); pw.println(" loadingProgress=" + (int) (ps.getIncrementalStates().getProgress() * 100) + "%"); } if (ps.volumeUuid != null) { pw.print(prefix); pw.print(" volumeUuid="); pw.println(ps.volumeUuid); Loading Loading
services/core/java/com/android/server/pm/IncrementalStates.java +6 −5 Original line number Diff line number Diff line Loading @@ -61,12 +61,12 @@ public final class IncrementalStates { public IncrementalStates() { // By default the package is not startable and not fully loaded (i.e., is loading) this(false, true); this(false, true, 0); } public IncrementalStates(boolean isStartable, boolean isLoading) { public IncrementalStates(boolean isStartable, boolean isLoading, float loadingProgress) { mStartableState = new StartableState(isStartable); mLoadingState = new LoadingState(isLoading); mLoadingState = new LoadingState(isLoading, loadingProgress); mStatusConsumer = new StatusConsumer(); } Loading Loading @@ -405,9 +405,10 @@ public final class IncrementalStates { private boolean mIsLoading; private float mProgress; LoadingState(boolean isLoading) { LoadingState(boolean isLoading, float loadingProgress) { mIsLoading = isLoading; mProgress = isLoading ? 0 : 1; // loading progress is reset to 1 if loading has finished mProgress = isLoading ? loadingProgress : 1; } public boolean isLoading() { Loading
services/core/java/com/android/server/pm/Settings.java +11 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ import android.os.SystemClock; import android.os.Trace; import android.os.UserHandle; import android.os.UserManager; import android.os.incremental.IncrementalManager; import android.os.storage.StorageManager; import android.os.storage.VolumeInfo; import android.service.pm.PackageServiceDumpProto; Loading Loading @@ -2957,6 +2958,8 @@ public final class Settings implements Watchable, Snappable { if (pkg.isPackageLoading()) { serializer.attributeBoolean(null, "isLoading", true); } serializer.attributeFloat(null, "loadingProgress", pkg.getIncrementalStates().getProgress()); writeUsesStaticLibLPw(serializer, pkg.usesStaticLibraries, pkg.usesStaticLibrariesVersions); Loading Loading @@ -3699,6 +3702,7 @@ public final class Settings implements Watchable, Snappable { boolean installedForceQueryable = false; boolean isStartable = false; boolean isLoading = false; float loadingProgress = 0; try { name = parser.getAttributeValue(null, ATTR_NAME); realName = parser.getAttributeValue(null, "realName"); Loading @@ -3717,6 +3721,7 @@ public final class Settings implements Watchable, Snappable { installedForceQueryable = parser.getAttributeBoolean(null, "forceQueryable", false); isStartable = parser.getAttributeBoolean(null, "isStartable", false); isLoading = parser.getAttributeBoolean(null, "isLoading", false); loadingProgress = parser.getAttributeFloat(null, "loadingProgress", 0); if (primaryCpuAbiString == null && legacyCpuAbiString != null) { primaryCpuAbiString = legacyCpuAbiString; Loading Loading @@ -3864,7 +3869,8 @@ public final class Settings implements Watchable, Snappable { packageSetting.secondaryCpuAbiString = secondaryCpuAbiString; packageSetting.updateAvailable = updateAvailable; packageSetting.forceQueryableOverride = installedForceQueryable; packageSetting.incrementalStates = new IncrementalStates(isStartable, isLoading); packageSetting.incrementalStates = new IncrementalStates(isStartable, isLoading, loadingProgress); // Handle legacy string here for single-user mode final String enabledStr = parser.getAttributeValue(null, ATTR_ENABLED); if (enabledStr != null) { Loading Loading @@ -4814,6 +4820,10 @@ public final class Settings implements Watchable, Snappable { pw.print(prefix); pw.print(" installerAttributionTag="); pw.println(ps.installSource.installerAttributionTag); } if (IncrementalManager.isIncrementalPath(ps.getPathString())) { pw.print(prefix); pw.println(" loadingProgress=" + (int) (ps.getIncrementalStates().getProgress() * 100) + "%"); } if (ps.volumeUuid != null) { pw.print(prefix); pw.print(" volumeUuid="); pw.println(ps.volumeUuid); Loading