Do not redact PSM from L2capNetworkSpecifier
Per discussion on aosp/3429160.
"It doesn't look like knowing the PSM of an L2CAP network would give
other apps any sort of useful information. They don't have the MAC, and
there are only 128 ephemeral PSM values anyway."
Test: TH
Change-Id: Ia81c97dd2e31611fd2d13d5899390fc0c67b6c0f
diff --git a/framework/src/android/net/L2capNetworkSpecifier.java b/framework/src/android/net/L2capNetworkSpecifier.java
index 6770add..b4a3416 100644
--- a/framework/src/android/net/L2capNetworkSpecifier.java
+++ b/framework/src/android/net/L2capNetworkSpecifier.java
@@ -256,13 +256,12 @@
@Override
@Nullable
public NetworkSpecifier redact() {
- // Redact the remote MAC address and the PSM (for non-server roles).
final NetworkSpecifier redactedSpecifier = new Builder()
.setRole(mRole)
.setHeaderCompression(mHeaderCompression)
- // TODO: consider not redacting the specifier in onReserved, so the redaction can be
- // more strict (i.e. the PSM could always be redacted).
- .setPsm(mRole == ROLE_SERVER ? mPsm : PSM_ANY)
+ // The remote address is redacted.
+ .setRemoteAddress(null)
+ .setPsm(mPsm)
.build();
return redactedSpecifier;
}