From 6a8ccfa6c1564abf33466548cacc702603d6bc15 Mon Sep 17 00:00:00 2001 From: Rubin Xu Date: Thu, 10 Feb 2022 10:40:41 +0000 Subject: [PATCH] Remove SecurityLog.writeEvent(String) Not used by anyone at the moment and could cause confusion with the vararg overload, so removing. Bug: 194988881 Test: atest MixedDeviceOwnerTest#testSecurityLoggingWithSingleUser Change-Id: I73e64396bbbac69314ac26242f6e00ad1c9453ba --- core/java/android/app/admin/SecurityLog.java | 17 ----------------- core/jni/android_app_admin_SecurityLog.cpp | 4 ---- 2 files changed, 21 deletions(-) diff --git a/core/java/android/app/admin/SecurityLog.java b/core/java/android/app/admin/SecurityLog.java index 9a56cc51757fa..b170aa2a13257 100644 --- a/core/java/android/app/admin/SecurityLog.java +++ b/core/java/android/app/admin/SecurityLog.java @@ -915,23 +915,6 @@ public class SecurityLog { public static native void readEventsOnWrapping(long timestamp, Collection output) throws IOException; - /** - * Write a log entry to the security log, with a string payload. - * - *

Security log is part of Android's device management capability that tracks - * security-sensitive events for auditing purposes. - * - * @param tag the tag ID of the security event - * @param payload the string payload associated with the tag. Each tag dictates the expected - * meaning of this string. - * - * @see DevicePolicyManager#setSecurityLoggingEnabled(ComponentName, boolean) - * @hide - */ - // TODO(b/218658622): enforce WRITE_SECURITY_LOG in logd. - @RequiresPermission(Manifest.permission.WRITE_SECURITY_LOG) - public static native int writeEvent(@SecurityLogTag int tag, @NonNull String payload); - /** * Write a log entry to the underlying storage, with several payloads. * Supported types of payload are: integer, long, float, string plus array of supported types. diff --git a/core/jni/android_app_admin_SecurityLog.cpp b/core/jni/android_app_admin_SecurityLog.cpp index e5a13db3dfb09..d197edceb9f7b 100644 --- a/core/jni/android_app_admin_SecurityLog.cpp +++ b/core/jni/android_app_admin_SecurityLog.cpp @@ -84,10 +84,6 @@ static const JNINativeMethod gRegisterMethods[] = { "()Z", (void*) android_app_admin_SecurityLog_isLoggingEnabled }, - { "writeEvent", - "(ILjava/lang/String;)I", - (void*) SLog::writeEventString - }, { "writeEvent", "(I[Ljava/lang/Object;)I", (void*) SLog::writeEventArray