summaryrefslogtreecommitdiff
path: root/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java')
-rw-r--r--common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java b/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java
index e953724531d..22688ed6b62 100644
--- a/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java
+++ b/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java
@@ -21,6 +21,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PermissionInfo;
import android.os.Build;
import com.android.compatibility.common.util.DeviceInfoStore;
+import com.android.compatibility.common.util.PackageUtil;
import java.io.IOException;
import java.util.*;
@@ -52,6 +53,8 @@ public class PackageDeviceInfo extends DeviceInfo {
private static final String SHARES_INSTALL_PERMISSION = "shares_install_packages_permission";
private static final String INSTALL_PACKAGES_PERMISSION = "android.permission.INSTALL_PACKAGES";
+ private static final String SHA256_CERT = "sha256_cert";
+
@Override
protected void collectDeviceInfo(DeviceInfoStore store) throws Exception {
final PackageManager pm = getContext().getPackageManager();
@@ -96,6 +99,8 @@ public class PackageDeviceInfo extends DeviceInfo {
final boolean canInstall = sharesUidWithInstallerPackage(pm, appInfo.uid);
store.addResult(SHARES_INSTALL_PERMISSION, canInstall);
}
+ String sha256_cert = PackageUtil.computePackageSignatureDigest(pkg.packageName);
+ store.addResult(SHA256_CERT, sha256_cert);
store.endGroup();
}