Move sensitive field parceling bool to constructor

This addresses API review comments recommending to use a copy
constructor with additional parameters instead of a dedicated method.
makeSensitiveFieldsParcelingCopy becomes LinkProperties(base, true).

Bug: 150877475
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Merged-In: Ib145ca7f36dcbee6ef47d09862a181fc04a28f03
(cherry picked from commit bf091021d332804e875d7fd3424340e32b896cce)

Change-Id: I98449430ca5b11f5a62ba43683663bd82650e817
This commit is contained in:
Automerger Merge Worker
2020-03-17 16:02:25 +00:00
committed by Remi NGUYEN VAN
parent 0819fa7246
commit fce6aad2be
3 changed files with 16 additions and 19 deletions

View File

@@ -1028,7 +1028,8 @@ public class LinkPropertiesTest {
source.setCaptivePortalApiUrl(CAPPORT_API_URL);
source.setCaptivePortalData((CaptivePortalData) getCaptivePortalData());
source.setDhcpServerAddress((Inet4Address) GATEWAY1);
assertParcelSane(source.makeSensitiveFieldsParcelingCopy(), 18 /* fieldCount */);
assertParcelSane(new LinkProperties(source, true /* parcelSensitiveFields */),
18 /* fieldCount */);
// Verify that without using a sensitiveFieldsParcelingCopy, sensitive fields are cleared.
final LinkProperties sanitized = new LinkProperties(source);