Offset 5, 14 lines modifiedOffset 5, 15 lines modified
5 import·android.net.wifi.WifiScanner$ScanSettings$HiddenNetwork;5 import·android.net.wifi.WifiScanner$ScanSettings$HiddenNetwork;
6 import·android.os.IBinder;6 import·android.os.IBinder;
7 import·java.io.PrintWriter;7 import·java.io.PrintWriter;
8 import·java.io.FileDescriptor;8 import·java.io.FileDescriptor;
9 import·java.util.Collections;9 import·java.util.Collections;
10 import·com.android.server.wifi.hotspot2.PasspointManager;10 import·com.android.server.wifi.hotspot2.PasspointManager;
11 import·android.net.wifi.WifiManager;11 import·android.net.wifi.WifiManager;
 12 import·android.net.wifi.WifiEnterpriseConfig;
12 import·android.app.AppOpsManager$OnOpChangedListener;13 import·android.app.AppOpsManager$OnOpChangedListener;
13 import·android.app.Notification$Builder;14 import·android.app.Notification$Builder;
14 import·android.app.Notification$Action;15 import·android.app.Notification$Action;
15 import·android.app.Notification$Style;16 import·android.app.Notification$Style;
16 import·android.app.Notification$BigTextStyle;17 import·android.app.Notification$BigTextStyle;
17 import·android.graphics.drawable.Icon;18 import·android.graphics.drawable.Icon;
18 import·android.app.Notification$Action$Builder;19 import·android.app.Notification$Action$Builder;
Offset 23, 26 lines modifiedOffset 24, 25 lines modified
23 import·android.content.DialogInterface$OnClickListener;24 import·android.content.DialogInterface$OnClickListener;
24 import·android.os.Parcelable;25 import·android.os.Parcelable;
25 import·android.os.RemoteException;26 import·android.os.RemoteException;
26 import·android.net.wifi.ISuggestionConnectionStatusListener;27 import·android.net.wifi.ISuggestionConnectionStatusListener;
27 import·com.android.server.wifi.util.ExternalCallbackTracker;28 import·com.android.server.wifi.util.ExternalCallbackTracker;
28 import·android.content.DialogInterface;29 import·android.content.DialogInterface;
29 import·java.util.stream.Stream;30 import·java.util.stream.Stream;
30 import·android.net.wifi.WifiEnterpriseConfig;31 import·android.net.wifi.hotspot2.PasspointConfiguration;
31 import·android.net.wifi.WifiInfo;32 import·android.net.wifi.WifiInfo;
32 import·java.util.function.Predicate;33 import·java.util.function.Predicate;
33 import·android.content.Context;34 import·android.content.Context;
34 import·java.io.Serializable;35 import·java.io.Serializable;
35 import·android.content.Intent;36 import·android.content.Intent;
36 import·android.app.PendingIntent;37 import·android.app.PendingIntent;
 38 import·android.net.wifi.WifiNetworkSuggestion;
37 import·java.util.Iterator;39 import·java.util.Iterator;
38 import·android.net.wifi.ScanResult;40 import·android.net.wifi.ScanResult;
39 import·android.net.wifi.WifiConfiguration;41 import·android.net.wifi.WifiConfiguration;
40 import·android.net.wifi.hotspot2.PasspointConfiguration; 
41 import·android.net.wifi.WifiNetworkSuggestion; 
42 import·android.content.pm.PackageManager$NameNotFoundException;42 import·android.content.pm.PackageManager$NameNotFoundException;
43 import·android.util.Log;43 import·android.util.Log;
44 import·android.content.pm.ApplicationInfo;44 import·android.content.pm.ApplicationInfo;
45 import·android.os.UserHandle;45 import·android.os.UserHandle;
46 import·java.util.stream.Collector;46 import·java.util.stream.Collector;
47 import·java.util.function.Function;47 import·java.util.function.Function;
48 import·java.util.stream.Collectors;48 import·java.util.stream.Collectors;
Offset 221, 20 lines modifiedOffset 221, 18 lines modified
221 ············}221 ············}
222 ············catch·(PackageManager$NameNotFoundException·ex2)·{}222 ············catch·(PackageManager$NameNotFoundException·ex2)·{}
223 ········}223 ········}
224 ········catch·(PackageManager$NameNotFoundException·ex3)·{}224 ········catch·(PackageManager$NameNotFoundException·ex3)·{}
225 ····}225 ····}
226 ····226 ····
227 ····private·int·getCarrierIdFromSuggestion(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·{227 ····private·int·getCarrierIdFromSuggestion(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·{
228 ········final·WifiNetworkSuggestion·wns·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns;228 ········if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration·==·null)·{
229 ········final·PasspointConfiguration·passpointConfiguration·=·wns.passpointConfiguration;229 ············return·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.carrierId;
230 ········if·(passpointConfiguration·==·null)·{ 
231 ············return·wns.wifiConfiguration.carrierId; 
232 ········}230 ········}
233 ········return·passpointConfiguration.getCarrierId();231 ········return·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration.getCarrierId();
234 ····}232 ····}
235 ····233 ····
236 ····private·List·getMatchingScanResults(final·WifiConfiguration·wifiConfiguration,·final·List·list)·{234 ····private·List·getMatchingScanResults(final·WifiConfiguration·wifiConfiguration,·final·List·list)·{
237 ········final·ScanResultMatchInfo·fromWifiConfiguration·=·ScanResultMatchInfo.fromWifiConfiguration(wifiConfiguration);235 ········final·ScanResultMatchInfo·fromWifiConfiguration·=·ScanResultMatchInfo.fromWifiConfiguration(wifiConfiguration);
238 ········if·(fromWifiConfiguration·==·null)·{236 ········if·(fromWifiConfiguration·==·null)·{
239 ············return·new·ArrayList();237 ············return·new·ArrayList();
240 ········}238 ········}
Offset 394, 19 lines modifiedOffset 392, 18 lines modified
394 ················}392 ················}
395 ················if·(this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2)·!=·this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion))·{393 ················if·(this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2)·!=·this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion))·{
396 ····················continue;394 ····················continue;
397 ················}395 ················}
398 ················if·(WifiConfiguration.isMetered(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2.wns.wifiConfiguration,·(WifiInfo)null)·!=·metered)·{396 ················if·(WifiConfiguration.isMetered(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2.wns.wifiConfiguration,·(WifiInfo)null)·!=·metered)·{
399 ····················continue;397 ····················continue;
400 ················}398 ················}
401 ················final·WifiConfiguration·wifiConfiguration·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2.wns.wifiConfiguration;399 ················if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2.wns.wifiConfiguration.priority·<·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.priority)·{
402 ················if·(wifiConfiguration.priority·<·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.priority)·{ 
403 ····················continue;400 ····················continue;
404 ················}401 ················}
405 ················final·WifiConfiguration·configuredNetwork·=·this.mWifiConfigManager.getConfiguredNetwork(wifiConfiguration.getKey());402 ················final·WifiConfiguration·configuredNetwork·=·this.mWifiConfigManager.getConfiguredNetwork(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2.wns.wifiConfiguration.getKey());
406 ················if·(configuredNetwork·!=·null·&&·!configuredNetwork.getNetworkSelectionStatus().isNetworkEnabled())·{403 ················if·(configuredNetwork·!=·null·&&·!configuredNetwork.getNetworkSelectionStatus().isNetworkEnabled())·{
407 ····················continue;404 ····················continue;
408 ················}405 ················}
409 ················set.add(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2);406 ················set.add(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2);
410 ············}407 ············}
411 ········}408 ········}
412 ········if·(set.isEmpty())·{409 ········if·(set.isEmpty())·{
Offset 436, 30 lines modifiedOffset 433, 27 lines modified
436 ················return·0;433 ················return·0;
437 ············}434 ············}
438 ········}435 ········}
439 ········return·1;436 ········return·1;
440 ····}437 ····}
441 ····438 ····
442 ····private·boolean·isOpenSuggestion(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·{439 ····private·boolean·isOpenSuggestion(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·{
443 ········final·WifiNetworkSuggestion·wns·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns;440 ········return·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration·==·null·&&·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.isOpenNetwork();
444 ········return·wns.passpointConfiguration·==·null·&&·wns.wifiConfiguration.isOpenNetwork(); 
445 ····}441 ····}
446 ····442 ····
447 ····private·boolean·isSimBasedSuggestion(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·{443 ····private·boolean·isSimBasedSuggestion(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·{
448 ········final·WifiNetworkSuggestion·wns·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns;444 ········final·PasspointConfiguration·passpointConfiguration·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration;
449 ········final·PasspointConfiguration·passpointConfiguration·=·wns.passpointConfiguration; 
450 ········boolean·b·=·true;445 ········boolean·b·=·true;
451 ········if·(passpointConfiguration·==·null)·{446 ········if·(passpointConfiguration·==·null)·{
452 ············final·WifiEnterpriseConfig·enterpriseConfig·=·wns.wifiConfiguration.enterpriseConfig;447 ············if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.enterpriseConfig·==·null·||·!wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.enterpriseConfig.isAuthenticationSimBased())·{
453 ············if·(enterpriseConfig·==·null·||·!enterpriseConfig.isAuthenticationSimBased())·{ 
454 ················b·=·false;448 ················b·=·false;
455 ············}449 ············}
456 ············return·b;450 ············return·b;
457 ········}451 ········}
458 ········if·(passpointConfiguration.getCredential().getSimCredential()·==·null)·{452 ········if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration.getCredential().getSimCredential()·==·null)·{
459 ············b·=·false;453 ············b·=·false;
460 ········}454 ········}
461 ········return·b;455 ········return·b;
462 ····}456 ····}
463 ····457 ····
464 ····private·boolean·isSuggestionFromForegroundApp(final·String·s)·{458 ····private·boolean·isSuggestionFromForegroundApp(final·String·s)·{
465 ········boolean·b·=·false;459 ········boolean·b·=·false;
Offset 552, 21 lines modifiedOffset 546, 20 lines modified
552 ················sb.append(s);546 ················sb.append(s);
553 ················Log.v("WifiNetworkSuggestionsManager",·sb.toString());547 ················Log.v("WifiNetworkSuggestionsManager",·sb.toString());
554 ············}548 ············}
555 ············this.stopTrackingAppOpsChange(s);549 ············this.stopTrackingAppOpsChange(s);
556 ········}550 ········}
557 ········final·ArrayList<WifiNetworkSuggestion>·list·=·new·ArrayList<WifiNetworkSuggestion>();551 ········final·ArrayList<WifiNetworkSuggestion>·list·=·new·ArrayList<WifiNetworkSuggestion>();
558 ········for·(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·:·set)·{552 ········for·(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·:·set)·{
559 ············final·WifiNetworkSuggestion·wns·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns;553 ············if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration·!=·null)·{
560 ············if·(wns.passpointConfiguration·!=·null)·{ 
561 ················this.mWifiInjector.getPasspointManager().removeProvider(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.perAppInfo.uid,·false,·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration.getUniqueId(),·(String)null);554 ················this.mWifiInjector.getPasspointManager().removeProvider(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.perAppInfo.uid,·false,·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration.getUniqueId(),·(String)null);
562 ················this.removeFromPassPointInfoMap(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);555 ················this.removeFromPassPointInfoMap(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);
563 ············}556 ············}
564 ············else·{557 ············else·{
565 ················if·(wns.wifiConfiguration.isEnterprise())·{558 ················if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.isEnterprise())·{
566 ····················this.mWifiKeyStore.removeKeys(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.enterpriseConfig);559 ····················this.mWifiKeyStore.removeKeys(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.enterpriseConfig);
567 ················}560 ················}
568 ················this.removeFromScanResultMatchInfoMapAndRemoveRelatedScoreCard(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);561 ················this.removeFromScanResultMatchInfoMapAndRemoveRelatedScoreCard(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);
569 ············}562 ············}
570 ············list.add(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns);563 ············list.add(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns);
571 ········}564 ········}
572 ········final·Iterator<WifiNetworkSuggestionsManager$OnSuggestionUpdateListener>·iterator2·=·(Iterator<WifiNetworkSuggestionsManager$OnSuggestionUpdateListener>)this.mListeners.iterator();565 ········final·Iterator<WifiNetworkSuggestionsManager$OnSuggestionUpdateListener>·iterator2·=·(Iterator<WifiNetworkSuggestionsManager$OnSuggestionUpdateListener>)this.mListeners.iterator();
Offset 598, 29 lines modifiedOffset 591, 22 lines modified
598 ····················}591 ····················}
599 ····················if·(this.mVerboseLoggingEnabled)·{592 ····················if·(this.mVerboseLoggingEnabled)·{
600 ························final·StringBuilder·sb·=·new·StringBuilder();593 ························final·StringBuilder·sb·=·new·StringBuilder();
601 ························sb.append("Restore·auto-join·for·suggestion:·");594 ························sb.append("Restore·auto-join·for·suggestion:·");
602 ························sb.append(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);595 ························sb.append(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);
603 ························Log.v("WifiNetworkSuggestionsManager",·sb.toString());596 ························Log.v("WifiNetworkSuggestionsManager",·sb.toString());
604 ····················}597 ····················}
605 ····················final·boolean·isAutojoinEnabled·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled;598 ····················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled·|=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.isInitialAutoJoinEnabled;
606 ····················final·WifiNetworkSuggestion·wns·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns;599 ····················if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration·==·null)·{
607 ····················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled·=·(isAutojoinEnabled·|·wns.isInitialAutoJoinEnabled);600 ························continue;
608 ····················if·(wns.passpointConfiguration·!=·null)·{ 
609 ························this.mWifiInjector.getPasspointManager().enableAutojoin(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration.getUniqueId(),·(String)null,·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled); 
610 ····················} 
611 ····················else·{ 
612 ························final·WifiConfiguration·internalWifiConfiguration·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.createInternalWifiConfiguration(); 
613 ························final·WifiNetworkSuggestionsManager$PerAppInfo·perAppInfo·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.perAppInfo; 
614 ························this.updateWifiConfigInWcmIfPresent(internalWifiConfiguration,·perAppInfo.uid,·perAppInfo.packageName); 
615 ····················}601 ····················}
 602 ····················this.mWifiInjector.getPasspointManager().enableAutojoin(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration.getUniqueId(),·(String)null,·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled);
616 ················}603 ················}
617 ············}604 ············}
618 ········}605 ········}
619 ········this.saveToStore(); 
620 ····}606 ····}
621 ····607 ····
622 ····private·void·saveToStore()·{608 ····private·void·saveToStore()·{
623 ········final·boolean·mHasNewDataToSerialize·=·true;609 ········final·boolean·mHasNewDataToSerialize·=·true;
624 ········this.mHasNewDataToSerialize·=·mHasNewDataToSerialize;610 ········this.mHasNewDataToSerialize·=·mHasNewDataToSerialize;
625 ········if·(!this.mWifiConfigManager.saveToStore(mHasNewDataToSerialize))·{611 ········if·(!this.mWifiConfigManager.saveToStore(mHasNewDataToSerialize))·{
626 ············Log.w("WifiNetworkSuggestionsManager",·"Failed·to·save·to·store");612 ············Log.w("WifiNetworkSuggestionsManager",·"Failed·to·save·to·store");
Offset 799, 38 lines modifiedOffset 785, 32 lines modified
799 ············sb.append(s);785 ············sb.append(s);
800 ············Log.wtf("WifiNetworkSuggestionsManager",·sb.toString());786 ············Log.wtf("WifiNetworkSuggestionsManager",·sb.toString());
801 ············return;787 ············return;
802 ········}788 ········}
803 ········this.mAppOps.stopWatchingMode((AppOpsManager$OnOpChangedListener)wifiNetworkSuggestionsManager$AppOpsChangedListener);789 ········this.mAppOps.stopWatchingMode((AppOpsManager$OnOpChangedListener)wifiNetworkSuggestionsManager$AppOpsChangedListener);
804 ····}790 ····}
805 ····791 ····
806 ····private·void·updateWifiConfigInWcmIfPresent(final·WifiConfiguration·wifiConfiguration,·int·networkId,·String·s)·{792 ····private·void·updateWifiConfigInWcmIfPresent(final·WifiConfiguration·wifiConfiguration,·final·int·n,·final·String·s)·{
807 ········final·WifiConfiguration·configuredNetwork·=·this.mWifiConfigManager.getConfiguredNetwork(wifiConfiguration.getKey());793 ········final·WifiConfiguration·configuredNetwork·=·this.mWifiConfigManager.getConfiguredNetwork(wifiConfiguration.getKey());
808 ········if·(configuredNetwork·==·null)·{794 ········if·(configuredNetwork·==·null)·{
809 ············return;795 ············return;
810 ········}796 ········}
811 ········if·(!configuredNetwork.fromWifiNetworkSuggestion)·{797 ········if·(!configuredNetwork.fromWifiNetworkSuggestion)·{
812 ············return;798 ············return;
813 ········}799 ········}
814 ········if·(configuredNetwork.creatorUid·==·networkId)·{800 ········if·(configuredNetwork.creatorUid·==·n)·{
815 ············if·(TextUtils.equals((CharSequence)configuredNetwork.creatorName,·(CharSequence)s))·{801 ············if·(TextUtils.equals((CharSequence)configuredNetwork.creatorName,·(CharSequence)s))·{
816 ················final·NetworkUpdateResult·addOrUpdateNetwork·=·this.mWifiConfigManager.addOrUpdateNetwork(wifiConfiguration,·networkId,·s);802 ················final·boolean·success·=·this.mWifiConfigManager.addOrUpdateNetwork(wifiConfiguration,·n,·s).isSuccess();
817 ················final·boolean·success·=·addOrUpdateNetwork.isSuccess(); 
818 ················final·String·s2·=·"WifiNetworkSuggestionsManager";803 ················final·String·s2·=·"WifiNetworkSuggestionsManager";
819 ················if·(!success)·{804 ················if·(!success)·{
820 ····················Log.e(s2,·"Failed·to·update·config·in·WifiConfigManager");805 ····················Log.e(s2,·"Failed·to·update·config·in·WifiConfigManager");
821 ····················return; 
822 ················}806 ················}
823 ················if·(this.mVerboseLoggingEnabled)·{807 ················else·if·(this.mVerboseLoggingEnabled)·{
824 ····················s·=·"Updated·config·in·WifiConfigManager";808 ····················Log.v(s2,·"Updated·config·in·WifiConfigManager");
825 ····················Log.v(s2,·s);809 ················}
826 ················} 
827 ················final·WifiConfigManager·mWifiConfigManager·=·this.mWifiConfigManager; 
828 ················networkId·=·addOrUpdateNetwork.getNetworkId(); 
829 ················mWifiConfigManager.allowAutojoin(networkId,·wifiConfiguration.allowAutojoin); 
830 ············}810 ············}
831 ········}811 ········}
832 ····}812 ····}
833 ····813 ····
834 ····private·boolean·validateCarrierNetworkSuggestions(final·List·list,·int·checkNetworkCarrierProvisioningPermission,·final·String·s)·{814 ····private·boolean·validateCarrierNetworkSuggestions(final·List·list,·int·checkNetworkCarrierProvisioningPermission,·final·String·s)·{
835 ········checkNetworkCarrierProvisioningPermission·=·(this.mWifiPermissionsUtil.checkNetworkCarrierProvisioningPermission(checkNetworkCarrierProvisioningPermission)·?·1·:·0);815 ········checkNetworkCarrierProvisioningPermission·=·(this.mWifiPermissionsUtil.checkNetworkCarrierProvisioningPermission(checkNetworkCarrierProvisioningPermission)·?·1·:·0);
836 ········final·boolean·b·=·true;816 ········final·boolean·b·=·true;
Offset 874, 75 lines modifiedOffset 854, 81 lines modified
874 ············if·(!hasNext)·{854 ············if·(!hasNext)·{
875 ················return·b;855 ················return·b;
876 ············}856 ············}
877 ············final·WifiNetworkSuggestion·wifiNetworkSuggestion·=·(WifiNetworkSuggestion)iterator.next();857 ············final·WifiNetworkSuggestion·wifiNetworkSuggestion·=·(WifiNetworkSuggestion)iterator.next();
878 ············if·(wifiNetworkSuggestion·==·null)·{858 ············if·(wifiNetworkSuggestion·==·null)·{
879 ················break;859 ················break;
880 ············}860 ············}
881 ············final·WifiConfiguration·wifiConfiguration·=·wifiNetworkSuggestion.wifiConfiguration;861 ············if·(wifiNetworkSuggestion.wifiConfiguration·==·null)·{
882 ············if·(wifiConfiguration·==·null)·{ 
883 ················break;862 ················break;
884 ············}863 ············}
885 ············final·PasspointConfiguration·passpointConfiguration·=·wifiNetworkSuggestion.passpointConfiguration;864 ············if·(wifiNetworkSuggestion.passpointConfiguration·==·null)·{
886 ············if·(passpointConfiguration·==·null)·{865 ················if·(!WifiConfigurationUtil.validate(wifiNetworkSuggestion.wifiConfiguration,·b))·{
887 ················if·(!WifiConfigurationUtil.validate(wifiConfiguration,·b))·{ 
888 ····················return·false;866 ····················return·false;
889 ················}867 ················}
890 ················if·(wifiNetworkSuggestion.wifiConfiguration.isEnterprise()·&&·wifiNetworkSuggestion.wifiConfiguration.enterpriseConfig.isInsecure())·{868 ················if·(wifiNetworkSuggestion.wifiConfiguration.isEnterprise()·&&·wifiNetworkSuggestion.wifiConfiguration.enterpriseConfig.isInsecure())·{
891 ····················Log.e("WifiNetworkSuggestionsManager",·"Insecure·enterprise·suggestion·is·invalid.");869 ····················Log.e("WifiNetworkSuggestionsManager",·"Insecure·enterprise·suggestion·is·invalid.");
892 ····················return·false;870 ····················return·false;
893 ················}871 ················}
894 ················continue;872 ················continue;
895 ············}873 ············}
896 ············else·{874 ············else·{
897 ················if·(!passpointConfiguration.validate())·{875 ················if·(!wifiNetworkSuggestion.passpointConfiguration.validate())·{
898 ····················break;876 ····················break;
899 ················}877 ················}
900 ················continue;878 ················continue;
901 ············}879 ············}
902 ········}880 ········}
903 ········return·false;881 ········return·false;
904 ····}882 ····}
905 ····883 ····
906 ····public·int·add(final·List·list,·final·int·uid,·final·String·s,·final·String·s2)·{884 ····public·int·add(final·List·list,·final·int·uid,·final·String·s,·final·String·s2)·{
907 ········final·boolean·mUserDataLoaded·=·this.mUserDataLoaded;885 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(uid);
908 ········final·int·hasUserApproved·=·1;886 ········final·int·hasUserApproved·=·1;
909 ········final·String·s3·=·"WifiNetworkSuggestionsManager";887 ········final·String·s3·=·"WifiNetworkSuggestionsManager";
910 ········if·(!mUserDataLoaded)·{888 ········if·(!doesUidBelongToCurrentUser)·{
 889 ············final·StringBuilder·sb·=·new·StringBuilder();
 890 ············sb.append("UID·");
 891 ············sb.append(uid);
 892 ············sb.append("·not·visible·to·the·current·user");
 893 ············Log.e(s3,·sb.toString());
 894 ············return·hasUserApproved;
 895 ········}
 896 ········if·(!this.mUserDataLoaded)·{
911 ············Log.e(s3,·"Add·Network·suggestion·before·boot·complete·is·not·allowed.");897 ············Log.e(s3,·"Add·Network·suggestion·before·boot·complete·is·not·allowed.");
912 ············return·hasUserApproved;898 ············return·hasUserApproved;
913 ········}899 ········}
914 ········if·(list·==·null·||·list.isEmpty())·{900 ········if·(list·==·null·||·list.isEmpty())·{
915 ············final·StringBuilder·sb·=·new·StringBuilder(); 
916 ············sb.append("Empty·list·of·network·suggestions·for·"); 
917 ············sb.append(s); 
918 ············sb.append(".·Ignoring"); 
919 ············Log.w(s3,·sb.toString()); 
920 ············return·0; 
921 ········} 
922 ········if·(this.mVerboseLoggingEnabled)·{ 
923 ············final·StringBuilder·sb2·=·new·StringBuilder();901 ············final·StringBuilder·sb2·=·new·StringBuilder();
924 ············sb2.append("Adding·");902 ············sb2.append("Empty·list·of·network·suggestions·for·");
925 ············sb2.append(list.size()); 
926 ············sb2.append("·networks·from·"); 
927 ············sb2.append(s);903 ············sb2.append(s);
928 ············Log.v(s3,·sb2.toString());904 ············sb2.append(".·Ignoring");
 905 ············Log.w(s3,·sb2.toString());
 906 ············return·0;
929 ········}907 ········}
930 ········if·(!this.validateNetworkSuggestions(list))·{908 ········if·(this.mVerboseLoggingEnabled)·{
931 ············final·StringBuilder·sb3·=·new·StringBuilder();909 ············final·StringBuilder·sb3·=·new·StringBuilder();
932 ············sb3.append("Invalid·suggestion·add·from·app:·");910 ············sb3.append("Adding·");
 911 ············sb3.append(list.size());
 912 ············sb3.append("·networks·from·");
933 ············sb3.append(s);913 ············sb3.append(s);
934 ············Log.e(s3,·sb3.toString());914 ············Log.v(s3,·sb3.toString());
935 ············return·7; 
936 ········}915 ········}
937 ········if·(!this.validateCarrierNetworkSuggestions(list,·uid,·s))·{916 ········if·(!this.validateNetworkSuggestions(list))·{
938 ············final·StringBuilder·sb4·=·new·StringBuilder();917 ············final·StringBuilder·sb4·=·new·StringBuilder();
939 ············sb4.append("bad·wifi·suggestion·from·app:·");918 ············sb4.append("Invalid·suggestion·add·from·app:·");
940 ············sb4.append(s);919 ············sb4.append(s);
941 ············Log.e(s3,·sb4.toString());920 ············Log.e(s3,·sb4.toString());
 921 ············return·7;
 922 ········}
 923 ········if·(!this.validateCarrierNetworkSuggestions(list,·uid,·s))·{
 924 ············final·StringBuilder·sb5·=·new·StringBuilder();
 925 ············sb5.append("bad·wifi·suggestion·from·app:·");
 926 ············sb5.append(s);
 927 ············Log.e(s3,·sb5.toString());
942 ············return·6;928 ············return·6;
943 ········}929 ········}
944 ········final·int·carrierIdForPackageWithCarrierPrivileges·=·this.mWifiCarrierInfoManager.getCarrierIdForPackageWithCarrierPrivileges(s);930 ········final·int·carrierIdForPackageWithCarrierPrivileges·=·this.mWifiCarrierInfoManager.getCarrierIdForPackageWithCarrierPrivileges(s);
945 ········final·String·activeScorerPackage·=·this.mNetworkScoreManager.getActiveScorerPackage();931 ········final·String·activeScorerPackage·=·this.mNetworkScoreManager.getActiveScorerPackage();
946 ········WifiNetworkSuggestionsManager$PerAppInfo·wifiNetworkSuggestionsManager$PerAppInfo·=·(WifiNetworkSuggestionsManager$PerAppInfo)this.mActiveNetworkSuggestionsPerApp.get(s);932 ········WifiNetworkSuggestionsManager$PerAppInfo·wifiNetworkSuggestionsManager$PerAppInfo·=·(WifiNetworkSuggestionsManager$PerAppInfo)this.mActiveNetworkSuggestionsPerApp.get(s);
947 ········final·int·n·=·-1;933 ········final·int·n·=·-1;
948 ········if·(wifiNetworkSuggestionsManager$PerAppInfo·==·null)·{934 ········if·(wifiNetworkSuggestionsManager$PerAppInfo·==·null)·{
Offset 980, 63 lines modifiedOffset 966, 60 lines modified
980 ········wifiNetworkSuggestionsManager$PerAppInfo.setUid(uid);966 ········wifiNetworkSuggestionsManager$PerAppInfo.setUid(uid);
981 ········final·Set·convertToExtendedWnsSet·=·this.convertToExtendedWnsSet(list,·wifiNetworkSuggestionsManager$PerAppInfo);967 ········final·Set·convertToExtendedWnsSet·=·this.convertToExtendedWnsSet(list,·wifiNetworkSuggestionsManager$PerAppInfo);
982 ········final·int·maxNumberOfNetworkSuggestionsPerApp·=·WifiManager.getMaxNumberOfNetworkSuggestionsPerApp(this.mActivityManager.isLowRamDevice());968 ········final·int·maxNumberOfNetworkSuggestionsPerApp·=·WifiManager.getMaxNumberOfNetworkSuggestionsPerApp(this.mActivityManager.isLowRamDevice());
983 ········if·(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.size()·+·convertToExtendedWnsSet.size()·>·maxNumberOfNetworkSuggestionsPerApp)·{969 ········if·(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.size()·+·convertToExtendedWnsSet.size()·>·maxNumberOfNetworkSuggestionsPerApp)·{
984 ············final·HashSet·set·=·new·HashSet(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions);970 ············final·HashSet·set·=·new·HashSet(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions);
985 ············set.addAll(convertToExtendedWnsSet);971 ············set.addAll(convertToExtendedWnsSet);
986 ············if·(set.size()·>·maxNumberOfNetworkSuggestionsPerApp)·{972 ············if·(set.size()·>·maxNumberOfNetworkSuggestionsPerApp)·{
987 ················final·StringBuilder·sb5·=·new·StringBuilder();973 ················final·StringBuilder·sb6·=·new·StringBuilder();
988 ················sb5.append("Failed·to·add·network·suggestions·for·");974 ················sb6.append("Failed·to·add·network·suggestions·for·");
989 ················sb5.append(s);975 ················sb6.append(s);
990 ················sb5.append(".·Exceeds·max·per·app,·current·list·size:·");976 ················sb6.append(".·Exceeds·max·per·app,·current·list·size:·");
991 ················sb5.append(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.size());977 ················sb6.append(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.size());
992 ················sb5.append(",·new·list·size:·");978 ················sb6.append(",·new·list·size:·");
993 ················sb5.append(convertToExtendedWnsSet.size());979 ················sb6.append(convertToExtendedWnsSet.size());
994 ················Log.e(s3,·sb5.toString());980 ················Log.e(s3,·sb6.toString());
995 ················return·4;981 ················return·4;
996 ············}982 ············}
997 ········}983 ········}
998 ········if·(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.isEmpty())·{984 ········if·(wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.isEmpty())·{
999 ············this.startTrackingAppOpsChange(s,·uid);985 ············this.startTrackingAppOpsChange(s,·uid);
1000 ········}986 ········}
1001 ········for·(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·:·convertToExtendedWnsSet)·{987 ········for·(final·WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·:·convertToExtendedWnsSet)·{
1002 ············if·(carrierIdForPackageWithCarrierPrivileges·!=·n)·{988 ············if·(carrierIdForPackageWithCarrierPrivileges·!=·n)·{
1003 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.setCarrierId(carrierIdForPackageWithCarrierPrivileges);989 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.setCarrierId(carrierIdForPackageWithCarrierPrivileges);
1004 ············}990 ············}
1005 ············if·(this.isSimBasedSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·&&·!this.mWifiCarrierInfoManager.requiresImsiEncryption(this.mWifiCarrierInfoManager.getMatchingSubId(this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)))·&&·!this.mWifiCarrierInfoManager.hasUserApprovedImsiPrivacyExemptionForCarrier(this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)))·{991 ············if·(this.isSimBasedSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)·&&·!this.mWifiCarrierInfoManager.requiresImsiEncryption(this.mWifiCarrierInfoManager.getMatchingSubId(this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)))·&&·!this.mWifiCarrierInfoManager.hasUserApprovedImsiPrivacyExemptionForCarrier(this.getCarrierIdFromSuggestion(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion)))·{
1006 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled·=·false;992 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled·=·false;
1007 ············}993 ············}
1008 ············final·WifiNetworkSuggestion·wns·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns; 
1009 ············final·PasspointConfiguration·passpointConfiguration·=·wns.passpointConfiguration; 
1010 ············WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2;994 ············WifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2;
1011 ············if·(passpointConfiguration·==·null)·{995 ············if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration·==·null)·{
1012 ················if·(wns.wifiConfiguration.isEnterprise()·&&·!this.mWifiKeyStore.updateNetworkKeys(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration,·(WifiConfiguration)null))·{996 ················if·(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.isEnterprise()·&&·!this.mWifiKeyStore.updateNetworkKeys(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration,·(WifiConfiguration)null))·{
1013 ····················final·StringBuilder·sb6·=·new·StringBuilder();997 ····················final·StringBuilder·sb7·=·new·StringBuilder();
1014 ····················sb6.append("Enterprise·network·install·failure·for·SSID:·");998 ····················sb7.append("Enterprise·network·install·failure·for·SSID:·");
1015 ····················sb6.append(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.SSID);999 ····················sb7.append(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.SSID);
1016 ····················Log.e(s3,·sb6.toString());1000 ····················Log.e(s3,·sb7.toString());
1017 ····················continue;1001 ····················continue;
1018 ················}1002 ················}
1019 ················this.updateWifiConfigInWcmIfPresent(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.createInternalWifiConfiguration(),·uid,·s);1003 ················this.updateWifiConfigInWcmIfPresent(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.createInternalWifiConfiguration(),·uid,·s);
1020 ················this.addToScanResultMatchInfoMap(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);1004 ················this.addToScanResultMatchInfoMap(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);
1021 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion;1005 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion;
1022 ············}1006 ············}
1023 ············else·{1007 ············else·{
1024 ················passpointConfiguration.setAutojoinEnabled(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled);1008 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration.setAutojoinEnabled(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.isAutojoinEnabled);
1025 ················final·PasspointManager·passpointManager·=·this.mWifiInjector.getPasspointManager();1009 ················final·PasspointManager·passpointManager·=·this.mWifiInjector.getPasspointManager();
1026 ················final·WifiNetworkSuggestion·wns2·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns;1010 ················final·PasspointConfiguration·passpointConfiguration·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.passpointConfiguration;
1027 ················final·PasspointConfiguration·passpointConfiguration2·=·wns2.passpointConfiguration; 
1028 ················final·boolean·b·=·true;1011 ················final·boolean·b·=·true;
1029 ················final·boolean·b2·=·wns2.isUntrusted()·^·true;1012 ················final·boolean·b2·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.isUntrusted()·^·true;
1030 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion;1013 ················wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2·=·wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion;
1031 ················if·(!passpointManager.addOrUpdateProvider(passpointConfiguration2,·uid,·s,·b,·b2))·{1014 ················if·(!passpointManager.addOrUpdateProvider(passpointConfiguration,·uid,·s,·b,·b2))·{
1032 ····················final·StringBuilder·sb7·=·new·StringBuilder();1015 ····················final·StringBuilder·sb8·=·new·StringBuilder();
1033 ····················sb7.append("Passpoint·profile·install·failure·for·FQDN:·");1016 ····················sb8.append("Passpoint·profile·install·failure·for·FQDN:·");
1034 ····················sb7.append(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.FQDN);1017 ····················sb8.append(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion.wns.wifiConfiguration.FQDN);
1035 ····················Log.e(s3,·sb7.toString());1018 ····················Log.e(s3,·sb8.toString());
1036 ····················continue;1019 ····················continue;
1037 ················}1020 ················}
1038 ················this.addToPasspointInfoMap(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);1021 ················this.addToPasspointInfoMap(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion);
1039 ············}1022 ············}
1040 ············wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.remove(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2);1023 ············wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.remove(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2);
1041 ············wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.add(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2);1024 ············wifiNetworkSuggestionsManager$PerAppInfo2.extNetworkSuggestions.add(wifiNetworkSuggestionsManager$ExtendedWifiNetworkSuggestion2);
1042 ········}1025 ········}
Offset 1129, 18 lines modifiedOffset 1112, 29 lines modified
1129 ········}1112 ········}
1130 ········else·{1113 ········else·{
1131 ············mVerboseLoggingEnabled·=·0;1114 ············mVerboseLoggingEnabled·=·0;
1132 ········}1115 ········}
1133 ········this.mVerboseLoggingEnabled·=·(mVerboseLoggingEnabled·!=·0);1116 ········this.mVerboseLoggingEnabled·=·(mVerboseLoggingEnabled·!=·0);
1134 ····}1117 ····}
1135 ····1118 ····
1136 ····public·List·get(final·String·s)·{1119 ····public·List·get(final·String·s,·int·mUserDataLoaded)·{
1137 ········final·ArrayList<WifiNetworkSuggestion>·list·=·new·ArrayList<WifiNetworkSuggestion>();1120 ········final·ArrayList<WifiNetworkSuggestion>·list·=·new·ArrayList<WifiNetworkSuggestion>();
1138 ········if·(!this.mUserDataLoaded)·{1121 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(mUserDataLoaded);
1139 ············Log.e("WifiNetworkSuggestionsManager",·"Get·Network·suggestion·before·boot·complete·is·not·allowed.");1122 ········final·String·s2·=·"WifiNetworkSuggestionsManager";
 1123 ········if·(!doesUidBelongToCurrentUser)·{
 1124 ············final·StringBuilder·sb·=·new·StringBuilder();
 1125 ············sb.append("UID·");
 1126 ············sb.append(mUserDataLoaded);
 1127 ············sb.append("·not·visible·to·the·current·user");
 1128 ············Log.e(s2,·sb.toString());
 1129 ············return·list;
 1130 ········}
 1131 ········mUserDataLoaded·=·(this.mUserDataLoaded·?·1·:·0);
 1132 ········if·(mUserDataLoaded·==·0)·{
 1133 ············Log.e(s2,·"Get·Network·suggestion·before·boot·complete·is·not·allowed.");
1140 ············return·list;1134 ············return·list;
1141 ········}1135 ········}
1142 ········final·WifiNetworkSuggestionsManager$PerAppInfo·wifiNetworkSuggestionsManager$PerAppInfo·=·(WifiNetworkSuggestionsManager$PerAppInfo)this.mActiveNetworkSuggestionsPerApp.get(s);1136 ········final·WifiNetworkSuggestionsManager$PerAppInfo·wifiNetworkSuggestionsManager$PerAppInfo·=·(WifiNetworkSuggestionsManager$PerAppInfo)this.mActiveNetworkSuggestionsPerApp.get(s);
1143 ········if·(wifiNetworkSuggestionsManager$PerAppInfo·==·null)·{1137 ········if·(wifiNetworkSuggestionsManager$PerAppInfo·==·null)·{
1144 ············return·list;1138 ············return·list;
1145 ········}1139 ········}
1146 ········final·Iterator·iterator·=·wifiNetworkSuggestionsManager$PerAppInfo.extNetworkSuggestions.iterator();1140 ········final·Iterator·iterator·=·wifiNetworkSuggestionsManager$PerAppInfo.extNetworkSuggestions.iterator();
Offset 1437, 76 lines modifiedOffset 1431, 94 lines modified
1437 ········final·StringBuilder·sb·=·new·StringBuilder();1431 ········final·StringBuilder·sb·=·new·StringBuilder();
1438 ········sb.append("Matched·network·suggestion·is·missing·for·FQDN:");1432 ········sb.append("Matched·network·suggestion·is·missing·for·FQDN:");
1439 ········sb.append(wifiConfiguration.FQDN);1433 ········sb.append(wifiConfiguration.FQDN);
1440 ········Log.e("WifiNetworkSuggestionsManager",·sb.toString());1434 ········Log.e("WifiNetworkSuggestionsManager",·sb.toString());
1441 ········return·false;1435 ········return·false;
1442 ····}1436 ····}
1443 ····1437 ····
1444 ····public·boolean·registerSuggestionConnectionStatusListener(final·IBinder·binder,·final·ISuggestionConnectionStatusListener·suggestionConnectionStatusListener,·final·int·n,·final·String·s)·{1438 ····public·boolean·registerSuggestionConnectionStatusListener(final·IBinder·binder,·final·ISuggestionConnectionStatusListener·suggestionConnectionStatusListener,·final·int·n,·final·String·s,·final·int·n2)·{
 1439 ········if·(!this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(n2))·{
 1440 ············final·StringBuilder·sb·=·new·StringBuilder();
 1441 ············sb.append("UID·");
 1442 ············sb.append(n2);
 1443 ············sb.append("·not·visible·to·the·current·user");
 1444 ············Log.e("WifiNetworkSuggestionsManager",·sb.toString());
 1445 ············return·false;
 1446 ········}
1445 ········ExternalCallbackTracker·externalCallbackTracker·=·(ExternalCallbackTracker)this.mSuggestionStatusListenerPerApp.get(s);1447 ········ExternalCallbackTracker·externalCallbackTracker·=·(ExternalCallbackTracker)this.mSuggestionStatusListenerPerApp.get(s);
1446 ········if·(externalCallbackTracker·==·null)·{1448 ········if·(externalCallbackTracker·==·null)·{
1447 ············externalCallbackTracker·=·new·ExternalCallbackTracker(this.mHandler);1449 ············externalCallbackTracker·=·new·ExternalCallbackTracker(this.mHandler);
1448 ········}1450 ········}
1449 ········externalCallbackTracker.add(binder,·(Object)suggestionConnectionStatusListener,·n);1451 ········externalCallbackTracker.add(binder,·(Object)suggestionConnectionStatusListener,·n);
1450 ········this.mSuggestionStatusListenerPerApp.put(s,·externalCallbackTracker);1452 ········this.mSuggestionStatusListenerPerApp.put(s,·externalCallbackTracker);
1451 ········return·true;1453 ········return·true;
1452 ····}1454 ····}
1453 ····1455 ····
1454 ····public·int·remove(final·List·list,·int·mUserDataLoaded,·final·String·s)·{1456 ····public·int·remove(final·List·list,·int·mUserDataLoaded,·final·String·s)·{
1455 ········mUserDataLoaded·=·(this.mUserDataLoaded·?·1·:·0);1457 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(mUserDataLoaded);
 1458 ········final·boolean·b·=·true;
1456 ········final·String·s2·=·"WifiNetworkSuggestionsManager";1459 ········final·String·s2·=·"WifiNetworkSuggestionsManager";
 1460 ········if·(!doesUidBelongToCurrentUser)·{
 1461 ············final·StringBuilder·sb·=·new·StringBuilder();
 1462 ············sb.append("UID·");
 1463 ············sb.append(mUserDataLoaded);
 1464 ············sb.append("·not·visible·to·the·current·user");
 1465 ············Log.e(s2,·sb.toString());
 1466 ············return·b·?·1·:·0;
 1467 ········}
 1468 ········mUserDataLoaded·=·(this.mUserDataLoaded·?·1·:·0);
1457 ········if·(mUserDataLoaded·==·0)·{1469 ········if·(mUserDataLoaded·==·0)·{
1458 ············Log.e(s2,·"Remove·Network·suggestion·before·boot·complete·is·not·allowed.");1470 ············Log.e(s2,·"Remove·Network·suggestion·before·boot·complete·is·not·allowed.");
1459 ············return·1;1471 ············return·b·?·1·:·0;
1460 ········}1472 ········}
1461 ········mUserDataLoaded·=·0;1473 ········mUserDataLoaded·=·0;
1462 ········if·(list·==·null)·{1474 ········if·(list·==·null)·{
1463 ············final·StringBuilder·sb·=·new·StringBuilder();1475 ············final·StringBuilder·sb2·=·new·StringBuilder();
1464 ············sb.append("Null·list·of·network·suggestions·for·");1476 ············sb2.append("Null·list·of·network·suggestions·for·");
1465 ············sb.append(s);1477 ············sb2.append(s);
1466 ············sb.append(".·Ignoring");1478 ············sb2.append(".·Ignoring");
1467 ············Log.w(s2,·sb.toString());1479 ············Log.w(s2,·sb2.toString());
1468 ············return·0;1480 ············return·0;
1469 ········}1481 ········}
1470 ········if·(this.mVerboseLoggingEnabled)·{1482 ········if·(this.mVerboseLoggingEnabled)·{
1471 ············final·StringBuilder·sb2·=·new·StringBuilder();1483 ············final·StringBuilder·sb3·=·new·StringBuilder();
1472 ············sb2.append("Removing·");1484 ············sb3.append("Removing·");
1473 ············sb2.append(list.size());1485 ············sb3.append(list.size());
1474 ············sb2.append("·networks·from·");1486 ············sb3.append("·networks·from·");
1475 ············sb2.append(s);1487 ············sb3.append(s);
1476 ············Log.v(s2,·sb2.toString());1488 ············Log.v(s2,·sb3.toString());
1477 ········}1489 ········}
1478 ········final·boolean·validateNetworkSuggestions·=·this.validateNetworkSuggestions(list);1490 ········final·boolean·validateNetworkSuggestions·=·this.validateNetworkSuggestions(list);
1479 ········final·int·n·=·5;1491 ········final·int·n·=·5;
1480 ········if·(!validateNetworkSuggestions)·{1492 ········if·(!validateNetworkSuggestions)·{
1481 ············final·StringBuilder·sb3·=·new·StringBuilder(); 
1482 ············sb3.append("Invalid·suggestion·remove·from·app:·"); 
1483 ············sb3.append(s); 
1484 ············Log.e(s2,·sb3.toString()); 
1485 ············return·n; 
1486 ········} 
1487 ········final·WifiNetworkSuggestionsManager$PerAppInfo·wifiNetworkSuggestionsManager$PerAppInfo·=·(WifiNetworkSuggestionsManager$PerAppInfo)this.mActiveNetworkSuggestionsPerApp.get(s); 
1488 ········final·String·s3·=·"Failed·to·remove·network·suggestions·for·"; 
1489 ········if·(wifiNetworkSuggestionsManager$PerAppInfo·==·null)·{ 
1490 ············final·StringBuilder·sb4·=·new·StringBuilder();1493 ············final·StringBuilder·sb4·=·new·StringBuilder();
1491 ············sb4.append(s3);1494 ············sb4.append("Invalid·suggestion·remove·from·app:·");
1492 ············sb4.append(s);1495 ············sb4.append(s);
1493 ············sb4.append(".·No·network·suggestions·found"); 
1494 ············Log.e(s2,·sb4.toString());1496 ············Log.e(s2,·sb4.toString());
1495 ············return·n;1497 ············return·n;
1496 ········}1498 ········}
1497 ········final·Set·convertToExtendedWnsSet·=·this.convertToExtendedWnsSet(list,·wifiNetworkSuggestionsManager$PerAppInfo);1499 ········final·WifiNetworkSuggestionsManager$PerAppInfo·wifiNetworkSuggestionsManager$PerAppInfo·=·(WifiNetworkSuggestionsManager$PerAppInfo)this.mActiveNetworkSuggestionsPerApp.get(s);
1498 ········if·(!convertToExtendedWnsSet.isEmpty()·&&·!wifiNetworkSuggestionsManager$PerAppInfo.extNetworkSuggestions.containsAll(convertToExtendedWnsSet))·{1500 ········final·String·s3·=·"Failed·to·remove·network·suggestions·for·";
 1501 ········if·(wifiNetworkSuggestionsManager$PerAppInfo·==·null)·{
1499 ············final·StringBuilder·sb5·=·new·StringBuilder();1502 ············final·StringBuilder·sb5·=·new·StringBuilder();
1500 ············sb5.append(s3);1503 ············sb5.append(s3);
1501 ············sb5.append(s);1504 ············sb5.append(s);
1502 ············sb5.append(".·Network·suggestions·not·found·in·active·network·suggestions");1505 ············sb5.append(".·No·network·suggestions·found");
1503 ············Log.e(s2,·sb5.toString());1506 ············Log.e(s2,·sb5.toString());
1504 ············return·n;1507 ············return·n;
1505 ········}1508 ········}
 1509 ········final·Set·convertToExtendedWnsSet·=·this.convertToExtendedWnsSet(list,·wifiNetworkSuggestionsManager$PerAppInfo);
 1510 ········if·(!convertToExtendedWnsSet.isEmpty()·&&·!wifiNetworkSuggestionsManager$PerAppInfo.extNetworkSuggestions.containsAll(convertToExtendedWnsSet))·{
 1511 ············final·StringBuilder·sb6·=·new·StringBuilder();
 1512 ············sb6.append(s3);
 1513 ············sb6.append(s);
 1514 ············sb6.append(".·Network·suggestions·not·found·in·active·network·suggestions");
 1515 ············Log.e(s2,·sb6.toString());
 1516 ············return·n;
 1517 ········}
1506 ········this.removeInternal(convertToExtendedWnsSet,·s,·wifiNetworkSuggestionsManager$PerAppInfo);1518 ········this.removeInternal(convertToExtendedWnsSet,·s,·wifiNetworkSuggestionsManager$PerAppInfo);
1507 ········this.saveToStore();1519 ········this.saveToStore();
1508 ········this.mWifiMetrics.incrementNetworkSuggestionApiNumModification();1520 ········this.mWifiMetrics.incrementNetworkSuggestionApiNumModification();
1509 ········this.mWifiMetrics.noteNetworkSuggestionApiListSizeHistogram(this.getAllMaxSizes());1521 ········this.mWifiMetrics.noteNetworkSuggestionApiListSizeHistogram(this.getAllMaxSizes());
1510 ········return·0;1522 ········return·0;
1511 ····}1523 ····}
1512 ····1524 ····
Offset 1624, 24 lines modifiedOffset 1636, 34 lines modified
1624 ····················}1636 ····················}
1625 ················}1637 ················}
1626 ············}1638 ············}
1627 ········}1639 ········}
1628 ········return·false;1640 ········return·false;
1629 ····}1641 ····}
1630 ····1642 ····
1631 ····public·void·unregisterSuggestionConnectionStatusListener(int·numCallbacks,·final·String·s)·{1643 ····public·void·unregisterSuggestionConnectionStatusListener(int·numCallbacks,·final·String·s,·final·int·n)·{
 1644 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(n);
 1645 ········final·String·s2·=·"WifiNetworkSuggestionsManager";
 1646 ········if·(!doesUidBelongToCurrentUser)·{
 1647 ············final·StringBuilder·sb·=·new·StringBuilder();
 1648 ············sb.append("UID·");
 1649 ············sb.append(n);
 1650 ············sb.append("·not·visible·to·the·current·user");
 1651 ············Log.e(s2,·sb.toString());
 1652 ············return;
 1653 ········}
1632 ········final·ExternalCallbackTracker·externalCallbackTracker·=·(ExternalCallbackTracker)this.mSuggestionStatusListenerPerApp.get(s);1654 ········final·ExternalCallbackTracker·externalCallbackTracker·=·(ExternalCallbackTracker)this.mSuggestionStatusListenerPerApp.get(s);
1633 ········if·(externalCallbackTracker·==·null·||·externalCallbackTracker.remove(numCallbacks)·==·null)·{1655 ········if·(externalCallbackTracker·==·null·||·externalCallbackTracker.remove(numCallbacks)·==·null)·{
1634 ············final·StringBuilder·sb·=·new·StringBuilder();1656 ············final·StringBuilder·sb2·=·new·StringBuilder();
1635 ············sb.append("unregisterSuggestionConnectionStatusListener:·Listener[");1657 ············sb2.append("unregisterSuggestionConnectionStatusListener:·Listener[");
1636 ············sb.append(numCallbacks);1658 ············sb2.append(numCallbacks);
1637 ············sb.append("]·from·");1659 ············sb2.append("]·from·");
1638 ············sb.append(s);1660 ············sb2.append(s);
1639 ············sb.append("·already·unregister.");1661 ············sb2.append("·already·unregister.");
1640 ············Log.w("WifiNetworkSuggestionsManager",·sb.toString());1662 ············Log.w(s2,·sb2.toString());
1641 ········}1663 ········}
1642 ········if·(externalCallbackTracker·!=·null)·{1664 ········if·(externalCallbackTracker·!=·null)·{
1643 ············numCallbacks·=·externalCallbackTracker.getNumCallbacks();1665 ············numCallbacks·=·externalCallbackTracker.getNumCallbacks();
1644 ············if·(numCallbacks·==·0)·{1666 ············if·(numCallbacks·==·0)·{
1645 ················this.mSuggestionStatusListenerPerApp.remove(s);1667 ················this.mSuggestionStatusListenerPerApp.remove(s);
1646 ············}1668 ············}
1647 ········}1669 ········}