| | | |
Offset 13, 15 lines modified | Offset 13, 18 lines modified |
13 | import·android.os.WorkSource; | 13 | import·android.os.WorkSource; |
14 | import·com.android.wifi.x.android.os.HandlerExecutor; | 14 | import·com.android.wifi.x.android.os.HandlerExecutor; |
15 | import·android.net.wifi.WifiScanner$ScanSettings$HiddenNetwork; | 15 | import·android.net.wifi.WifiScanner$ScanSettings$HiddenNetwork; |
16 | import·com.android.server.wifi.util.NativeUtil; | 16 | import·com.android.server.wifi.util.NativeUtil; |
17 | import·com.android.wifi.x.com.android.internal.util.Preconditions; | 17 | import·com.android.wifi.x.com.android.internal.util.Preconditions; |
18 | import·java.util.Objects; | 18 | import·java.util.Objects; |
19 | import·android.text.TextUtils; | 19 | import·android.text.TextUtils; |
| 20 | import·java.util.stream.Collector; |
| 21 | import·java.util.stream.Collectors; |
20 | import·java.util.ArrayList; | 22 | import·java.util.ArrayList; |
| 23 | import·java.util.List; |
21 | import·java.util.function.IntFunction; | 24 | import·java.util.function.IntFunction; |
22 | import·android.content.pm.PackageManager; | 25 | import·android.content.pm.PackageManager; |
23 | import·android.content.pm.PackageManager$NameNotFoundException; | 26 | import·android.content.pm.PackageManager$NameNotFoundException; |
24 | import·android.content.pm.ApplicationInfo; | 27 | import·android.content.pm.ApplicationInfo; |
25 | import·android.os.UserHandle; | 28 | import·android.os.UserHandle; |
26 | import·java.util.function.Function; | 29 | import·java.util.function.Function; |
27 | import·java.util.Comparator; | 30 | import·java.util.Comparator; |
Offset 30, 38 lines modified | Offset 33, 37 lines modified |
30 | import·android.os.IBinder; | 33 | import·android.os.IBinder; |
31 | import·android.os.Binder; | 34 | import·android.os.Binder; |
32 | import·android.os.RemoteException; | 35 | import·android.os.RemoteException; |
33 | import·android.net.wifi.INetworkRequestMatchCallback; | 36 | import·android.net.wifi.INetworkRequestMatchCallback; |
34 | import·android.app.AlarmManager$OnAlarmListener; | 37 | import·android.app.AlarmManager$OnAlarmListener; |
35 | import·java.util.Iterator; | 38 | import·java.util.Iterator; |
36 | import·java.util.Set; | 39 | import·java.util.Set; |
37 | import·java.util.Collection; | |
38 | import·android.util.Log; | 40 | import·android.util.Log; |
39 | import·java.util.LinkedHashSet; | 41 | import·java.util.LinkedHashSet; |
40 | import·android.net.MacAddress; | 42 | import·android.net.MacAddress; |
41 | import·java.util.HashSet; | 43 | import·java.util.HashSet; |
| 44 | import·java.util.Collection; |
42 | import·android.net.wifi.ScanResult; | 45 | import·android.net.wifi.ScanResult; |
43 | import·java.util.HashMap; | 46 | import·java.util.HashMap; |
44 | import·android.net.NetworkCapabilities; | 47 | import·android.net.NetworkCapabilities; |
45 | import·android.os.Looper; | 48 | import·android.os.Looper; |
46 | import·android.net.wifi.WifiScanner; | 49 | import·android.net.wifi.WifiScanner; |
47 | import·com.android.server.wifi.util.WifiPermissionsUtil; | 50 | import·com.android.server.wifi.util.WifiPermissionsUtil; |
48 | import·android.net.wifi.WifiConfiguration; | 51 | import·android.net.wifi.WifiConfiguration; |
49 | import·java.util.Map; | |
50 | import·android.net.wifi.WifiScanner$ScanSettings; | 52 | import·android.net.wifi.WifiScanner$ScanSettings; |
51 | import·com.android.server.wifi.util.ExternalCallbackTracker; | 53 | import·com.android.server.wifi.util.ExternalCallbackTracker; |
52 | import·android.os.Handler; | 54 | import·android.os.Handler; |
53 | import·android.content.Context; | 55 | import·android.content.Context; |
54 | import·android.companion.CompanionDeviceManager; | 56 | import·android.companion.CompanionDeviceManager; |
55 | import·android.app.AppOpsManager; | 57 | import·android.app.AppOpsManager; |
56 | import·android.app.AlarmManager; | 58 | import·android.app.AlarmManager; |
57 | import·android.app.ActivityManager; | 59 | import·android.app.ActivityManager; |
58 | import·android.net.wifi.WifiNetworkSpecifier; | 60 | import·android.net.wifi.WifiNetworkSpecifier; |
59 | import·android.net.NetworkRequest; | 61 | import·android.net.NetworkRequest; |
60 | import·java.util.List; | 62 | import·java.util.Map; |
61 | import·com.android.wifi.x.android.net.NetworkFactory; | 63 | import·com.android.wifi.x.android.net.NetworkFactory; |
| |
62 | public·class·WifiNetworkFactory·extends·NetworkFactory | 64 | public·class·WifiNetworkFactory·extends·NetworkFactory |
63 | { | 65 | { |
64 | ····public·static·final·int·CACHED_SCAN_RESULTS_MAX_AGE_IN_MILLIS·=·20000; | 66 | ····public·static·final·int·CACHED_SCAN_RESULTS_MAX_AGE_IN_MILLIS·=·20000; |
65 | ····public·static·final·int·NETWORK_CONNECTION_TIMEOUT_MS·=·30000; | 67 | ····public·static·final·int·NETWORK_CONNECTION_TIMEOUT_MS·=·30000; |
66 | ····public·static·final·int·NUM_OF_ACCESS_POINT_LIMIT_PER_APP·=·50; | 68 | ····public·static·final·int·NUM_OF_ACCESS_POINT_LIMIT_PER_APP·=·50; |
Offset 69, 15 lines modified | Offset 71, 15 lines modified |
69 | ····private·static·final·int·SCORE_FILTER·=·60; | 71 | ····private·static·final·int·SCORE_FILTER·=·60; |
70 | ····private·static·final·String·TAG·=·"WifiNetworkFactory"; | 72 | ····private·static·final·String·TAG·=·"WifiNetworkFactory"; |
71 | ····public·static·final·String·UI_START_INTENT_ACTION·=·"com.android.settings.wifi.action.NETWORK_REQUEST"; | 73 | ····public·static·final·String·UI_START_INTENT_ACTION·=·"com.android.settings.wifi.action.NETWORK_REQUEST"; |
72 | ····public·static·final·String·UI_START_INTENT_CATEGORY·=·"android.intent.category.DEFAULT"; | 74 | ····public·static·final·String·UI_START_INTENT_CATEGORY·=·"android.intent.category.DEFAULT"; |
73 | ····public·static·final·String·UI_START_INTENT_EXTRA_APP_NAME·=·"com.android.settings.wifi.extra.APP_NAME"; | 75 | ····public·static·final·String·UI_START_INTENT_EXTRA_APP_NAME·=·"com.android.settings.wifi.extra.APP_NAME"; |
74 | ····public·static·final·String·UI_START_INTENT_EXTRA_REQUEST_IS_FOR_SINGLE_NETWORK·=·"com.android.settings.wifi.extra.REQUEST_IS_FOR_SINGLE_NETWORK"; | 76 | ····public·static·final·String·UI_START_INTENT_EXTRA_REQUEST_IS_FOR_SINGLE_NETWORK·=·"com.android.settings.wifi.extra.REQUEST_IS_FOR_SINGLE_NETWORK"; |
75 | ····public·static·final·int·USER_SELECTED_NETWORK_CONNECT_RETRY_MAX·=·3; | 77 | ····public·static·final·int·USER_SELECTED_NETWORK_CONNECT_RETRY_MAX·=·3; |
76 | ····private·List·mActiveMatchedScanResults; | 78 | ····private·Map·mActiveMatchedScanResults; |
77 | ····private·NetworkRequest·mActiveSpecificNetworkRequest; | 79 | ····private·NetworkRequest·mActiveSpecificNetworkRequest; |
78 | ····private·WifiNetworkSpecifier·mActiveSpecificNetworkRequestSpecifier; | 80 | ····private·WifiNetworkSpecifier·mActiveSpecificNetworkRequestSpecifier; |
79 | ····private·final·ActivityManager·mActivityManager; | 81 | ····private·final·ActivityManager·mActivityManager; |
80 | ····private·final·AlarmManager·mAlarmManager; | 82 | ····private·final·AlarmManager·mAlarmManager; |
81 | ····private·final·AppOpsManager·mAppOpsManager; | 83 | ····private·final·AppOpsManager·mAppOpsManager; |
82 | ····private·String·mApprovedApp; | 84 | ····private·String·mApprovedApp; |
83 | ····private·final·Clock·mClock; | 85 | ····private·final·Clock·mClock; |
Offset 150, 15 lines modified | Offset 152, 15 lines modified |
150 | ····} | 152 | ····} |
151 | ···· | 153 | ···· |
152 | ····private·void·addNetworkToUserApprovedAccessPointMap(final·WifiConfiguration·wifiConfiguration)·{ | 154 | ····private·void·addNetworkToUserApprovedAccessPointMap(final·WifiConfiguration·wifiConfiguration)·{ |
153 | ········if·(this.mActiveSpecificNetworkRequestSpecifier·!=·null)·{ | 155 | ········if·(this.mActiveSpecificNetworkRequestSpecifier·!=·null)·{ |
154 | ············if·(this.mActiveMatchedScanResults·!=·null)·{ | 156 | ············if·(this.mActiveMatchedScanResults·!=·null)·{ |
155 | ················final·HashSet<WifiNetworkFactory$AccessPoint>·set·=·new·HashSet<WifiNetworkFactory$AccessPoint>(); | 157 | ················final·HashSet<WifiNetworkFactory$AccessPoint>·set·=·new·HashSet<WifiNetworkFactory$AccessPoint>(); |
156 | ················final·ScanResultMatchInfo·fromWifiConfiguration·=·ScanResultMatchInfo.fromWifiConfiguration(wifiConfiguration); | 158 | ················final·ScanResultMatchInfo·fromWifiConfiguration·=·ScanResultMatchInfo.fromWifiConfiguration(wifiConfiguration); |
157 | ················for·(final·ScanResult·scanResult·:·this.mActiveMatchedScanResults)·{ | 159 | ················for·(final·ScanResult·scanResult·:·this.mActiveMatchedScanResults.values())·{ |
158 | ····················final·ScanResultMatchInfo·fromScanResult·=·ScanResultMatchInfo.fromScanResult(scanResult); | 160 | ····················final·ScanResultMatchInfo·fromScanResult·=·ScanResultMatchInfo.fromScanResult(scanResult); |
159 | ····················if·(fromScanResult.equals((Object)fromWifiConfiguration))·{ | 161 | ····················if·(fromScanResult.equals((Object)fromWifiConfiguration))·{ |
160 | ························set.add(new·WifiNetworkFactory$AccessPoint(scanResult.SSID,·MacAddress.fromString(scanResult.BSSID),·fromScanResult.networkType)); | 162 | ························set.add(new·WifiNetworkFactory$AccessPoint(scanResult.SSID,·MacAddress.fromString(scanResult.BSSID),·fromScanResult.networkType)); |
161 | ····················} | 163 | ····················} |
162 | ················} | 164 | ················} |
163 | ················if·(set.isEmpty())·{ | 165 | ················if·(set.isEmpty())·{ |
164 | ····················return; | 166 | ····················return; |
Offset 320, 17 lines modified | Offset 322, 17 lines modified |
320 | ···· | 322 | ···· |
321 | ····private·boolean·doesScanResultMatchWifiNetworkSpecifier(final·WifiNetworkSpecifier·wifiNetworkSpecifier,·final·ScanResult·scanResult)·{ | 323 | ····private·boolean·doesScanResultMatchWifiNetworkSpecifier(final·WifiNetworkSpecifier·wifiNetworkSpecifier,·final·ScanResult·scanResult)·{ |
322 | ········return·wifiNetworkSpecifier.ssidPatternMatcher.match(scanResult.SSID)·&&·MacAddress.fromString(scanResult.BSSID).matches((MacAddress)wifiNetworkSpecifier.bssidPatternMatcher.first,·(MacAddress)wifiNetworkSpecifier.bssidPatternMatcher.second)·&&·ScanResultMatchInfo.fromScanResult(scanResult).networkTypeEquals(ScanResultMatchInfo.fromWifiConfiguration(wifiNetworkSpecifier.wifiConfiguration),·false); | 324 | ········return·wifiNetworkSpecifier.ssidPatternMatcher.match(scanResult.SSID)·&&·MacAddress.fromString(scanResult.BSSID).matches((MacAddress)wifiNetworkSpecifier.bssidPatternMatcher.first,·(MacAddress)wifiNetworkSpecifier.bssidPatternMatcher.second)·&&·ScanResultMatchInfo.fromScanResult(scanResult).networkTypeEquals(ScanResultMatchInfo.fromWifiConfiguration(wifiNetworkSpecifier.wifiConfiguration),·false); |
323 | ····} | 325 | ····} |
324 | ···· | 326 | ···· |
325 | ····private·String·findBestBssidFromActiveMatchedScanResultsForNetwork(final·ScanResultMatchInfo·scanResultMatchInfo)·{ | 327 | ····private·String·findBestBssidFromActiveMatchedScanResultsForNetwork(final·ScanResultMatchInfo·scanResultMatchInfo)·{ |
326 | ········if·(this.mActiveSpecificNetworkRequestSpecifier·!=·null)·{ | 328 | ········if·(this.mActiveSpecificNetworkRequestSpecifier·!=·null)·{ |
327 | ············final·List·mActiveMatchedScanResults·=·this.mActiveMatchedScanResults; | 329 | ············final·Map·mActiveMatchedScanResults·=·this.mActiveMatchedScanResults; |
328 | ············if·(mActiveMatchedScanResults·!=·null)·{ | 330 | ············if·(mActiveMatchedScanResults·!=·null)·{ |
329 | ················final·ScanResult·scanResult·=·(ScanResult)mActiveMatchedScanResults.stream().filter((Predicate<?·super·ScanResult>)new·-$$Lambda$WifiNetworkFactory$kgmvViUSRQFBmgULiV_K6mdrFGI(scanResultMatchInfo)).max(Comparator.comparing((Function<?·super·ScanResult,·?·extends·Comparable>)-$$Lambda$WifiNetworkFactory$uQTzBkFoCEwN-ndjhXTPHmeDMro.INSTANCE)).orElse(null); | 331 | ················final·ScanResult·scanResult·=·(ScanResult)mActiveMatchedScanResults.values().stream().filter((Predicate<?·super·ScanResult>)new·-$$Lambda$WifiNetworkFactory$kgmvViUSRQFBmgULiV_K6mdrFGI(scanResultMatchInfo)).max(Comparator.comparing((Function<?·super·ScanResult,·?·extends·Comparable>)-$$Lambda$WifiNetworkFactory$uQTzBkFoCEwN-ndjhXTPHmeDMro.INSTANCE)).orElse(null); |
330 | ················final·String·s·=·"WifiNetworkFactory"; | 332 | ················final·String·s·=·"WifiNetworkFactory"; |
331 | ················if·(scanResult·==·null)·{ | 333 | ················if·(scanResult·==·null)·{ |
332 | ····················Log.wtf(s,·"Expected·to·find·at·least·one·matching·scan·result"); | 334 | ····················Log.wtf(s,·"Expected·to·find·at·least·one·matching·scan·result"); |
333 | ····················return·null; | 335 | ····················return·null; |
334 | ················} | 336 | ················} |
335 | ················if·(this.mVerboseLoggingEnabled)·{ | 337 | ················if·(this.mVerboseLoggingEnabled)·{ |
336 | ····················final·StringBuilder·sb·=·new·StringBuilder(); | 338 | ····················final·StringBuilder·sb·=·new·StringBuilder(); |
Offset 370, 15 lines modified | Offset 372, 15 lines modified |
370 | ········} | 372 | ········} |
371 | ········catch·(PackageManager$NameNotFoundException·ex3)·{} | 373 | ········catch·(PackageManager$NameNotFoundException·ex3)·{} |
372 | ····} | 374 | ····} |
373 | ···· | 375 | ···· |
374 | ····private·ScanResult[]·getFilteredCachedScanResults()·{ | 376 | ····private·ScanResult[]·getFilteredCachedScanResults()·{ |
375 | ········final·List·singleScanResults·=·this.mWifiScanner.getSingleScanResults(); | 377 | ········final·List·singleScanResults·=·this.mWifiScanner.getSingleScanResults(); |
376 | ········if·(singleScanResults·!=·null·&&·!singleScanResults.isEmpty())·{ | 378 | ········if·(singleScanResults·!=·null·&&·!singleScanResults.isEmpty())·{ |
377 | ············return·(ScanResult[])singleScanResults.stream().filter((Predicate)new·-$$Lambda$WifiNetworkFactory$5NdbAyhbBeUuRkn75lVVJopPxSM(this.mClock.getElapsedSinceBootMillis())).toArray((IntFunction)-$$Lambda$WifiNetworkFactory$W4xMyJR4v2tDNwebIWEtmJlmNZc.INSTANCE); | 379 | ············return·(ScanResult[])singleScanResults.stream().filter((Predicate)new·-$$Lambda$WifiNetworkFactory$ATGrMu-WJcTIB14_5MdpeoV7zeM(this.mClock.getElapsedSinceBootMillis())).toArray((IntFunction)-$$Lambda$WifiNetworkFactory$uPA78n83TSspOaWHZLtCxZB_s7Y.INSTANCE); |
378 | ········} | 380 | ········} |
379 | ········return·new·ScanResult[0]; | 381 | ········return·new·ScanResult[0]; |
380 | ····} | 382 | ····} |
381 | ···· | 383 | ···· |
382 | ····private·List·getNetworksMatchingActiveNetworkRequest(final·ScanResult[]·array)·{ | 384 | ····private·List·getNetworksMatchingActiveNetworkRequest(final·ScanResult[]·array)·{ |
383 | ········final·WifiNetworkSpecifier·mActiveSpecificNetworkRequestSpecifier·=·this.mActiveSpecificNetworkRequestSpecifier; | 385 | ········final·WifiNetworkSpecifier·mActiveSpecificNetworkRequestSpecifier·=·this.mActiveSpecificNetworkRequestSpecifier; |
384 | ········final·String·s·=·"WifiNetworkFactory"; | 386 | ········final·String·s·=·"WifiNetworkFactory"; |
Offset 527, 19 lines modified | Offset 529, 23 lines modified |
527 | ········Log.w("WifiNetworkFactory",·sb.toString()); | 529 | ········Log.w("WifiNetworkFactory",·sb.toString()); |
528 | ········this.teardownForActiveRequest(); | 530 | ········this.teardownForActiveRequest(); |
529 | ········this.mWifiMetrics.incrementNetworkRequestApiNumUserReject(); | 531 | ········this.mWifiMetrics.incrementNetworkRequestApiNumUserReject(); |
530 | ····} | 532 | ····} |
531 | ···· | 533 | ···· |
532 | ····private·void·handleScanResults(final·ScanResult[]·array)·{ | 534 | ····private·void·handleScanResults(final·ScanResult[]·array)·{ |
533 | ········final·List·networksMatchingActiveNetworkRequest·=·this.getNetworksMatchingActiveNetworkRequest(array); | 535 | ········final·List·networksMatchingActiveNetworkRequest·=·this.getNetworksMatchingActiveNetworkRequest(array); |
534 | ········final·List·mActiveMatchedScanResults·=·this.mActiveMatchedScanResults; | 536 | ········final·Map·mActiveMatchedScanResults·=·this.mActiveMatchedScanResults; |
535 | ········if·((mActiveMatchedScanResults·==·null·||·mActiveMatchedScanResults.isEmpty())·&&·!networksMatchingActiveNetworkRequest.isEmpty())·{ | 537 | ········if·((mActiveMatchedScanResults·==·null·||·mActiveMatchedScanResults.isEmpty())·&&·!networksMatchingActiveNetworkRequest.isEmpty())·{ |
536 | ············this.mWifiMetrics.incrementNetworkRequestApiMatchSizeHistogram(networksMatchingActiveNetworkRequest.size()); | 538 | ············this.mWifiMetrics.incrementNetworkRequestApiMatchSizeHistogram(networksMatchingActiveNetworkRequest.size()); |
537 | ········} | 539 | ········} |
538 | ········this.mActiveMatchedScanResults·=·networksMatchingActiveNetworkRequest; | 540 | ········if·(this.mActiveMatchedScanResults·==·null)·{ |
| 541 | ············this.mActiveMatchedScanResults·=·new·HashMap(); |
| 542 | ········} |
| 543 | ········this.mActiveMatchedScanResults.putAll(networksMatchingActiveNetworkRequest.stream().collect(Collectors.toMap((Function<?·super·Object,·?>)-$$Lambda$WifiNetworkFactory$PUH4U6q6mSks0iS0hsoeLIAea9Y.INSTANCE,·(Function<?·super·Object,·?>)-$$Lambda$WifiNetworkFactory$zp-5HKBQD9pFgdsfos0zUbcOklM.INSTANCE))); |
| 544 | ········this.mActiveMatchedScanResults.entrySet().removeIf((Predicate)new·-$$Lambda$WifiNetworkFactory$B7dCsMWFkmdPXXMQ8ckXD6OoOz4(this.mClock.getElapsedSinceBootMillis())); |
539 | ····} | 545 | ····} |
540 | ···· | 546 | ···· |
541 | ····private·boolean·isAccessPointApprovedForActiveRequest(final·String·s,·final·MacAddress·macAddress,·final·int·n)·{ | 547 | ····private·boolean·isAccessPointApprovedForActiveRequest(final·String·s,·final·MacAddress·macAddress,·final·int·n)·{ |
542 | ········final·String·requestorPackageName·=·this.mActiveSpecificNetworkRequest.getRequestorPackageName(); | 548 | ········final·String·requestorPackageName·=·this.mActiveSpecificNetworkRequest.getRequestorPackageName(); |
543 | ········final·boolean·accessPointApprovedInCompanionDeviceManager·=·this.isAccessPointApprovedInCompanionDeviceManager(macAddress,·UserHandle.getUserHandleForUid(this.mActiveSpecificNetworkRequest.getRequestorUid()),·requestorPackageName); | 549 | ········final·boolean·accessPointApprovedInCompanionDeviceManager·=·this.isAccessPointApprovedInCompanionDeviceManager(macAddress,·UserHandle.getUserHandleForUid(this.mActiveSpecificNetworkRequest.getRequestorUid()),·requestorPackageName); |
544 | ········final·boolean·b·=·true; | 550 | ········final·boolean·b·=·true; |
545 | ········if·(accessPointApprovedInCompanionDeviceManager)·{ | 551 | ········if·(accessPointApprovedInCompanionDeviceManager)·{ |
Offset 668, 35 lines modified | Offset 674, 41 lines modified |
668 | ············Log.e("WifiNetworkFactory",·"Scan·triggered·when·periodic·scanning·paused.·Ignoring..."); | 674 | ············Log.e("WifiNetworkFactory",·"Scan·triggered·when·periodic·scanning·paused.·Ignoring..."); |
669 | ············return; | 675 | ············return; |
670 | ········} | 676 | ········} |
671 | ········this.mAlarmManager.set(2,·this.mClock.getElapsedSinceBootMillis()·+·10000L,·"WifiNetworkFactory",·(AlarmManager$OnAlarmListener)this.mPeriodicScanTimerListener,·this.mHandler); | 677 | ········this.mAlarmManager.set(2,·this.mClock.getElapsedSinceBootMillis()·+·10000L,·"WifiNetworkFactory",·(AlarmManager$OnAlarmListener)this.mPeriodicScanTimerListener,·this.mHandler); |
672 | ········this.mPeriodicScanTimerSet·=·true; | 678 | ········this.mPeriodicScanTimerSet·=·true; |
673 | ····} | 679 | ····} |
674 | ···· | 680 | ···· |
675 | ····private·void·sendNetworkRequestMatchCallbacksForActiveRequest(final·List·list)·{ | 681 | ····private·void·sendNetworkRequestMatchCallbacksForActiveRequest(final·Collection·collection)·{ |
676 | ········if·(list·!=·null)·{ | 682 | ········if·(collection.isEmpty())·{ |
677 | ············if·(!list.isEmpty())·{ | 683 | ············return; |
678 | ················final·int·numCallbacks·=·this.mRegisteredCallbacks.getNumCallbacks(); | 684 | ········} |
679 | ················final·String·s·=·"WifiNetworkFactory"; | 685 | ········final·int·numCallbacks·=·this.mRegisteredCallbacks.getNumCallbacks(); |
680 | ················if·(numCallbacks·==·0)·{ | 686 | ········final·String·s·=·"WifiNetworkFactory"; |
681 | ····················Log.e(s,·"No·callback·registered·for·sending·network·request·matches.·Ignoring..."); | 687 | ········if·(numCallbacks·==·0)·{ |
682 | ····················return; | 688 | ············Log.e(s,·"No·callback·registered·for·sending·network·request·matches.·Ignoring..."); |
| 689 | ············return; |
| 690 | ········} |
| 691 | ········for·(final·INetworkRequestMatchCallback·networkRequestMatchCallback·:·this.mRegisteredCallbacks.getCallbacks())·{ |
| 692 | ············try·{ |
| 693 | ················final·ArrayList·list·=·new·ArrayList(collection); |
| 694 | ················final·INetworkRequestMatchCallback·networkRequestMatchCallback2·=·networkRequestMatchCallback; |
| 695 | ················try·{ |
| 696 | ····················networkRequestMatchCallback2.onMatch((List)list); |
683 | ················} | 697 | ················} |
684 | ················for·(final·INetworkRequestMatchCallback·networkRequestMatchCallback·:·this.mRegisteredCallbacks.getCallbacks())·{ | 698 | ················catch·(RemoteException·ex)·{ |
685 | ····················try·{ | 699 | ····················final·StringBuilder·sb·=·new·StringBuilder(); |
686 | ························networkRequestMatchCallback.onMatch(list); | 700 | ····················sb.append("Unable·to·invoke·network·request·match·callback·"); |
687 | ····················} | 701 | ····················sb.append(networkRequestMatchCallback); |
688 | ····················catch·(RemoteException·ex)·{ | 702 | ····················Log.e(s,·sb.toString(),·(Throwable)ex); |
689 | ························final·StringBuilder·sb·=·new·StringBuilder(); | |
690 | ························sb.append("Unable·to·invoke·network·request·match·callback·"); | |
691 | ························sb.append(networkRequestMatchCallback); | |
692 | ························Log.e(s,·sb.toString(),·(Throwable)ex); | |
693 | ····················} | |
694 | ················} | 703 | ················} |
| 704 | ················continue; |
695 | ············} | 705 | ············} |
| 706 | ············catch·(RemoteException·ex2)·{} |
| 707 | ············break; |
696 | ········} | 708 | ········} |
697 | ····} | 709 | ····} |
698 | ···· | 710 | ···· |
699 | ····private·void·setupForActiveRequest()·{ | 711 | ····private·void·setupForActiveRequest()·{ |
700 | ········if·(this.mActiveSpecificNetworkRequest·!=·null)·{ | 712 | ········if·(this.mActiveSpecificNetworkRequest·!=·null)·{ |
701 | ············this.cleanupActiveRequest(); | 713 | ············this.cleanupActiveRequest(); |
702 | ········} | 714 | ········} |
Offset 908, 15 lines modified | Offset 920, 18 lines modified |
908 | ············Log.v(s,·sb2.toString()); | 920 | ············Log.v(s,·sb2.toString()); |
909 | ········} | 921 | ········} |
910 | ········try·{ | 922 | ········try·{ |
911 | ············try·{ | 923 | ············try·{ |
912 | ················final·WifiNetworkFactory$NetworkFactoryUserSelectionCallback·wifiNetworkFactory$NetworkFactoryUserSelectionCallback·=·new·WifiNetworkFactory$NetworkFactoryUserSelectionCallback(this,·this.mActiveSpecificNetworkRequest); | 924 | ················final·WifiNetworkFactory$NetworkFactoryUserSelectionCallback·wifiNetworkFactory$NetworkFactoryUserSelectionCallback·=·new·WifiNetworkFactory$NetworkFactoryUserSelectionCallback(this,·this.mActiveSpecificNetworkRequest); |
913 | ················try·{ | 925 | ················try·{ |
914 | ····················networkRequestMatchCallback.onUserSelectionCallbackRegistration((INetworkRequestUserSelectionCallback)wifiNetworkFactory$NetworkFactoryUserSelectionCallback); | 926 | ····················networkRequestMatchCallback.onUserSelectionCallbackRegistration((INetworkRequestUserSelectionCallback)wifiNetworkFactory$NetworkFactoryUserSelectionCallback); |
915 | ····················this.sendNetworkRequestMatchCallbacksForActiveRequest(this.mActiveMatchedScanResults); | 927 | ····················final·Map·mActiveMatchedScanResults·=·this.mActiveMatchedScanResults; |
| 928 | ····················if·(mActiveMatchedScanResults·!=·null)·{ |
| 929 | ························this.sendNetworkRequestMatchCallbacksForActiveRequest(mActiveMatchedScanResults.values()); |
| 930 | ····················} |
916 | ················} | 931 | ················} |
917 | ················catch·(RemoteException·ex2)·{ | 932 | ················catch·(RemoteException·ex2)·{ |
918 | ····················final·StringBuilder·sb3·=·new·StringBuilder(); | 933 | ····················final·StringBuilder·sb3·=·new·StringBuilder(); |
919 | ····················sb3.append("Unable·to·invoke·user·selection·registration·callback·"); | 934 | ····················sb3.append("Unable·to·invoke·user·selection·registration·callback·"); |
920 | ····················sb3.append(networkRequestMatchCallback); | 935 | ····················sb3.append(networkRequestMatchCallback); |
921 | ····················Log.e(s,·sb3.toString(),·(Throwable)ex2); | 936 | ····················Log.e(s,·sb3.toString(),·(Throwable)ex2); |
922 | ················} | 937 | ················} |
Offset 1104, 15 lines modified | Offset 1119, 18 lines modified |
1104 | ····················final·StringBuilder·sb·=·new·StringBuilder(); | 1119 | ····················final·StringBuilder·sb·=·new·StringBuilder(); |
1105 | ····················sb.append("Using·cached·"); | 1120 | ····················sb.append("Using·cached·"); |
1106 | ····················sb.append(filteredCachedScanResults.length); | 1121 | ····················sb.append(filteredCachedScanResults.length); |
1107 | ····················sb.append("·scan·results"); | 1122 | ····················sb.append("·scan·results"); |
1108 | ····················Log.v(s,·sb.toString()); | 1123 | ····················Log.v(s,·sb.toString()); |
1109 | ················} | 1124 | ················} |
1110 | ················this.handleScanResults(filteredCachedScanResults); | 1125 | ················this.handleScanResults(filteredCachedScanResults); |
1111 | ················this.sendNetworkRequestMatchCallbacksForActiveRequest(this.mActiveMatchedScanResults); | 1126 | ················final·Map·mActiveMatchedScanResults·=·this.mActiveMatchedScanResults; |
| 1127 | ················if·(mActiveMatchedScanResults·!=·null)·{ |
| 1128 | ····················this.sendNetworkRequestMatchCallbacksForActiveRequest(mActiveMatchedScanResults.values()); |
| 1129 | ················} |
1112 | ················this.startPeriodicScans(); | 1130 | ················this.startPeriodicScans(); |
1113 | ············} | 1131 | ············} |
1114 | ········} | 1132 | ········} |
1115 | ····} | 1133 | ····} |
1116 | ···· | 1134 | ···· |
1117 | ····protected·void·releaseNetworkFor(final·NetworkRequest·networkRequest)·{ | 1135 | ····protected·void·releaseNetworkFor(final·NetworkRequest·networkRequest)·{ |
1118 | ········final·NetworkSpecifier·networkSpecifier·=·networkRequest.getNetworkSpecifier(); | 1136 | ········final·NetworkSpecifier·networkSpecifier·=·networkRequest.getNetworkSpecifier(); |