Loading core/java/android/content/pm/ApplicationInfo.java +13 −3 Original line number Diff line number Diff line Loading @@ -338,7 +338,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * the normal application lifecycle. * * <p>Comes from the * {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState} * android.R.styleable#AndroidManifestApplication_cantSaveState * attribute of the <application> tag. * * {@hide} Loading Loading @@ -457,6 +457,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public int targetSdkVersion; /** * The app's declared version code. * @hide */ public int versionCode; /** * When false, indicates that all components within this application are * considered disabled, regardless of their individually set enabled status. Loading Loading @@ -508,7 +514,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { if (sharedLibraryFiles != null) { pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles); } pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion); pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion + " versionCode=" + versionCode); if (manageSpaceActivityName != null) { pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName); } Loading Loading @@ -576,6 +583,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dataDir = orig.dataDir; uid = orig.uid; targetSdkVersion = orig.targetSdkVersion; versionCode = orig.versionCode; enabled = orig.enabled; enabledSetting = orig.enabledSetting; installLocation = orig.installLocation; Loading Loading @@ -616,6 +624,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(dataDir); dest.writeInt(uid); dest.writeInt(targetSdkVersion); dest.writeInt(versionCode); dest.writeInt(enabled ? 1 : 0); dest.writeInt(enabledSetting); dest.writeInt(installLocation); Loading Loading @@ -655,6 +664,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dataDir = source.readString(); uid = source.readInt(); targetSdkVersion = source.readInt(); versionCode = source.readInt(); enabled = source.readInt() != 0; enabledSetting = source.readInt(); installLocation = source.readInt(); Loading core/java/android/content/pm/PackageParser.java +1 −1 Original line number Diff line number Diff line Loading @@ -980,7 +980,7 @@ public class PackageParser { TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.AndroidManifest); pkg.mVersionCode = sa.getInteger( pkg.mVersionCode = pkg.applicationInfo.versionCode = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_versionCode, 0); pkg.mVersionName = sa.getNonConfigurationString( com.android.internal.R.styleable.AndroidManifest_versionName, 0); Loading core/java/com/android/internal/app/ProcessStats.java +486 −358 File changed.Preview size limit exceeded, changes collapsed. Show changes services/core/java/com/android/server/am/ProcessRecord.java +5 −4 Original line number Diff line number Diff line Loading @@ -392,14 +392,15 @@ final class ProcessRecord { origBase.makeInactive(); } baseProcessTracker = tracker.getProcessStateLocked(info.packageName, info.uid, processName); info.versionCode, processName); baseProcessTracker.makeActive(); for (int i=0; i<pkgList.size(); i++) { ProcessStats.ProcessState ps = pkgList.valueAt(i); if (ps != null && ps != origBase) { ps.makeInactive(); } ps = tracker.getProcessStateLocked(pkgList.keyAt(i), info.uid, processName); ps = tracker.getProcessStateLocked(pkgList.keyAt(i), info.uid, info.versionCode, processName); if (ps != baseProcessTracker) { ps.makeActive(); } Loading Loading @@ -572,7 +573,7 @@ final class ProcessRecord { if (!pkgList.containsKey(pkg)) { if (baseProcessTracker != null) { ProcessStats.ProcessState state = tracker.getProcessStateLocked( pkg, info.uid, processName); pkg, info.uid, info.versionCode, processName); pkgList.put(pkg, state); if (state != baseProcessTracker) { state.makeActive(); Loading Loading @@ -619,7 +620,7 @@ final class ProcessRecord { } pkgList.clear(); ProcessStats.ProcessState ps = tracker.getProcessStateLocked( info.packageName, info.uid, processName); info.packageName, info.uid, info.versionCode, processName); pkgList.put(info.packageName, ps); if (ps != baseProcessTracker) { ps.makeActive(); Loading services/core/java/com/android/server/am/ProcessStatsService.java +45 −33 Original line number Diff line number Diff line Loading @@ -108,13 +108,14 @@ public final class ProcessStatsService extends IProcessStats.Stub { } public ProcessStats.ProcessState getProcessStateLocked(String packageName, int uid, String processName) { return mProcessStats.getProcessStateLocked(packageName, uid, processName); int uid, int versionCode, String processName) { return mProcessStats.getProcessStateLocked(packageName, uid, versionCode, processName); } public ProcessStats.ServiceState getServiceStateLocked(String packageName, int uid, String processName, String className) { return mProcessStats.getServiceStateLocked(packageName, uid, processName, className); int versionCode, String processName, String className) { return mProcessStats.getServiceStateLocked(packageName, uid, versionCode, processName, className); } public boolean isMemFactorLowered() { Loading @@ -134,15 +135,17 @@ public final class ProcessStatsService extends IProcessStats.Stub { } mProcessStats.mMemFactor = memFactor; mProcessStats.mStartTime = now; ArrayMap<String, SparseArray<ProcessStats.PackageState>> pmap final ArrayMap<String, SparseArray<SparseArray<ProcessStats.PackageState>>> pmap = mProcessStats.mPackages.getMap(); for (int i=0; i<pmap.size(); i++) { SparseArray<ProcessStats.PackageState> uids = pmap.valueAt(i); for (int j=0; j<uids.size(); j++) { ProcessStats.PackageState pkg = uids.valueAt(j); ArrayMap<String, ProcessStats.ServiceState> services = pkg.mServices; for (int k=0; k<services.size(); k++) { ProcessStats.ServiceState service = services.valueAt(k); for (int ipkg=pmap.size()-1; ipkg>=0; ipkg--) { final SparseArray<SparseArray<ProcessStats.PackageState>> uids = pmap.valueAt(ipkg); for (int iuid=uids.size()-1; iuid>=0; iuid--) { final SparseArray<ProcessStats.PackageState> vers = uids.valueAt(iuid); for (int iver=vers.size()-1; iver>=0; iver--) { final ProcessStats.PackageState pkg = vers.valueAt(iver); final ArrayMap<String, ProcessStats.ServiceState> services = pkg.mServices; for (int isvc=services.size()-1; isvc>=0; isvc--) { final ProcessStats.ServiceState service = services.valueAt(isvc); if (service.isInUse()) { if (service.mStartedState != ProcessStats.STATE_NOTHING) { service.setStarted(true, memFactor, now); Loading @@ -154,6 +157,8 @@ public final class ProcessStatsService extends IProcessStats.Stub { service.setExecuting(true, memFactor, now); } } } } } } Loading Loading @@ -291,16 +296,21 @@ public final class ProcessStatsService extends IProcessStats.Stub { Slog.w(TAG, " Uid " + uids.keyAt(iu) + ": " + uids.valueAt(iu)); } } ArrayMap<String, SparseArray<ProcessStats.PackageState>> pkgMap ArrayMap<String, SparseArray<SparseArray<ProcessStats.PackageState>>> pkgMap = stats.mPackages.getMap(); final int NPKG = pkgMap.size(); for (int ip=0; ip<NPKG; ip++) { Slog.w(TAG, "Package: " + pkgMap.keyAt(ip)); SparseArray<ProcessStats.PackageState> uids = pkgMap.valueAt(ip); SparseArray<SparseArray<ProcessStats.PackageState>> uids = pkgMap.valueAt(ip); final int NUID = uids.size(); for (int iu=0; iu<NUID; iu++) { Slog.w(TAG, " Uid: " + uids.keyAt(iu)); ProcessStats.PackageState pkgState = uids.valueAt(iu); SparseArray<ProcessStats.PackageState> vers = uids.valueAt(iu); final int NVERS = vers.size(); for (int iv=0; iv<NVERS; iv++) { Slog.w(TAG, " Vers: " + vers.keyAt(iv)); ProcessStats.PackageState pkgState = vers.valueAt(iv); final int NPROCS = pkgState.mProcesses.size(); for (int iproc=0; iproc<NPROCS; iproc++) { Slog.w(TAG, " Process " + pkgState.mProcesses.keyAt(iproc) Loading @@ -310,6 +320,8 @@ public final class ProcessStatsService extends IProcessStats.Stub { for (int isvc=0; isvc<NSRVS; isvc++) { Slog.w(TAG, " Service " + pkgState.mServices.keyAt(isvc) + ": " + pkgState.mServices.valueAt(isvc)); } } } } Loading Loading
core/java/android/content/pm/ApplicationInfo.java +13 −3 Original line number Diff line number Diff line Loading @@ -338,7 +338,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * the normal application lifecycle. * * <p>Comes from the * {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState} * android.R.styleable#AndroidManifestApplication_cantSaveState * attribute of the <application> tag. * * {@hide} Loading Loading @@ -457,6 +457,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public int targetSdkVersion; /** * The app's declared version code. * @hide */ public int versionCode; /** * When false, indicates that all components within this application are * considered disabled, regardless of their individually set enabled status. Loading Loading @@ -508,7 +514,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { if (sharedLibraryFiles != null) { pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles); } pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion); pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion + " versionCode=" + versionCode); if (manageSpaceActivityName != null) { pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName); } Loading Loading @@ -576,6 +583,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dataDir = orig.dataDir; uid = orig.uid; targetSdkVersion = orig.targetSdkVersion; versionCode = orig.versionCode; enabled = orig.enabled; enabledSetting = orig.enabledSetting; installLocation = orig.installLocation; Loading Loading @@ -616,6 +624,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(dataDir); dest.writeInt(uid); dest.writeInt(targetSdkVersion); dest.writeInt(versionCode); dest.writeInt(enabled ? 1 : 0); dest.writeInt(enabledSetting); dest.writeInt(installLocation); Loading Loading @@ -655,6 +664,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dataDir = source.readString(); uid = source.readInt(); targetSdkVersion = source.readInt(); versionCode = source.readInt(); enabled = source.readInt() != 0; enabledSetting = source.readInt(); installLocation = source.readInt(); Loading
core/java/android/content/pm/PackageParser.java +1 −1 Original line number Diff line number Diff line Loading @@ -980,7 +980,7 @@ public class PackageParser { TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.AndroidManifest); pkg.mVersionCode = sa.getInteger( pkg.mVersionCode = pkg.applicationInfo.versionCode = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_versionCode, 0); pkg.mVersionName = sa.getNonConfigurationString( com.android.internal.R.styleable.AndroidManifest_versionName, 0); Loading
core/java/com/android/internal/app/ProcessStats.java +486 −358 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/core/java/com/android/server/am/ProcessRecord.java +5 −4 Original line number Diff line number Diff line Loading @@ -392,14 +392,15 @@ final class ProcessRecord { origBase.makeInactive(); } baseProcessTracker = tracker.getProcessStateLocked(info.packageName, info.uid, processName); info.versionCode, processName); baseProcessTracker.makeActive(); for (int i=0; i<pkgList.size(); i++) { ProcessStats.ProcessState ps = pkgList.valueAt(i); if (ps != null && ps != origBase) { ps.makeInactive(); } ps = tracker.getProcessStateLocked(pkgList.keyAt(i), info.uid, processName); ps = tracker.getProcessStateLocked(pkgList.keyAt(i), info.uid, info.versionCode, processName); if (ps != baseProcessTracker) { ps.makeActive(); } Loading Loading @@ -572,7 +573,7 @@ final class ProcessRecord { if (!pkgList.containsKey(pkg)) { if (baseProcessTracker != null) { ProcessStats.ProcessState state = tracker.getProcessStateLocked( pkg, info.uid, processName); pkg, info.uid, info.versionCode, processName); pkgList.put(pkg, state); if (state != baseProcessTracker) { state.makeActive(); Loading Loading @@ -619,7 +620,7 @@ final class ProcessRecord { } pkgList.clear(); ProcessStats.ProcessState ps = tracker.getProcessStateLocked( info.packageName, info.uid, processName); info.packageName, info.uid, info.versionCode, processName); pkgList.put(info.packageName, ps); if (ps != baseProcessTracker) { ps.makeActive(); Loading
services/core/java/com/android/server/am/ProcessStatsService.java +45 −33 Original line number Diff line number Diff line Loading @@ -108,13 +108,14 @@ public final class ProcessStatsService extends IProcessStats.Stub { } public ProcessStats.ProcessState getProcessStateLocked(String packageName, int uid, String processName) { return mProcessStats.getProcessStateLocked(packageName, uid, processName); int uid, int versionCode, String processName) { return mProcessStats.getProcessStateLocked(packageName, uid, versionCode, processName); } public ProcessStats.ServiceState getServiceStateLocked(String packageName, int uid, String processName, String className) { return mProcessStats.getServiceStateLocked(packageName, uid, processName, className); int versionCode, String processName, String className) { return mProcessStats.getServiceStateLocked(packageName, uid, versionCode, processName, className); } public boolean isMemFactorLowered() { Loading @@ -134,15 +135,17 @@ public final class ProcessStatsService extends IProcessStats.Stub { } mProcessStats.mMemFactor = memFactor; mProcessStats.mStartTime = now; ArrayMap<String, SparseArray<ProcessStats.PackageState>> pmap final ArrayMap<String, SparseArray<SparseArray<ProcessStats.PackageState>>> pmap = mProcessStats.mPackages.getMap(); for (int i=0; i<pmap.size(); i++) { SparseArray<ProcessStats.PackageState> uids = pmap.valueAt(i); for (int j=0; j<uids.size(); j++) { ProcessStats.PackageState pkg = uids.valueAt(j); ArrayMap<String, ProcessStats.ServiceState> services = pkg.mServices; for (int k=0; k<services.size(); k++) { ProcessStats.ServiceState service = services.valueAt(k); for (int ipkg=pmap.size()-1; ipkg>=0; ipkg--) { final SparseArray<SparseArray<ProcessStats.PackageState>> uids = pmap.valueAt(ipkg); for (int iuid=uids.size()-1; iuid>=0; iuid--) { final SparseArray<ProcessStats.PackageState> vers = uids.valueAt(iuid); for (int iver=vers.size()-1; iver>=0; iver--) { final ProcessStats.PackageState pkg = vers.valueAt(iver); final ArrayMap<String, ProcessStats.ServiceState> services = pkg.mServices; for (int isvc=services.size()-1; isvc>=0; isvc--) { final ProcessStats.ServiceState service = services.valueAt(isvc); if (service.isInUse()) { if (service.mStartedState != ProcessStats.STATE_NOTHING) { service.setStarted(true, memFactor, now); Loading @@ -154,6 +157,8 @@ public final class ProcessStatsService extends IProcessStats.Stub { service.setExecuting(true, memFactor, now); } } } } } } Loading Loading @@ -291,16 +296,21 @@ public final class ProcessStatsService extends IProcessStats.Stub { Slog.w(TAG, " Uid " + uids.keyAt(iu) + ": " + uids.valueAt(iu)); } } ArrayMap<String, SparseArray<ProcessStats.PackageState>> pkgMap ArrayMap<String, SparseArray<SparseArray<ProcessStats.PackageState>>> pkgMap = stats.mPackages.getMap(); final int NPKG = pkgMap.size(); for (int ip=0; ip<NPKG; ip++) { Slog.w(TAG, "Package: " + pkgMap.keyAt(ip)); SparseArray<ProcessStats.PackageState> uids = pkgMap.valueAt(ip); SparseArray<SparseArray<ProcessStats.PackageState>> uids = pkgMap.valueAt(ip); final int NUID = uids.size(); for (int iu=0; iu<NUID; iu++) { Slog.w(TAG, " Uid: " + uids.keyAt(iu)); ProcessStats.PackageState pkgState = uids.valueAt(iu); SparseArray<ProcessStats.PackageState> vers = uids.valueAt(iu); final int NVERS = vers.size(); for (int iv=0; iv<NVERS; iv++) { Slog.w(TAG, " Vers: " + vers.keyAt(iv)); ProcessStats.PackageState pkgState = vers.valueAt(iv); final int NPROCS = pkgState.mProcesses.size(); for (int iproc=0; iproc<NPROCS; iproc++) { Slog.w(TAG, " Process " + pkgState.mProcesses.keyAt(iproc) Loading @@ -310,6 +320,8 @@ public final class ProcessStatsService extends IProcessStats.Stub { for (int isvc=0; isvc<NSRVS; isvc++) { Slog.w(TAG, " Service " + pkgState.mServices.keyAt(isvc) + ": " + pkgState.mServices.valueAt(isvc)); } } } } Loading