OSDN Git Service

Don't print contents of user-provided bundles.
authorFelipe Leme <felipeal@google.com>
Wed, 28 Mar 2018 23:09:45 +0000 (16:09 -0700)
committerFelipe Leme <felipeal@google.com>
Wed, 28 Mar 2018 23:10:00 +0000 (16:10 -0700)
Test: atest CtsAutoFillServiceTestCases:SimpleSaveActivityTest#testSaveWithParcelableOnClientState
Bug: 72986827

Change-Id: I91523a6c6c0297ff36ade3583e9c25cb2287cdf2

services/autofill/java/com/android/server/autofill/AutofillManagerService.java
services/autofill/java/com/android/server/autofill/Helper.java
services/autofill/java/com/android/server/autofill/Session.java

index 5114308..dbde217 100644 (file)
@@ -19,7 +19,6 @@ package com.android.server.autofill;
 import static android.Manifest.permission.MANAGE_AUTO_FILL;
 import static android.content.Context.AUTOFILL_MANAGER_SERVICE;
 
-import static com.android.server.autofill.Helper.bundleToString;
 import static com.android.server.autofill.Helper.sDebug;
 import static com.android.server.autofill.Helper.sPartitionMaxCount;
 import static com.android.server.autofill.Helper.sVisibleDatasetsMaxCount;
@@ -193,8 +192,7 @@ public final class AutofillManagerService extends SystemService {
                 if (disabledBefore == disabledNow) {
                     // Nothing changed, do nothing.
                     if (sDebug) {
-                        Slog.d(TAG, "Autofill restriction did not change for user " + userId + ": "
-                                + bundleToString(newRestrictions));
+                        Slog.d(TAG, "Autofill restriction did not change for user " + userId);
                         return;
                     }
                 }
index 58f78ec..2edbf94 100644 (file)
@@ -74,28 +74,6 @@ public final class Helper {
         throw new UnsupportedOperationException("contains static members only");
     }
 
-    static void append(StringBuilder builder, Bundle bundle) {
-        if (bundle == null || !sVerbose) {
-            builder.append("null");
-            return;
-        }
-        final Set<String> keySet = bundle.keySet();
-        builder.append("[Bundle with ").append(keySet.size()).append(" extras:");
-        for (String key : keySet) {
-            final Object value = bundle.get(key);
-            builder.append(' ').append(key).append('=');
-            builder.append((value instanceof Object[])
-                    ? Arrays.toString((Objects[]) value) : value);
-        }
-        builder.append(']');
-    }
-
-    static String bundleToString(Bundle bundle) {
-        final StringBuilder builder = new StringBuilder();
-        append(builder, bundle);
-        return builder.toString();
-    }
-
     @Nullable
     static AutofillId[] toArray(@Nullable ArraySet<AutofillId> set) {
         if (set == null) return null;
index 706fb1a..706a6ab 100644 (file)
@@ -2502,8 +2502,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
         }
 
         pw.print(prefix); pw.print("mHasCallback: "); pw.println(mHasCallback);
-        pw.print(prefix); pw.print("mClientState: "); pw.println(
-                Helper.bundleToString(mClientState));
+        if (mClientState != null) {
+            pw.print(prefix); pw.println("mClientState: "); pw.print(mClientState.getSize()); pw
+                .println(" items");
+        }
         pw.print(prefix); pw.print("mCompatMode: "); pw.println(mCompatMode);
         pw.print(prefix); pw.print("mUrlBar: ");
         if (mUrlBar == null) {