summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorSong Pan <songpan@google.com>2019-12-23 15:21:59 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-12-23 15:21:59 +0000
commitf4dcdaebba4d762a64520444dd289c3a8b72fd14 (patch)
tree764a18d9bb079d17fccac72bb3ea02fb09129298 /core/java/android
parentcd87f72f02009d10b186da4824549b755245f122 (diff)
parent6e3677c0c3a47b9e3347fac4e69fe4c94644c37a (diff)
Merge "Implement methods in AppIntegrityManagerServiceImpl."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/SystemServiceRegistry.java10
-rw-r--r--core/java/android/content/integrity/AppInstallMetadata.java13
2 files changed, 23 insertions, 0 deletions
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 69c37ec42bd0..b5e7f4151eaa 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -50,6 +50,8 @@ import android.content.ContentCaptureOptions;
import android.content.Context;
import android.content.IRestrictionsManager;
import android.content.RestrictionsManager;
+import android.content.integrity.AppIntegrityManager;
+import android.content.integrity.IAppIntegrityManager;
import android.content.om.IOverlayManager;
import android.content.om.OverlayManager;
import android.content.pm.CrossProfileApps;
@@ -1246,6 +1248,14 @@ public final class SystemServiceRegistry {
IIncrementalManagerNative.Stub.asInterface(b));
}});
//CHECKSTYLE:ON IndentationCheck
+ registerService(Context.APP_INTEGRITY_SERVICE, AppIntegrityManager.class,
+ new CachedServiceFetcher<AppIntegrityManager>() {
+ @Override
+ public AppIntegrityManager createService(ContextImpl ctx)
+ throws ServiceNotFoundException {
+ IBinder b = ServiceManager.getServiceOrThrow(Context.APP_INTEGRITY_SERVICE);
+ return new AppIntegrityManager(IAppIntegrityManager.Stub.asInterface(b));
+ }});
sInitializing = true;
try {
diff --git a/core/java/android/content/integrity/AppInstallMetadata.java b/core/java/android/content/integrity/AppInstallMetadata.java
index c9634758f63f..70776c76531b 100644
--- a/core/java/android/content/integrity/AppInstallMetadata.java
+++ b/core/java/android/content/integrity/AppInstallMetadata.java
@@ -86,6 +86,19 @@ public final class AppInstallMetadata {
return mIsPreInstalled;
}
+ @Override
+ public String toString() {
+ return String.format(
+ "AppInstallMetadata { PackageName = %s, AppCert = %s, InstallerName = %s,"
+ + " InstallerCert = %s, VersionCode = %d, PreInstalled = %b }",
+ mPackageName,
+ mAppCertificate,
+ mInstallerName == null ? "null" : mInstallerName,
+ mInstallerCertificate == null ? "null" : mInstallerCertificate,
+ mVersionCode,
+ mIsPreInstalled);
+ }
+
/** Builder class for constructing {@link AppInstallMetadata} objects. */
public static final class Builder {
private String mPackageName;