Loading core/java/android/content/pm/ApplicationInfo.java +24 −6 Original line number Diff line number Diff line Loading @@ -912,7 +912,17 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * The app's declared version code. * @hide */ public long versionCode; public long longVersionCode; /** * An integer representation of the app's declared version code. This is being left in place as * some apps were using reflection to access it before the move to long in * {@link android.os.Build.VERSION_CODES#P} * @deprecated Use {@link #longVersionCode} instead. * @hide */ @Deprecated public int versionCode; /** * The user-visible SDK version (ex. 26) of the framework against which the application claims Loading Loading @@ -1222,7 +1232,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { pw.println(prefix + "enabled=" + enabled + " minSdkVersion=" + minSdkVersion + " targetSdkVersion=" + targetSdkVersion + " versionCode=" + versionCode + " versionCode=" + longVersionCode + " targetSandboxVersion=" + targetSandboxVersion); if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { if (manageSpaceActivityName != null) { Loading Loading @@ -1295,7 +1305,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { proto.write(ApplicationInfoProto.Version.ENABLED, enabled); proto.write(ApplicationInfoProto.Version.MIN_SDK_VERSION, minSdkVersion); proto.write(ApplicationInfoProto.Version.TARGET_SDK_VERSION, targetSdkVersion); proto.write(ApplicationInfoProto.Version.VERSION_CODE, versionCode); proto.write(ApplicationInfoProto.Version.VERSION_CODE, longVersionCode); proto.write(ApplicationInfoProto.Version.TARGET_SANDBOX_VERSION, targetSandboxVersion); proto.end(versionToken); Loading Loading @@ -1429,7 +1439,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = orig.uid; minSdkVersion = orig.minSdkVersion; targetSdkVersion = orig.targetSdkVersion; versionCode = orig.versionCode; setVersionCode(orig.longVersionCode); enabled = orig.enabled; enabledSetting = orig.enabledSetting; installLocation = orig.installLocation; Loading Loading @@ -1503,7 +1513,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeInt(uid); dest.writeInt(minSdkVersion); dest.writeInt(targetSdkVersion); dest.writeLong(versionCode); dest.writeLong(longVersionCode); dest.writeInt(enabled ? 1 : 0); dest.writeInt(enabledSetting); dest.writeInt(installLocation); Loading Loading @@ -1574,7 +1584,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = source.readInt(); minSdkVersion = source.readInt(); targetSdkVersion = source.readInt(); versionCode = source.readLong(); setVersionCode(source.readLong()); enabled = source.readInt() != 0; enabledSetting = source.readInt(); installLocation = source.readInt(); Loading Loading @@ -1694,6 +1704,14 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { mHiddenApiPolicy = policy; } /** * @hide */ public void setVersionCode(long newVersionCode) { longVersionCode = newVersionCode; versionCode = (int) newVersionCode; } /** * @hide */ Loading core/java/android/content/pm/PackageParser.java +1 −1 Original line number Diff line number Diff line Loading @@ -1918,7 +1918,7 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifest_versionCode, 0); pkg.mVersionCodeMajor = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_versionCodeMajor, 0); pkg.applicationInfo.versionCode = pkg.getLongVersionCode(); pkg.applicationInfo.setVersionCode(pkg.getLongVersionCode()); pkg.baseRevisionCode = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_revisionCode, 0); pkg.mVersionName = sa.getNonConfigurationString( Loading services/core/java/com/android/server/am/ActiveServices.java +2 −2 Original line number Diff line number Diff line Loading @@ -2283,7 +2283,7 @@ public final class ActiveServices { + " app=" + app); if (app != null && app.thread != null) { try { app.addPackage(r.appInfo.packageName, r.appInfo.versionCode, mAm.mProcessStats); app.addPackage(r.appInfo.packageName, r.appInfo.longVersionCode, mAm.mProcessStats); realStartServiceLocked(r, app, execInFg); return null; } catch (TransactionTooLargeException e) { Loading Loading @@ -3009,7 +3009,7 @@ public final class ActiveServices { mPendingServices.remove(i); i--; proc.addPackage(sr.appInfo.packageName, sr.appInfo.versionCode, proc.addPackage(sr.appInfo.packageName, sr.appInfo.longVersionCode, mAm.mProcessStats); realStartServiceLocked(sr, proc, sr.createdFromFg); didSomething = true; Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +1 −1 Original line number Diff line number Diff line Loading @@ -1579,7 +1579,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D // to run in multiple processes, because this is actually // part of the framework so doesn't make sense to track as a // separate apk in the process. app.addPackage(r.info.packageName, r.info.applicationInfo.versionCode, app.addPackage(r.info.packageName, r.info.applicationInfo.longVersionCode, mService.mProcessStats); } realStartActivityLocked(r, app, andResume, checkConfig); Loading services/core/java/com/android/server/am/ProcessRecord.java +6 −6 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ final class ProcessRecord { uid = _uid; userId = UserHandle.getUserId(_uid); processName = _processName; pkgList.put(_info.packageName, new ProcessStats.ProcessStateHolder(_info.versionCode)); pkgList.put(_info.packageName, new ProcessStats.ProcessStateHolder(_info.longVersionCode)); maxAdj = ProcessList.UNKNOWN_ADJ; curRawAdj = setRawAdj = ProcessList.INVALID_ADJ; curAdj = setAdj = verifiedAdj = ProcessList.INVALID_ADJ; Loading @@ -521,7 +521,7 @@ final class ProcessRecord { origBase.makeInactive(); } baseProcessTracker = tracker.getProcessStateLocked(info.packageName, uid, info.versionCode, processName); info.longVersionCode, processName); baseProcessTracker.makeActive(); for (int i=0; i<pkgList.size(); i++) { ProcessStats.ProcessStateHolder holder = pkgList.valueAt(i); Loading @@ -529,7 +529,7 @@ final class ProcessRecord { holder.state.makeInactive(); } holder.state = tracker.getProcessStateLocked(pkgList.keyAt(i), uid, info.versionCode, processName); info.longVersionCode, processName); if (holder.state != baseProcessTracker) { holder.state.makeActive(); } Loading Loading @@ -828,9 +828,9 @@ final class ProcessRecord { } pkgList.clear(); ProcessState ps = tracker.getProcessStateLocked( info.packageName, uid, info.versionCode, processName); info.packageName, uid, info.longVersionCode, processName); ProcessStats.ProcessStateHolder holder = new ProcessStats.ProcessStateHolder( info.versionCode); info.longVersionCode); holder.state = ps; pkgList.put(info.packageName, holder); if (ps != baseProcessTracker) { Loading @@ -839,7 +839,7 @@ final class ProcessRecord { } } else if (N != 1) { pkgList.clear(); pkgList.put(info.packageName, new ProcessStats.ProcessStateHolder(info.versionCode)); pkgList.put(info.packageName, new ProcessStats.ProcessStateHolder(info.longVersionCode)); } } Loading Loading
core/java/android/content/pm/ApplicationInfo.java +24 −6 Original line number Diff line number Diff line Loading @@ -912,7 +912,17 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * The app's declared version code. * @hide */ public long versionCode; public long longVersionCode; /** * An integer representation of the app's declared version code. This is being left in place as * some apps were using reflection to access it before the move to long in * {@link android.os.Build.VERSION_CODES#P} * @deprecated Use {@link #longVersionCode} instead. * @hide */ @Deprecated public int versionCode; /** * The user-visible SDK version (ex. 26) of the framework against which the application claims Loading Loading @@ -1222,7 +1232,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { pw.println(prefix + "enabled=" + enabled + " minSdkVersion=" + minSdkVersion + " targetSdkVersion=" + targetSdkVersion + " versionCode=" + versionCode + " versionCode=" + longVersionCode + " targetSandboxVersion=" + targetSandboxVersion); if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { if (manageSpaceActivityName != null) { Loading Loading @@ -1295,7 +1305,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { proto.write(ApplicationInfoProto.Version.ENABLED, enabled); proto.write(ApplicationInfoProto.Version.MIN_SDK_VERSION, minSdkVersion); proto.write(ApplicationInfoProto.Version.TARGET_SDK_VERSION, targetSdkVersion); proto.write(ApplicationInfoProto.Version.VERSION_CODE, versionCode); proto.write(ApplicationInfoProto.Version.VERSION_CODE, longVersionCode); proto.write(ApplicationInfoProto.Version.TARGET_SANDBOX_VERSION, targetSandboxVersion); proto.end(versionToken); Loading Loading @@ -1429,7 +1439,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = orig.uid; minSdkVersion = orig.minSdkVersion; targetSdkVersion = orig.targetSdkVersion; versionCode = orig.versionCode; setVersionCode(orig.longVersionCode); enabled = orig.enabled; enabledSetting = orig.enabledSetting; installLocation = orig.installLocation; Loading Loading @@ -1503,7 +1513,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeInt(uid); dest.writeInt(minSdkVersion); dest.writeInt(targetSdkVersion); dest.writeLong(versionCode); dest.writeLong(longVersionCode); dest.writeInt(enabled ? 1 : 0); dest.writeInt(enabledSetting); dest.writeInt(installLocation); Loading Loading @@ -1574,7 +1584,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = source.readInt(); minSdkVersion = source.readInt(); targetSdkVersion = source.readInt(); versionCode = source.readLong(); setVersionCode(source.readLong()); enabled = source.readInt() != 0; enabledSetting = source.readInt(); installLocation = source.readInt(); Loading Loading @@ -1694,6 +1704,14 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { mHiddenApiPolicy = policy; } /** * @hide */ public void setVersionCode(long newVersionCode) { longVersionCode = newVersionCode; versionCode = (int) newVersionCode; } /** * @hide */ Loading
core/java/android/content/pm/PackageParser.java +1 −1 Original line number Diff line number Diff line Loading @@ -1918,7 +1918,7 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifest_versionCode, 0); pkg.mVersionCodeMajor = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_versionCodeMajor, 0); pkg.applicationInfo.versionCode = pkg.getLongVersionCode(); pkg.applicationInfo.setVersionCode(pkg.getLongVersionCode()); pkg.baseRevisionCode = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_revisionCode, 0); pkg.mVersionName = sa.getNonConfigurationString( Loading
services/core/java/com/android/server/am/ActiveServices.java +2 −2 Original line number Diff line number Diff line Loading @@ -2283,7 +2283,7 @@ public final class ActiveServices { + " app=" + app); if (app != null && app.thread != null) { try { app.addPackage(r.appInfo.packageName, r.appInfo.versionCode, mAm.mProcessStats); app.addPackage(r.appInfo.packageName, r.appInfo.longVersionCode, mAm.mProcessStats); realStartServiceLocked(r, app, execInFg); return null; } catch (TransactionTooLargeException e) { Loading Loading @@ -3009,7 +3009,7 @@ public final class ActiveServices { mPendingServices.remove(i); i--; proc.addPackage(sr.appInfo.packageName, sr.appInfo.versionCode, proc.addPackage(sr.appInfo.packageName, sr.appInfo.longVersionCode, mAm.mProcessStats); realStartServiceLocked(sr, proc, sr.createdFromFg); didSomething = true; Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +1 −1 Original line number Diff line number Diff line Loading @@ -1579,7 +1579,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D // to run in multiple processes, because this is actually // part of the framework so doesn't make sense to track as a // separate apk in the process. app.addPackage(r.info.packageName, r.info.applicationInfo.versionCode, app.addPackage(r.info.packageName, r.info.applicationInfo.longVersionCode, mService.mProcessStats); } realStartActivityLocked(r, app, andResume, checkConfig); Loading
services/core/java/com/android/server/am/ProcessRecord.java +6 −6 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ final class ProcessRecord { uid = _uid; userId = UserHandle.getUserId(_uid); processName = _processName; pkgList.put(_info.packageName, new ProcessStats.ProcessStateHolder(_info.versionCode)); pkgList.put(_info.packageName, new ProcessStats.ProcessStateHolder(_info.longVersionCode)); maxAdj = ProcessList.UNKNOWN_ADJ; curRawAdj = setRawAdj = ProcessList.INVALID_ADJ; curAdj = setAdj = verifiedAdj = ProcessList.INVALID_ADJ; Loading @@ -521,7 +521,7 @@ final class ProcessRecord { origBase.makeInactive(); } baseProcessTracker = tracker.getProcessStateLocked(info.packageName, uid, info.versionCode, processName); info.longVersionCode, processName); baseProcessTracker.makeActive(); for (int i=0; i<pkgList.size(); i++) { ProcessStats.ProcessStateHolder holder = pkgList.valueAt(i); Loading @@ -529,7 +529,7 @@ final class ProcessRecord { holder.state.makeInactive(); } holder.state = tracker.getProcessStateLocked(pkgList.keyAt(i), uid, info.versionCode, processName); info.longVersionCode, processName); if (holder.state != baseProcessTracker) { holder.state.makeActive(); } Loading Loading @@ -828,9 +828,9 @@ final class ProcessRecord { } pkgList.clear(); ProcessState ps = tracker.getProcessStateLocked( info.packageName, uid, info.versionCode, processName); info.packageName, uid, info.longVersionCode, processName); ProcessStats.ProcessStateHolder holder = new ProcessStats.ProcessStateHolder( info.versionCode); info.longVersionCode); holder.state = ps; pkgList.put(info.packageName, holder); if (ps != baseProcessTracker) { Loading @@ -839,7 +839,7 @@ final class ProcessRecord { } } else if (N != 1) { pkgList.clear(); pkgList.put(info.packageName, new ProcessStats.ProcessStateHolder(info.versionCode)); pkgList.put(info.packageName, new ProcessStats.ProcessStateHolder(info.longVersionCode)); } } Loading