Offset 77, 74 lines modifiedOffset 77, 67 lines modified
77 ····}77 ····}
78 ····78 ····
79 ····static·WifiAwareDataPathStateManager$AwareNetworkRequestInformation·processNetworkSpecifier(final·NetworkRequest·networkRequest,·final·WifiAwareNetworkSpecifier·networkSpecifier,·final·WifiAwareStateManager·wifiAwareStateManager,·final·WifiPermissionsUtil·wifiPermissionsUtil,·final·WifiPermissionsWrapper·wifiPermissionsWrapper,·final·boolean·b)·{79 ····static·WifiAwareDataPathStateManager$AwareNetworkRequestInformation·processNetworkSpecifier(final·NetworkRequest·networkRequest,·final·WifiAwareNetworkSpecifier·networkSpecifier,·final·WifiAwareStateManager·wifiAwareStateManager,·final·WifiPermissionsUtil·wifiPermissionsUtil,·final·WifiPermissionsWrapper·wifiPermissionsWrapper,·final·boolean·b)·{
80 ········byte[]·peerDiscoveryMac·=·networkSpecifier.peerMac;80 ········byte[]·peerDiscoveryMac·=·networkSpecifier.peerMac;
81 ········final·int·type·=·networkSpecifier.type;81 ········final·int·type·=·networkSpecifier.type;
82 ········final·String·s·=·"processNetworkSpecifier:·networkSpecifier=";82 ········final·String·s·=·"processNetworkSpecifier:·networkSpecifier=";
83 ········final·String·s2·=·"WifiAwareDataPathStMgr";83 ········final·String·s2·=·"WifiAwareDataPathStMgr";
84 ········if·(type·<·0·||·type·>·3)·{84 ········if·(type·<·0·||·networkSpecifier.type·>·3)·{
85 ············final·StringBuilder·sb·=·new·StringBuilder();85 ············final·StringBuilder·sb·=·new·StringBuilder();
86 ············sb.append(s);86 ············sb.append(s);
87 ············sb.append(networkSpecifier);87 ············sb.append(networkSpecifier);
88 ············sb.append(",·invalid·'type'·value");88 ············sb.append(",·invalid·'type'·value");
89 ············Log.e(s2,·sb.toString());89 ············Log.e(s2,·sb.toString());
90 ············return·null;90 ············return·null;
91 ········}91 ········}
92 ········final·int·role·=·networkSpecifier.role;92 ········final·int·role·=·networkSpecifier.role;
93 ········final·boolean·b2·=·true;93 ········final·boolean·b2·=·true;
94 ········if·(role·&&·role·!=·(b2·?·1·:·0))·{94 ········if·(role·!=·0·&&·networkSpecifier.role·!=·(b2·?·1·:·0))·{
95 ············final·StringBuilder·sb2·=·new·StringBuilder();95 ············final·StringBuilder·sb2·=·new·StringBuilder();
96 ············sb2.append(s);96 ············sb2.append(s);
97 ············sb2.append(networkSpecifier);97 ············sb2.append(networkSpecifier);
98 ············sb2.append("·--·invalid·'role'·value");98 ············sb2.append("·--·invalid·'role'·value");
99 ············Log.e(s2,·sb2.toString());99 ············Log.e(s2,·sb2.toString());
100 ············return·null;100 ············return·null;
101 ········}101 ········}
102 ········final·int·role2·=·networkSpecifier.role;102 ········final·int·role2·=·networkSpecifier.role;
103 ········final·int·n·=·2;103 ········final·int·n·=·2;
104 ········if·(role2·==·0)·{104 ········if·(role2·==·0·&&·networkSpecifier.type·!=·0·&&·networkSpecifier.type·!=·n)·{
105 ············final·int·type2·=·networkSpecifier.type;105 ············final·StringBuilder·sb3·=·new·StringBuilder();
106 ············if·(type2·!=·0·&&·type2·!=·n)·{106 ············sb3.append(s);
107 ················final·StringBuilder·sb3·=·new·StringBuilder();107 ············sb3.append(networkSpecifier);
108 ················sb3.append(s);108 ············sb3.append("·--·invalid·'type'·value·for·INITIATOR·(only·IB·and·OOB·are·permitted)");
109 ················sb3.append(networkSpecifier);109 ············Log.e(s2,·sb3.toString());
110 ················sb3.append("·--·invalid·'type'·value·for·INITIATOR·(only·IB·and·OOB·are·permitted)");110 ············return·null;
111 ················Log.e(s2,·sb3.toString()); 
112 ················return·null; 
113 ············} 
114 ········}111 ········}
115 ········final·WifiAwareClientState·client·=·wifiAwareStateManager.getClient(networkSpecifier.clientId);112 ········final·WifiAwareClientState·client·=·wifiAwareStateManager.getClient(networkSpecifier.clientId);
116 ········if·(client·==·null)·{113 ········if·(client·==·null)·{
117 ············final·StringBuilder·sb4·=·new·StringBuilder();114 ············final·StringBuilder·sb4·=·new·StringBuilder();
118 ············sb4.append(s);115 ············sb4.append(s);
119 ············sb4.append(networkSpecifier);116 ············sb4.append(networkSpecifier);
120 ············sb4.append("·--·not·client·with·this·id·--·clientId=");117 ············sb4.append("·--·not·client·with·this·id·--·clientId=");
121 ············sb4.append(networkSpecifier.clientId);118 ············sb4.append(networkSpecifier.clientId);
122 ············Log.e(s2,·sb4.toString());119 ············Log.e(s2,·sb4.toString());
123 ············return·null;120 ············return·null;
124 ········}121 ········}
125 ········final·int·uid·=·client.getUid();122 ········final·int·uid·=·client.getUid();
126 ········final·String·callingPackage·=·client.getCallingPackage();123 ········final·String·callingPackage·=·client.getCallingPackage();
127 ········if·(!b·&&·!wifiPermissionsUtil.isTargetSdkLessThan(client.getCallingPackage(),·28,·uid))·{124 ········if·(!b·&&·!wifiPermissionsUtil.isTargetSdkLessThan(client.getCallingPackage(),·28,·uid)·&&·networkSpecifier.type·!=·0·&&·networkSpecifier.type·!=·n)·{
128 ············final·int·type3·=·networkSpecifier.type;125 ············final·StringBuilder·sb5·=·new·StringBuilder();
129 ············if·(type3·!=·0·&&·type3·!=·n)·{126 ············sb5.append(s);
130 ················final·StringBuilder·sb5·=·new·StringBuilder();127 ············sb5.append(networkSpecifier);
131 ················sb5.append(s);128 ············sb5.append("·--·no·ANY·specifications·allowed·for·this·API·level");
132 ················sb5.append(networkSpecifier);129 ············Log.e(s2,·sb5.toString());
133 ················sb5.append("·--·no·ANY·specifications·allowed·for·this·API·level");130 ············return·null;
134 ················Log.e(s2,·sb5.toString()); 
135 ················return·null; 
136 ············} 
137 ········}131 ········}
138 ········final·int·port·=·networkSpecifier.port;132 ········if·(networkSpecifier.port·>=·0)·{
139 ········if·(port·>=·0)·{ 
140 ············final·int·transportProtocol·=·networkSpecifier.transportProtocol;133 ············final·int·transportProtocol·=·networkSpecifier.transportProtocol;
141 ············final·int·n2·=·-1;134 ············final·int·n2·=·-1;
142 ············if·(transportProtocol·>=·n2)·{135 ············if·(transportProtocol·>=·n2)·{
143 ················if·(port·!=·0·||·transportProtocol·!=·n2)·{136 ················if·(networkSpecifier.port·!=·0·||·networkSpecifier.transportProtocol·!=·n2)·{
144 ····················if·(networkSpecifier.role·!=·(b2·?·1·:·0))·{137 ····················if·(networkSpecifier.role·!=·(b2·?·1·:·0))·{
145 ························final·StringBuilder·sb6·=·new·StringBuilder();138 ························final·StringBuilder·sb6·=·new·StringBuilder();
146 ························sb6.append(s);139 ························sb6.append(s);
147 ························sb6.append(networkSpecifier);140 ························sb6.append(networkSpecifier);
148 ························sb6.append("·--·port/transportProtocol·can·only·be·specified·on·responder");141 ························sb6.append("·--·port/transportProtocol·can·only·be·specified·on·responder");
149 ························Log.e(s2,·sb6.toString());142 ························Log.e(s2,·sb6.toString());
150 ························return·null;143 ························return·null;
Offset 154, 19 lines modifiedOffset 147, 19 lines modified
154 ························sb7.append(s);147 ························sb7.append(s);
155 ························sb7.append(networkSpecifier);148 ························sb7.append(networkSpecifier);
156 ························sb7.append("·--·port/transportProtocol·can·only·be·specified·on·secure·ndp");149 ························sb7.append("·--·port/transportProtocol·can·only·be·specified·on·secure·ndp");
157 ························Log.e(s2,·sb7.toString());150 ························Log.e(s2,·sb7.toString());
158 ························return·null;151 ························return·null;
159 ····················}152 ····················}
160 ················}153 ················}
161 ················final·int·type4·=·networkSpecifier.type;154 ················final·int·type2·=·networkSpecifier.type;
162 ················int·pubSubId·=·0;155 ················int·pubSubId·=·0;
163 ················int·mInstanceId·=·0;156 ················int·mInstanceId·=·0;
164 ················Label_0922:·{157 ················Label_0964:·{
165 ····················if·(type4·==·0·||·type4·==·(b2·?·1·:·0))·{158 ····················if·(type2·==·0·||·networkSpecifier.type·==·(b2·?·1·:·0))·{
166 ························final·WifiAwareDiscoverySessionState·session·=·client.getSession(networkSpecifier.sessionId);159 ························final·WifiAwareDiscoverySessionState·session·=·client.getSession(networkSpecifier.sessionId);
167 ························if·(session·==·null)·{160 ························if·(session·==·null)·{
168 ····························final·StringBuilder·sb8·=·new·StringBuilder();161 ····························final·StringBuilder·sb8·=·new·StringBuilder();
169 ····························sb8.append(s);162 ····························sb8.append(s);
170 ····························sb8.append(networkSpecifier);163 ····························sb8.append(networkSpecifier);
171 ····························sb8.append("·--·no·session·with·this·id·--·sessionId=");164 ····························sb8.append("·--·no·session·with·this·id·--·sessionId=");
172 ····························sb8.append(networkSpecifier.sessionId);165 ····························sb8.append(networkSpecifier.sessionId);
Offset 193, 15 lines modifiedOffset 186, 15 lines modified
193 ································Log.e(s2,·sb10.toString());186 ································Log.e(s2,·sb10.toString());
194 ································return·null;187 ································return·null;
195 ····························}188 ····························}
196 ····························mInstanceId·=·peerInfo.mInstanceId;189 ····························mInstanceId·=·peerInfo.mInstanceId;
197 ····························try·{190 ····························try·{
198 ································peerDiscoveryMac·=·peerInfo.mMac;191 ································peerDiscoveryMac·=·peerInfo.mMac;
199 ································if·(peerDiscoveryMac·!=·null·&&·peerDiscoveryMac.length·==·6)·{192 ································if·(peerDiscoveryMac·!=·null·&&·peerDiscoveryMac.length·==·6)·{
200 ····································break·Label_0922;193 ····································break·Label_0964;
201 ································}194 ································}
202 ································try·{195 ································try·{
203 ····································final·StringBuilder·sb12;196 ····································final·StringBuilder·sb12;
204 ····································final·StringBuilder·sb11·=·sb12·=·new·StringBuilder();197 ····································final·StringBuilder·sb11·=·sb12·=·new·StringBuilder();
205 ····································try·{198 ····································try·{
206 ········································sb12.append(s);199 ········································sb12.append(s);
207 ········································final·StringBuilder·sb13·=·sb11;200 ········································final·StringBuilder·sb13·=·sb11;
Offset 246, 16 lines modifiedOffset 239, 15 lines modified
246 ····················sb16.append(s);239 ····················sb16.append(s);
247 ····················sb16.append(networkSpecifier.toString());240 ····················sb16.append(networkSpecifier.toString());
248 ····················sb16.append("·--·invalid·passphrase·length:·");241 ····················sb16.append("·--·invalid·passphrase·length:·");
249 ····················sb16.append(networkSpecifier.passphrase.length());242 ····················sb16.append(networkSpecifier.passphrase.length());
250 ····················Log.e(s2,·sb16.toString());243 ····················Log.e(s2,·sb16.toString());
251 ····················return·null;244 ····················return·null;
252 ················}245 ················}
253 ················final·byte[]·pmk·=·networkSpecifier.pmk;246 ················if·(networkSpecifier.pmk·!=·null·&&·!WifiAwareUtils.validatePmk(networkSpecifier.pmk))·{
254 ················if·(pmk·!=·null·&&·!WifiAwareUtils.validatePmk(pmk))·{ 
255 ····················final·StringBuilder·sb17·=·new·StringBuilder();247 ····················final·StringBuilder·sb17·=·new·StringBuilder();
256 ····················sb17.append(s);248 ····················sb17.append(s);
257 ····················sb17.append(networkSpecifier.toString());249 ····················sb17.append(networkSpecifier.toString());
258 ····················sb17.append("·--·invalid·pmk·length:·");250 ····················sb17.append("·--·invalid·pmk·length:·");
259 ····················sb17.append(networkSpecifier.pmk.length);251 ····················sb17.append(networkSpecifier.pmk.length);
260 ····················Log.e(s2,·sb17.toString());252 ····················Log.e(s2,·sb17.toString());
261 ····················return·null;253 ····················return·null;
Offset 277, 17 lines modifiedOffset 269, 15 lines modified
277 ········sb18.append(networkSpecifier);269 ········sb18.append(networkSpecifier);
278 ········sb18.append("·--·invalid·port/transportProtocol");270 ········sb18.append("·--·invalid·port/transportProtocol");
279 ········Log.e(s2,·sb18.toString());271 ········Log.e(s2,·sb18.toString());
280 ········return·null;272 ········return·null;
281 ····}273 ····}
282 ····274 ····
283 ····WifiAwareDataPathStateManager$CanonicalConnectionInfo·getCanonicalDescriptor()·{275 ····WifiAwareDataPathStateManager$CanonicalConnectionInfo·getCanonicalDescriptor()·{
284 ········final·byte[]·peerDiscoveryMac·=·this.peerDiscoveryMac;276 ········return·new·WifiAwareDataPathStateManager$CanonicalConnectionInfo(this.peerDiscoveryMac,·this.networkSpecifier.pmk,·this.networkSpecifier.sessionId,·this.networkSpecifier.passphrase);
285 ········final·WifiAwareNetworkSpecifier·networkSpecifier·=·this.networkSpecifier; 
286 ········return·new·WifiAwareDataPathStateManager$CanonicalConnectionInfo(peerDiscoveryMac,·networkSpecifier.pmk,·networkSpecifier.sessionId,·networkSpecifier.passphrase); 
287 ····}277 ····}
288 ····278 ····
289 ····void·removeSupportForRequest(final·NetworkRequest·networkRequest)·{279 ····void·removeSupportForRequest(final·NetworkRequest·networkRequest)·{
290 ········this.equivalentRequests.remove(networkRequest);280 ········this.equivalentRequests.remove(networkRequest);
291 ····}281 ····}
292 ····282 ····
293 ····public·String·toString()·{283 ····public·String·toString()·{