Loading services/core/java/com/android/server/BinaryTransparencyService.java +62 −47 Original line number Diff line number Diff line Loading @@ -21,10 +21,12 @@ import android.annotation.Nullable; import android.annotation.SuppressLint; import android.apex.ApexInfo; import android.apex.IApexService; import android.app.compat.CompatChanges; import android.app.job.JobInfo; import android.app.job.JobParameters; import android.app.job.JobScheduler; import android.app.job.JobService; import android.compat.annotation.ChangeId; import android.content.ComponentName; import android.content.Context; import android.content.pm.ApplicationInfo; Loading Loading @@ -126,6 +128,14 @@ public class BinaryTransparencyService extends SystemService { // the system time (in ms) the last measurement was taken private long mMeasurementsLastRecordedMs; /** * Guards whether or not measurements of MBA to be performed. When this change is enabled, * measurements of MBAs are performed. But when it is disabled, only measurements of APEX * and modules are done. */ @ChangeId public static final long LOG_MBA_INFO = 245692487L; final class BinaryTransparencyServiceImpl extends IBinaryTransparencyService.Stub { @Override Loading Loading @@ -336,6 +346,7 @@ public class BinaryTransparencyService extends SystemService { + " packages after considering preloads"); } if (CompatChanges.isChangeEnabled(LOG_MBA_INFO)) { // lastly measure all newly installed MBAs for (PackageInfo packageInfo : getNewlyInstalledMbas()) { if (packagesMeasured.contains(packageInfo.packageName)) { Loading @@ -353,7 +364,8 @@ public class BinaryTransparencyService extends SystemService { // then extract package's InstallSourceInfo if (DEBUG) { Slog.d(TAG, "Extracting InstallSourceInfo for " + packageInfo.packageName); Slog.d(TAG, "Extracting InstallSourceInfo for " + packageInfo.packageName); } InstallSourceInfo installSourceInfo = getInstallSourceInfo( packageInfo.packageName); Loading @@ -365,7 +377,8 @@ public class BinaryTransparencyService extends SystemService { if (installSourceInfo != null) { initiator = installSourceInfo.getInitiatingPackageName(); initiatorSignerInfo = installSourceInfo.getInitiatingPackageSigningInfo(); initiatorSignerInfo = installSourceInfo.getInitiatingPackageSigningInfo(); if (initiatorSignerInfo != null) { initiatorSignerInfoDigest = computePackageSignerSha256Digests( initiatorSignerInfo); Loading @@ -379,7 +392,8 @@ public class BinaryTransparencyService extends SystemService { FrameworkStatsLog.write(FrameworkStatsLog.MOBILE_BUNDLED_APP_INFO_GATHERED, packageInfo.packageName, packageInfo.getLongVersionCode(), (cDigest != null) ? HexEncoding.encodeToString(cDigest, false) : null, (cDigest != null) ? HexEncoding.encodeToString(cDigest, false) : null, packageMeasurement.getInt(BUNDLE_CONTENT_DIGEST_ALGORITHM), signerDigestHexStrings, MBA_STATUS_NEW_INSTALL, // mba_status Loading @@ -390,6 +404,7 @@ public class BinaryTransparencyService extends SystemService { ); } } } if (DEBUG) { long timeSpentMeasuring = System.currentTimeMillis() - currentTimeMs; Slog.d(TAG, "Measured " + packagesMeasured.size() Loading Loading
services/core/java/com/android/server/BinaryTransparencyService.java +62 −47 Original line number Diff line number Diff line Loading @@ -21,10 +21,12 @@ import android.annotation.Nullable; import android.annotation.SuppressLint; import android.apex.ApexInfo; import android.apex.IApexService; import android.app.compat.CompatChanges; import android.app.job.JobInfo; import android.app.job.JobParameters; import android.app.job.JobScheduler; import android.app.job.JobService; import android.compat.annotation.ChangeId; import android.content.ComponentName; import android.content.Context; import android.content.pm.ApplicationInfo; Loading Loading @@ -126,6 +128,14 @@ public class BinaryTransparencyService extends SystemService { // the system time (in ms) the last measurement was taken private long mMeasurementsLastRecordedMs; /** * Guards whether or not measurements of MBA to be performed. When this change is enabled, * measurements of MBAs are performed. But when it is disabled, only measurements of APEX * and modules are done. */ @ChangeId public static final long LOG_MBA_INFO = 245692487L; final class BinaryTransparencyServiceImpl extends IBinaryTransparencyService.Stub { @Override Loading Loading @@ -336,6 +346,7 @@ public class BinaryTransparencyService extends SystemService { + " packages after considering preloads"); } if (CompatChanges.isChangeEnabled(LOG_MBA_INFO)) { // lastly measure all newly installed MBAs for (PackageInfo packageInfo : getNewlyInstalledMbas()) { if (packagesMeasured.contains(packageInfo.packageName)) { Loading @@ -353,7 +364,8 @@ public class BinaryTransparencyService extends SystemService { // then extract package's InstallSourceInfo if (DEBUG) { Slog.d(TAG, "Extracting InstallSourceInfo for " + packageInfo.packageName); Slog.d(TAG, "Extracting InstallSourceInfo for " + packageInfo.packageName); } InstallSourceInfo installSourceInfo = getInstallSourceInfo( packageInfo.packageName); Loading @@ -365,7 +377,8 @@ public class BinaryTransparencyService extends SystemService { if (installSourceInfo != null) { initiator = installSourceInfo.getInitiatingPackageName(); initiatorSignerInfo = installSourceInfo.getInitiatingPackageSigningInfo(); initiatorSignerInfo = installSourceInfo.getInitiatingPackageSigningInfo(); if (initiatorSignerInfo != null) { initiatorSignerInfoDigest = computePackageSignerSha256Digests( initiatorSignerInfo); Loading @@ -379,7 +392,8 @@ public class BinaryTransparencyService extends SystemService { FrameworkStatsLog.write(FrameworkStatsLog.MOBILE_BUNDLED_APP_INFO_GATHERED, packageInfo.packageName, packageInfo.getLongVersionCode(), (cDigest != null) ? HexEncoding.encodeToString(cDigest, false) : null, (cDigest != null) ? HexEncoding.encodeToString(cDigest, false) : null, packageMeasurement.getInt(BUNDLE_CONTENT_DIGEST_ALGORITHM), signerDigestHexStrings, MBA_STATUS_NEW_INSTALL, // mba_status Loading @@ -390,6 +404,7 @@ public class BinaryTransparencyService extends SystemService { ); } } } if (DEBUG) { long timeSpentMeasuring = System.currentTimeMillis() - currentTimeMs; Slog.d(TAG, "Measured " + packagesMeasured.size() Loading