From 86971c025193b92d256f2fbf73c23db295fef062 Mon Sep 17 00:00:00 2001 From: Simranjit Kohli Date: Wed, 10 May 2023 23:21:41 -0700 Subject: [Autofill PCC] Restrict complete logging to debug bulids Restrict complete logging to debug bulids. For non-debug builds, only log the size of the response. Test: NA. Logging change only. Tested on eng build. Bug: 281451642 Change-Id: I273b1e9198888bfcd69e7a6ce011414482dc252a --- .../autofill/RemoteFieldClassificationService.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/services/autofill/java/com/android/server/autofill/RemoteFieldClassificationService.java b/services/autofill/java/com/android/server/autofill/RemoteFieldClassificationService.java index b8bac61b346b..ea31074ff5d2 100644 --- a/services/autofill/java/com/android/server/autofill/RemoteFieldClassificationService.java +++ b/services/autofill/java/com/android/server/autofill/RemoteFieldClassificationService.java @@ -28,6 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; +import android.os.Build; import android.os.ICancellationSignal; import android.os.RemoteException; import android.os.SystemClock; @@ -155,7 +156,19 @@ final class RemoteFieldClassificationService public void onSuccess(FieldClassificationResponse response) { logLatency(startTime); if (sDebug) { - Log.d(TAG, "onSuccess Response: " + response); + if (Build.IS_DEBUGGABLE) { + Slog.d(TAG, "onSuccess Response: " + response); + } else { + String msg = ""; + if (response == null + || response.getClassifications() == null) { + msg = "null response"; + } else { + msg = "size: " + + response.getClassifications().size(); + } + Slog.d(TAG, "onSuccess " + msg); + } } fieldClassificationServiceCallbacks .onClassificationRequestSuccess(response); @@ -165,7 +178,7 @@ final class RemoteFieldClassificationService public void onFailure() { logLatency(startTime); if (sDebug) { - Log.d(TAG, "onFailure"); + Slog.d(TAG, "onFailure"); } fieldClassificationServiceCallbacks .onClassificationRequestFailure(0, null); -- cgit v1.2.3-59-g8ed1b