Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a66bca9b authored by Varun Shah's avatar Varun Shah
Browse files

Ensure account info logged doesn't expose user data.

Sanitize all account information logged to ensure no sensitive data is
being exposed via the logs.

Fixes: 325799065
Test: builds/flashes
Change-Id: I58416e3235e51b18b0de701c18bae320adcc12c3
parent 4d96906b
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -347,6 +347,11 @@ public class SyncStorageEngine {
            return target + ", enabled=" + enabled + ", syncable=" + syncable + ", backoff="
                    + backoffTime + ", delay=" + delayUntil;
        }

        public String toSafeString() {
            return target.toSafeString() + ", enabled=" + enabled + ", syncable=" + syncable
                    + ", backoff=" + backoffTime + ", delay=" + delayUntil;
        }
    }

    public static class SyncHistoryItem {
@@ -553,7 +558,7 @@ public class SyncStorageEngine {
            final int size = mAuthorities.size();
            mLogger.log("Loaded ", size, " items");
            for (int i = 0; i < size; i++) {
                mLogger.log(mAuthorities.valueAt(i));
                mLogger.log(mAuthorities.valueAt(i).toSafeString());
            }
        }
    }
@@ -734,7 +739,7 @@ public class SyncStorageEngine {
            Slog.d(TAG, "setSyncAutomatically: " + /* account + */" provider " + providerName
                    + ", user " + userId + " -> " + sync);
        }
        mLogger.log("Set sync auto account=", account,
        mLogger.log("Set sync auto account=", account.toSafeString(),
                " user=", userId,
                " authority=", providerName,
                " value=", Boolean.toString(sync),
@@ -812,7 +817,8 @@ public class SyncStorageEngine {
    private void setSyncableStateForEndPoint(EndPoint target, int syncable,
            int callingUid, int callingPid) {
        AuthorityInfo aInfo;
        mLogger.log("Set syncable ", target, " value=", Integer.toString(syncable),
        mLogger.log("Set syncable ", target.toSafeString(),
                " value=", Integer.toString(syncable),
                " cuid=", callingUid,
                " cpid=", callingPid);
        synchronized (mAuthorities) {