Offset 16, 42 lines modifiedOffset 16, 41 lines modified
16 import·android.net.ProxyInfo;16 import·android.net.ProxyInfo;
17 import·android.net.IpConfiguration$ProxySettings;17 import·android.net.IpConfiguration$ProxySettings;
18 import·android.net.StaticIpConfiguration;18 import·android.net.StaticIpConfiguration;
19 import·android.net.IpConfiguration$IpAssignment;19 import·android.net.IpConfiguration$IpAssignment;
20 import·android.text.TextUtils;20 import·android.text.TextUtils;
21 import·java.io.IOException;21 import·java.io.IOException;
22 import·org.xmlpull.v1.XmlPullParserException;22 import·org.xmlpull.v1.XmlPullParserException;
23 import·android.net.wifi.WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo; 
24 import·android.util.ArraySet;23 import·android.util.ArraySet;
25 import·com.android.wifi.x.android.net.util.MacAddressUtils;24 import·com.android.wifi.x.android.net.util.MacAddressUtils;
 25 import·android.net.wifi.WifiConfiguration$NetworkSelectionStatus;
 26 import·android.net.wifi.WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo;
26 import·java.util.Collection;27 import·java.util.Collection;
27 import·java.util.HashSet;28 import·java.util.HashSet;
28 import·java.util.Set;29 import·java.util.Set;
29 import·android.content.ContentResolver;30 import·android.content.ContentResolver;
30 import·android.net.wifi.WifiEnterpriseConfig;31 import·android.net.wifi.WifiEnterpriseConfig;
31 import·android.provider.Settings$Global;32 import·android.provider.Settings$Global;
32 import·java.util.Iterator;33 import·java.util.Iterator;
33 import·java.util.BitSet;34 import·java.util.BitSet;
34 import·android.util.Log;35 import·android.util.Log;
35 import·android.net.wifi.WifiConfiguration;36 import·android.net.wifi.WifiConfiguration;
36 import·android.app.ActivityManager;37 import·android.app.ActivityManager;
37 import·android.net.wifi.WifiConfiguration$NetworkSelectionStatus; 
38 import·java.util.ArrayList;38 import·java.util.ArrayList;
39 import·java.util.HashMap;39 import·java.util.HashMap;
40 import·android.os.UserHandle;40 import·android.os.UserHandle;
41 import·android.os.Handler;41 import·android.os.Handler;
42 import·com.android.server.wifi.util.WifiPermissionsWrapper;42 import·com.android.server.wifi.util.WifiPermissionsWrapper;
43 import·com.android.server.wifi.util.WifiPermissionsUtil;43 import·com.android.server.wifi.util.WifiPermissionsUtil;
44 import·com.android.server.wifi.util.MissingCounterTimerLockList;44 import·com.android.server.wifi.util.MissingCounterTimerLockList;
45 import·android.os.UserManager;45 import·android.os.UserManager;
46 import·java.util.Map;46 import·java.util.Map;
47 import·com.android.server.wifi.util.LruConnectionTracker;47 import·com.android.server.wifi.util.LruConnectionTracker;
48 import·com.android.wifi.x.android.util.LocalLog;48 import·com.android.wifi.x.android.util.LocalLog;
49 import·java.util.List;49 import·java.util.List;
50 import·android.util.SparseArray; 
51 import·android.content.Context;50 import·android.content.Context;
52 import·android.net.MacAddress;51 import·android.net.MacAddress;
  
53 public·class·WifiConfigManager52 public·class·WifiConfigManager
54 {53 {
55 ····protected·static·final·long·AGGRESSIVE_MAC_REFRESH_MS_MAX·=·86400000L;54 ····protected·static·final·long·AGGRESSIVE_MAC_REFRESH_MS_MAX·=·86400000L;
56 ····protected·static·final·long·AGGRESSIVE_MAC_REFRESH_MS_MIN·=·1800000L;55 ····protected·static·final·long·AGGRESSIVE_MAC_REFRESH_MS_MIN·=·1800000L;
Offset 71, 15 lines modifiedOffset 70, 14 lines modified
71 ····private·final·BackupManagerProxy·mBackupManagerProxy;70 ····private·final·BackupManagerProxy·mBackupManagerProxy;
72 ····private·final·Clock·mClock;71 ····private·final·Clock·mClock;
73 ····private·final·ConfigurationMap·mConfiguredNetworks;72 ····private·final·ConfigurationMap·mConfiguredNetworks;
74 ····private·final·Context·mContext;73 ····private·final·Context·mContext;
75 ····private·int·mCurrentUserId;74 ····private·int·mCurrentUserId;
76 ····private·boolean·mDeferredUserUnlockRead;75 ····private·boolean·mDeferredUserUnlockRead;
77 ····private·final·DeviceConfigFacade·mDeviceConfigFacade;76 ····private·final·DeviceConfigFacade·mDeviceConfigFacade;
78 ····private·final·SparseArray·mDisableReasonInfo; 
79 ····private·final·FrameworkFacade·mFrameworkFacade;77 ····private·final·FrameworkFacade·mFrameworkFacade;
80 ····private·int·mLastSelectedNetworkId;78 ····private·int·mLastSelectedNetworkId;
81 ····private·long·mLastSelectedTimeStamp;79 ····private·long·mLastSelectedTimeStamp;
82 ····private·final·List·mListeners;80 ····private·final·List·mListeners;
83 ····private·final·LocalLog·mLocalLog;81 ····private·final·LocalLog·mLocalLog;
84 ····private·final·LruConnectionTracker·mLruConnectionTracker;82 ····private·final·LruConnectionTracker·mLruConnectionTracker;
85 ····private·final·MacAddressUtil·mMacAddressUtil;83 ····private·final·MacAddressUtil·mMacAddressUtil;
Offset 138, 16 lines modifiedOffset 136, 14 lines modified
138 ········this.mNetworkListUserStoreData·=·mNetworkListUserStoreData;136 ········this.mNetworkListUserStoreData·=·mNetworkListUserStoreData;
139 ········this.mRandomizedMacStoreData·=·mRandomizedMacStoreData;137 ········this.mRandomizedMacStoreData·=·mRandomizedMacStoreData;
140 ········this.mWifiConfigStore.registerStoreData((WifiConfigStore$StoreData)mNetworkListSharedStoreData);138 ········this.mWifiConfigStore.registerStoreData((WifiConfigStore$StoreData)mNetworkListSharedStoreData);
141 ········this.mWifiConfigStore.registerStoreData((WifiConfigStore$StoreData)this.mNetworkListUserStoreData);139 ········this.mWifiConfigStore.registerStoreData((WifiConfigStore$StoreData)this.mNetworkListUserStoreData);
142 ········this.mWifiConfigStore.registerStoreData((WifiConfigStore$StoreData)this.mRandomizedMacStoreData);140 ········this.mWifiConfigStore.registerStoreData((WifiConfigStore$StoreData)this.mRandomizedMacStoreData);
143 ········this.mFrameworkFacade·=·mFrameworkFacade;141 ········this.mFrameworkFacade·=·mFrameworkFacade;
144 ········this.mDeviceConfigFacade·=·mDeviceConfigFacade;142 ········this.mDeviceConfigFacade·=·mDeviceConfigFacade;
145 ········this.mDisableReasonInfo·=·WifiConfiguration$NetworkSelectionStatus.DISABLE_REASON_INFOS.clone(); 
146 ········this.loadCustomConfigsForDisableReasonInfos(); 
147 ········int·n;143 ········int·n;
148 ········if·(((ActivityManager)mContext.getSystemService((Class)ActivityManager.class)).isLowRamDevice())·{144 ········if·(((ActivityManager)mContext.getSystemService((Class)ActivityManager.class)).isLowRamDevice())·{
149 ············n·=·128;145 ············n·=·128;
150 ········}146 ········}
151 ········else·{147 ········else·{
152 ············n·=·256;148 ············n·=·256;
153 ········}149 ········}
Offset 386, 15 lines modifiedOffset 382, 15 lines modified
386 ········while·(true)·{382 ········while·(true)·{
387 ············final·boolean·hasNext·=·iterator.hasNext();383 ············final·boolean·hasNext·=·iterator.hasNext();
388 ············n·=·1;384 ············n·=·1;
389 ············if·(!hasNext)·{385 ············if·(!hasNext)·{
390 ················break;386 ················break;
391 ············}387 ············}
392 ············final·WifiConfiguration·wifiConfiguration·=·(WifiConfiguration)iterator.next();388 ············final·WifiConfiguration·wifiConfiguration·=·(WifiConfiguration)iterator.next();
393 ············if·((!wifiConfiguration.shared·||·!this.doesUidBelongToCurrentUser(wifiConfiguration.creatorUid))·&&·!wifiConfiguration.ephemeral)·{389 ············if·((wifiConfiguration.shared·||·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(wifiConfiguration.creatorUid))·&&·!wifiConfiguration.ephemeral)·{
394 ················continue;390 ················continue;
395 ············}391 ············}
396 ············set.add(wifiConfiguration.networkId);392 ············set.add(wifiConfiguration.networkId);
397 ············final·StringBuilder·sb2·=·new·StringBuilder();393 ············final·StringBuilder·sb2·=·new·StringBuilder();
398 ············sb2.append("clearInternalUserData:·removed·config.·netId=");394 ············sb2.append("clearInternalUserData:·removed·config.·netId=");
399 ············sb2.append(wifiConfiguration.networkId);395 ············sb2.append(wifiConfiguration.networkId);
400 ············sb2.append("·configKey=");396 ············sb2.append("·configKey=");
Offset 451, 30 lines modifiedOffset 447, 14 lines modified
451 ········}447 ········}
452 ········defaultsInWifiConfiguration.lastUpdateName·=·nameForUid;448 ········defaultsInWifiConfiguration.lastUpdateName·=·nameForUid;
453 ········defaultsInWifiConfiguration.creatorName·=·nameForUid;449 ········defaultsInWifiConfiguration.creatorName·=·nameForUid;
454 ········this.initRandomizedMacForInternalConfig(defaultsInWifiConfiguration);450 ········this.initRandomizedMacForInternalConfig(defaultsInWifiConfiguration);
455 ········return·defaultsInWifiConfiguration;451 ········return·defaultsInWifiConfiguration;
456 ····}452 ····}
457 ····453 ····
458 ····private·boolean·doesUidBelongToCurrentUser(final·int·n)·{ 
459 ········boolean·b·=·true; 
460 ········if·(n·!=·1000)·{ 
461 ············if·(!this.mWifiPermissionsUtil.checkNetworkSettingsPermission(n))·{ 
462 ················final·UserHandle·of·=·UserHandle.of(this.mCurrentUserId); 
463 ················final·UserHandle·userHandleForUid·=·UserHandle.getUserHandleForUid(n); 
464 ················if·(!of.equals((Object)userHandleForUid))·{ 
465 ····················if·(!this.mUserManager.isSameProfileGroup(of,·userHandleForUid))·{ 
466 ························b·=·false; 
467 ····················} 
468 ················} 
469 ············} 
470 ········} 
471 ········return·b; 
472 ····} 
473 ···· 
474 ····private·void·generateRandomizedMacAddresses()·{454 ····private·void·generateRandomizedMacAddresses()·{
475 ········for·(final·WifiConfiguration·wifiConfiguration·:·this.getInternalConfiguredNetworks())·{455 ········for·(final·WifiConfiguration·wifiConfiguration·:·this.getInternalConfiguredNetworks())·{
476 ············if·(WifiConfigManager.DEFAULT_MAC_ADDRESS.equals((Object)wifiConfiguration.getRandomizedMacAddress()))·{456 ············if·(WifiConfigManager.DEFAULT_MAC_ADDRESS.equals((Object)wifiConfiguration.getRandomizedMacAddress()))·{
477 ················this.initRandomizedMacForInternalConfig(wifiConfiguration);457 ················this.initRandomizedMacForInternalConfig(wifiConfiguration);
478 ············}458 ············}
479 ········}459 ········}
480 ····}460 ····}
Offset 547, 14 lines modifiedOffset 527, 38 lines modified
547 ········return·byConfigKeyForCurrentUser;527 ········return·byConfigKeyForCurrentUser;
548 ····}528 ····}
549 ····529 ····
550 ····private·Collection·getInternalConfiguredNetworks()·{530 ····private·Collection·getInternalConfiguredNetworks()·{
551 ········return·this.mConfiguredNetworks.valuesForCurrentUser();531 ········return·this.mConfiguredNetworks.valuesForCurrentUser();
552 ····}532 ····}
553 ····533 ····
 534 ····public·static·int·getNetworkSelectionDisableThreshold(final·int·i)·{
 535 ········final·WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·=·(WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo)WifiConfiguration$NetworkSelectionStatus.DISABLE_REASON_INFOS.get(i);
 536 ········if·(wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·==·null)·{
 537 ············final·StringBuilder·sb·=·new·StringBuilder();
 538 ············sb.append("Unrecognized·network·disable·reason·code·for·disable·threshold:·");
 539 ············sb.append(i);
 540 ············Log.e("WifiConfigManager",·sb.toString());
 541 ············return·-1;
 542 ········}
 543 ········return·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo.mDisableThreshold;
 544 ····}
 545 ····
 546 ····public·static·int·getNetworkSelectionDisableTimeoutMillis(final·int·i)·{
 547 ········final·WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·=·(WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo)WifiConfiguration$NetworkSelectionStatus.DISABLE_REASON_INFOS.get(i);
 548 ········if·(wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·==·null)·{
 549 ············final·StringBuilder·sb·=·new·StringBuilder();
 550 ············sb.append("Unrecognized·network·disable·reason·code·for·disable·timeout:·");
 551 ············sb.append(i);
 552 ············Log.e("WifiConfigManager",·sb.toString());
 553 ············return·-1;
 554 ········}
 555 ········return·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo.mDisableTimeoutMillis;
 556 ····}
 557 ····
554 ····private·ScanDetailCache·getOrCreateScanDetailCacheForNetwork(final·WifiConfiguration·wifiConfiguration)·{558 ····private·ScanDetailCache·getOrCreateScanDetailCacheForNetwork(final·WifiConfiguration·wifiConfiguration)·{
555 ········if·(wifiConfiguration·==·null)·{559 ········if·(wifiConfiguration·==·null)·{
556 ············return·null;560 ············return·null;
557 ········}561 ········}
558 ········ScanDetailCache·scanDetailCacheForNetwork·=·this.getScanDetailCacheForNetwork(wifiConfiguration.networkId);562 ········ScanDetailCache·scanDetailCacheForNetwork·=·this.getScanDetailCacheForNetwork(wifiConfiguration.networkId);
559 ········if·(scanDetailCacheForNetwork·==·null·&&·wifiConfiguration.networkId·!=·-1)·{563 ········if·(scanDetailCacheForNetwork·==·null·&&·wifiConfiguration.networkId·!=·-1)·{
560 ············scanDetailCacheForNetwork·=·new·ScanDetailCache(wifiConfiguration,·192,·128);564 ············scanDetailCacheForNetwork·=·new·ScanDetailCache(wifiConfiguration,·192,·128);
Offset 618, 15 lines modifiedOffset 622, 15 lines modified
618 ········}622 ········}
619 ········if·(randomizedMacAddress·!=·null)·{623 ········if·(randomizedMacAddress·!=·null)·{
620 ············wifiConfiguration.setRandomizedMacAddress(randomizedMacAddress);624 ············wifiConfiguration.setRandomizedMacAddress(randomizedMacAddress);
621 ········}625 ········}
622 ····}626 ····}
623 ····627 ····
624 ····private·boolean·isMacRandomizationSupported()·{628 ····private·boolean·isMacRandomizationSupported()·{
625 ········return·this.mContext.getResources().getBoolean(2130837538);629 ········return·this.mContext.getResources().getBoolean(2130837537);
626 ····}630 ····}
627 ····631 ····
628 ····private·boolean·isNetworkOptInForAggressiveRandomization(final·String·s)·{632 ····private·boolean·isNetworkOptInForAggressiveRandomization(final·String·s)·{
629 ········final·ArraySet·set·=·new·ArraySet((Object[])this.mContext.getResources().getStringArray(2130771973));633 ········final·ArraySet·set·=·new·ArraySet((Object[])this.mContext.getResources().getStringArray(2130771973));
630 ········final·boolean·contains·=·this.mDeviceConfigFacade.getAggressiveMacRandomizationSsidBlocklist().contains(s);634 ········final·boolean·contains·=·this.mDeviceConfigFacade.getAggressiveMacRandomizationSsidBlocklist().contains(s);
631 ········boolean·b·=·false;635 ········boolean·b·=·false;
632 ········if·(!contains)·{636 ········if·(!contains)·{
Offset 658, 23 lines modifiedOffset 662, 14 lines modified
658 ········final·HashMap·linkedConfigurations·=·wifiConfiguration2.linkedConfigurations;662 ········final·HashMap·linkedConfigurations·=·wifiConfiguration2.linkedConfigurations;
659 ········final·String·key·=·wifiConfiguration.getKey();663 ········final·String·key·=·wifiConfiguration.getKey();
660 ········final·int·n·=·1;664 ········final·int·n·=·1;
661 ········linkedConfigurations.put(key,·n);665 ········linkedConfigurations.put(key,·n);
662 ········wifiConfiguration.linkedConfigurations.put(wifiConfiguration2.getKey(),·n);666 ········wifiConfiguration.linkedConfigurations.put(wifiConfiguration2.getKey(),·n);
663 ····}667 ····}
664 ····668 ····
665 ····private·void·loadCustomConfigsForDisableReasonInfos()·{ 
666 ········final·SparseArray·mDisableReasonInfo·=·this.mDisableReasonInfo; 
667 ········final·int·integer·=·this.mContext.getResources().getInteger(2131034132); 
668 ········final·int·n·=·300000; 
669 ········mDisableReasonInfo.put(1,·(Object)new·WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo("NETWORK_SELECTION_DISABLED_ASSOCIATION_REJECTION·",·integer,·n)); 
670 ········this.mDisableReasonInfo.put(2,·(Object)new·WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo("NETWORK_SELECTION_DISABLED_AUTHENTICATION_FAILURE",·this.mContext.getResources().getInteger(2131034133),·n)); 
671 ········this.mDisableReasonInfo.put(3,·(Object)new·WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo("config_wifiDisableReasonDhcpFailureThreshold",·this.mContext.getResources().getInteger(2131034134),·n)); 
672 ····} 
673 ···· 
674 ····private·boolean·loadFromUserStoreAfterUnlockOrSwitch(final·int·n)·{669 ····private·boolean·loadFromUserStoreAfterUnlockOrSwitch(final·int·n)·{
675 ········final·String·s·=·"WifiConfigManager";670 ········final·String·s·=·"WifiConfigManager";
676 ········try·{671 ········try·{
677 ············final·FrameworkFacade·mFrameworkFacade·=·this.mFrameworkFacade;672 ············final·FrameworkFacade·mFrameworkFacade·=·this.mFrameworkFacade;
678 ············try·{673 ············try·{
679 ················final·List·userFiles·=·WifiConfigStore.createUserFiles(n,·mFrameworkFacade.isNiapModeOn(this.mContext));674 ················final·List·userFiles·=·WifiConfigStore.createUserFiles(n,·mFrameworkFacade.isNiapModeOn(this.mContext));
680 ················if·(userFiles·==·null)·{675 ················if·(userFiles·==·null)·{
Offset 1131, 45 lines modifiedOffset 1126, 41 lines modified
1131 ················this.getInternalConfiguredNetwork(wifiConfiguration.networkId).setRandomizedMacAddress(persistentMacAddress);1126 ················this.getInternalConfiguredNetwork(wifiConfiguration.networkId).setRandomizedMacAddress(persistentMacAddress);
1132 ············}1127 ············}
1133 ········}1128 ········}
1134 ········return·persistentMacAddress;1129 ········return·persistentMacAddress;
1135 ····}1130 ····}
1136 ····1131 ····
1137 ····private·boolean·shouldNetworksBeLinked(final·WifiConfiguration·wifiConfiguration,·final·WifiConfiguration·wifiConfiguration2,·final·ScanDetailCache·scanDetailCache,·final·ScanDetailCache·scanDetailCache2)·{1132 ····private·boolean·shouldNetworksBeLinked(final·WifiConfiguration·wifiConfiguration,·final·WifiConfiguration·wifiConfiguration2,·final·ScanDetailCache·scanDetailCache,·final·ScanDetailCache·scanDetailCache2)·{
1138 ········final·boolean·boolean1·=·this.mContext.getResources().getBoolean(2130837547);1133 ········final·boolean·boolean1·=·this.mContext.getResources().getBoolean(2130837546);
1139 ········final·String·s·=·"WifiConfigManager";1134 ········final·String·s·=·"WifiConfigManager";
1140 ········if·(boolean1·&&·!TextUtils.equals((CharSequence)wifiConfiguration.preSharedKey,·(CharSequence)wifiConfiguration2.preSharedKey))·{1135 ········if·(boolean1·&&·!TextUtils.equals((CharSequence)wifiConfiguration.preSharedKey,·(CharSequence)wifiConfiguration2.preSharedKey))·{
1141 ············if·(this.mVerboseLoggingEnabled)·{1136 ············if·(this.mVerboseLoggingEnabled)·{
1142 ················Log.v(s,·"shouldNetworksBeLinked·unlink·due·to·password·mismatch");1137 ················Log.v(s,·"shouldNetworksBeLinked·unlink·due·to·password·mismatch");
1143 ············}1138 ············}
1144 ············return·false;1139 ············return·false;
1145 ········}1140 ········}
1146 ········final·String·defaultGwMacAddress·=·wifiConfiguration.defaultGwMacAddress;1141 ········final·String·defaultGwMacAddress·=·wifiConfiguration.defaultGwMacAddress;
1147 ········final·String·s2·=·"·and·";1142 ········final·String·s2·=·"·and·";
1148 ········final·boolean·b·=·true;1143 ········final·boolean·b·=·true;
1149 ········if·(defaultGwMacAddress·!=·null)·{1144 ········if·(defaultGwMacAddress·!=·null·&&·wifiConfiguration2.defaultGwMacAddress·!=·null)·{
1150 ············final·String·defaultGwMacAddress2·=·wifiConfiguration2.defaultGwMacAddress;1145 ············if·(wifiConfiguration.defaultGwMacAddress.equals(wifiConfiguration2.defaultGwMacAddress))·{
1151 ············if·(defaultGwMacAddress2·!=·null)·{ 
1152 ················if·(defaultGwMacAddress.equals(defaultGwMacAddress2))·{ 
1153 ····················if·(this.mVerboseLoggingEnabled)·{1146 ················if·(this.mVerboseLoggingEnabled)·{
1154 ························final·StringBuilder·sb·=·new·StringBuilder();1147 ····················final·StringBuilder·sb·=·new·StringBuilder();
1155 ························sb.append("shouldNetworksBeLinked·link·due·to·same·gw·");1148 ····················sb.append("shouldNetworksBeLinked·link·due·to·same·gw·");
1156 ························sb.append(wifiConfiguration2.SSID);1149 ····················sb.append(wifiConfiguration2.SSID);
1157 ························sb.append(s2);1150 ····················sb.append(s2);
1158 ························sb.append(wifiConfiguration.SSID);1151 ····················sb.append(wifiConfiguration.SSID);
1159 ························sb.append("·GW·");1152 ····················sb.append("·GW·");
1160 ························sb.append(wifiConfiguration.defaultGwMacAddress);1153 ····················sb.append(wifiConfiguration.defaultGwMacAddress);
1161 ························Log.v(s,·sb.toString());1154 ····················Log.v(s,·sb.toString());
1162 ····················} 
1163 ····················return·b; 
1164 ················}1155 ················}
1165 ················return·false;1156 ················return·b;
1166 ············}1157 ············}
1167 ········}1158 ········}
1168 ········if·(scanDetailCache·!=·null·&&·scanDetailCache2·!=·null)·{1159 ········else·if·(scanDetailCache·!=·null·&&·scanDetailCache2·!=·null)·{
1169 ············for·(final·String·str·:·scanDetailCache.keySet())·{1160 ············for·(final·String·str·:·scanDetailCache.keySet())·{
1170 ················for·(final·String·s3·:·scanDetailCache2.keySet())·{1161 ················for·(final·String·s3·:·scanDetailCache2.keySet())·{
1171 ····················if·(str.regionMatches(true,·0,·s3,·0,·16))·{1162 ····················if·(str.regionMatches(true,·0,·s3,·0,·16))·{
1172 ························if·(this.mVerboseLoggingEnabled)·{1163 ························if·(this.mVerboseLoggingEnabled)·{
1173 ····························final·StringBuilder·sb2·=·new·StringBuilder();1164 ····························final·StringBuilder·sb2·=·new·StringBuilder();
1174 ····························sb2.append("shouldNetworksBeLinked·link·due·to·DBDC·BSSID·match·");1165 ····························sb2.append("shouldNetworksBeLinked·link·due·to·DBDC·BSSID·match·");
1175 ····························sb2.append(wifiConfiguration2.SSID);1166 ····························sb2.append(wifiConfiguration2.SSID);
Offset 1193, 41 lines modifiedOffset 1184, 40 lines modified
1193 ········final·WifiConfiguration$NetworkSelectionStatus·networkSelectionStatus·=·wifiConfiguration.getNetworkSelectionStatus();1184 ········final·WifiConfiguration$NetworkSelectionStatus·networkSelectionStatus·=·wifiConfiguration.getNetworkSelectionStatus();
1194 ········if·(networkSelectionStatus.isNetworkTemporaryDisabled())·{1185 ········if·(networkSelectionStatus.isNetworkTemporaryDisabled())·{
1195 ············final·long·n·=·this.mClock.getElapsedSinceBootMillis()·-·networkSelectionStatus.getDisableTime();1186 ············final·long·n·=·this.mClock.getElapsedSinceBootMillis()·-·networkSelectionStatus.getDisableTime();
1196 ············final·int·networkSelectionDisableReason·=·networkSelectionStatus.getNetworkSelectionDisableReason();1187 ············final·int·networkSelectionDisableReason·=·networkSelectionStatus.getNetworkSelectionDisableReason();
1197 ············final·int·min·=·Math.min(10,·this.mWifiInjector.getBssidBlocklistMonitor().updateAndGetNumBlockedBssidsForSsid(wifiConfiguration.SSID));1188 ············final·int·min·=·Math.min(10,·this.mWifiInjector.getBssidBlocklistMonitor().updateAndGetNumBlockedBssidsForSsid(wifiConfiguration.SSID));
1198 ············long·n2·=·0L;1189 ············long·n2·=·0L;
1199 ············if·(min·>·0)·{1190 ············if·(min·>·0)·{
1200 ················n2·=·(long)(this.getNetworkSelectionDisableTimeoutMillis(networkSelectionDisableReason)·*·Math.pow(2.0,·(double)min·-·1.0));1191 ················n2·=·(long)(getNetworkSelectionDisableTimeoutMillis(networkSelectionDisableReason)·*·Math.pow(2.0,·(double)min·-·1.0));
1201 ············}1192 ············}
1202 ············if·(n·>=·n2)·{1193 ············if·(n·>=·n2)·{
1203 ················return·this.updateNetworkSelectionStatus(wifiConfiguration,·0);1194 ················return·this.updateNetworkSelectionStatus(wifiConfiguration,·0);
1204 ············}1195 ············}
1205 ········}1196 ········}
1206 ········return·false;1197 ········return·false;
1207 ····}1198 ····}
1208 ····1199 ····
1209 ····private·void·unlinkNetworks(final·WifiConfiguration·wifiConfiguration,·final·WifiConfiguration·wifiConfiguration2)·{1200 ····private·void·unlinkNetworks(final·WifiConfiguration·wifiConfiguration,·final·WifiConfiguration·wifiConfiguration2)·{
1210 ········final·HashMap·linkedConfigurations·=·wifiConfiguration2.linkedConfigurations;1201 ········final·HashMap·linkedConfigurations·=·wifiConfiguration2.linkedConfigurations;
1211 ········final·String·s·=·"·from·";1202 ········final·String·s·=·"·from·";
1212 ········final·String·s2·=·"unlinkNetworks·un-link·";1203 ········final·String·s2·=·"unlinkNetworks·un-link·";
1213 ········final·String·s3·=·"WifiConfigManager";1204 ········final·String·s3·=·"WifiConfigManager";
1214 ········if·(linkedConfigurations·!=·null·&&·linkedConfigurations.get(wifiConfiguration.getKey())·!=·null)·{1205 ········if·(linkedConfigurations·!=·null·&&·wifiConfiguration2.linkedConfigurations.get(wifiConfiguration.getKey())·!=·null)·{
1215 ············if·(this.mVerboseLoggingEnabled)·{1206 ············if·(this.mVerboseLoggingEnabled)·{
1216 ················final·StringBuilder·sb·=·new·StringBuilder();1207 ················final·StringBuilder·sb·=·new·StringBuilder();
1217 ················sb.append(s2);1208 ················sb.append(s2);
1218 ················sb.append(wifiConfiguration.getKey());1209 ················sb.append(wifiConfiguration.getKey());
1219 ················sb.append(s);1210 ················sb.append(s);
1220 ················sb.append(wifiConfiguration2.getKey());1211 ················sb.append(wifiConfiguration2.getKey());
1221 ················Log.v(s3,·sb.toString());1212 ················Log.v(s3,·sb.toString());
1222 ············}1213 ············}
1223 ············wifiConfiguration2.linkedConfigurations.remove(wifiConfiguration.getKey());1214 ············wifiConfiguration2.linkedConfigurations.remove(wifiConfiguration.getKey());
1224 ········}1215 ········}
1225 ········final·HashMap·linkedConfigurations2·=·wifiConfiguration.linkedConfigurations; 
1226 ········if·(linkedConfigurations2·!=·null·&&·linkedConfigurations2.get(wifiConfiguration2.getKey())·!=·null)·{1216 ········if·(wifiConfiguration.linkedConfigurations·!=·null·&&·wifiConfiguration.linkedConfigurations.get(wifiConfiguration2.getKey())·!=·null)·{
1227 ············if·(this.mVerboseLoggingEnabled)·{1217 ············if·(this.mVerboseLoggingEnabled)·{
1228 ················final·StringBuilder·sb2·=·new·StringBuilder();1218 ················final·StringBuilder·sb2·=·new·StringBuilder();
1229 ················sb2.append(s2);1219 ················sb2.append(s2);
1230 ················sb2.append(wifiConfiguration2.getKey());1220 ················sb2.append(wifiConfiguration2.getKey());
1231 ················sb2.append(s);1221 ················sb2.append(s);
1232 ················sb2.append(wifiConfiguration.getKey());1222 ················sb2.append(wifiConfiguration.getKey());
1233 ················Log.v(s3,·sb2.toString());1223 ················Log.v(s3,·sb2.toString());
Offset 1256, 15 lines modifiedOffset 1246, 15 lines modified
1256 ················if·(this.mVerboseLoggingEnabled)·{1246 ················if·(this.mVerboseLoggingEnabled)·{
1257 ····················Log.v(s,·"Ignore·update·network·selection·status·since·Watchdog·trigger·is·activated");1247 ····················Log.v(s,·"Ignore·update·network·selection·status·since·Watchdog·trigger·is·activated");
1258 ················}1248 ················}
1259 ················return·false;1249 ················return·false;
1260 ············}1250 ············}
1261 ············networkSelectionStatus.incrementDisableReasonCounter(n);1251 ············networkSelectionStatus.incrementDisableReasonCounter(n);
1262 ············final·int·disableReasonCounter·=·networkSelectionStatus.getDisableReasonCounter(n);1252 ············final·int·disableReasonCounter·=·networkSelectionStatus.getDisableReasonCounter(n);
1263 ············final·int·networkSelectionDisableThreshold·=·this.getNetworkSelectionDisableThreshold(n);1253 ············final·int·networkSelectionDisableThreshold·=·getNetworkSelectionDisableThreshold(n);
1264 ············if·(disableReasonCounter·<·networkSelectionDisableThreshold)·{1254 ············if·(disableReasonCounter·<·networkSelectionDisableThreshold)·{
1265 ················if·(this.mVerboseLoggingEnabled)·{1255 ················if·(this.mVerboseLoggingEnabled)·{
1266 ····················final·StringBuilder·sb·=·new·StringBuilder();1256 ····················final·StringBuilder·sb·=·new·StringBuilder();
1267 ····················sb.append("Disable·counter·for·network·");1257 ····················sb.append("Disable·counter·for·network·");
1268 ····················sb.append(wifiConfiguration.getPrintableSsid());1258 ····················sb.append(wifiConfiguration.getPrintableSsid());
1269 ····················sb.append("·for·reason·");1259 ····················sb.append("·for·reason·");
1270 ····················sb.append(WifiConfiguration$NetworkSelectionStatus.getNetworkSelectionDisableReasonString(n));1260 ····················sb.append(WifiConfiguration$NetworkSelectionStatus.getNetworkSelectionDisableReasonString(n));
Offset 1294, 15 lines modifiedOffset 1284, 15 lines modified
1294 ····}1284 ····}
1295 ····1285 ····
1296 ····public·NetworkUpdateResult·addOrUpdateNetwork(final·WifiConfiguration·wifiConfiguration,·final·int·n)·{1286 ····public·NetworkUpdateResult·addOrUpdateNetwork(final·WifiConfiguration·wifiConfiguration,·final·int·n)·{
1297 ········return·this.addOrUpdateNetwork(wifiConfiguration,·n,·null);1287 ········return·this.addOrUpdateNetwork(wifiConfiguration,·n,·null);
1298 ····}1288 ····}
1299 ····1289 ····
1300 ····public·NetworkUpdateResult·addOrUpdateNetwork(final·WifiConfiguration·wifiConfiguration,·final·int·i,·final·String·s)·{1290 ····public·NetworkUpdateResult·addOrUpdateNetwork(final·WifiConfiguration·wifiConfiguration,·final·int·i,·final·String·s)·{
1301 ········final·boolean·doesUidBelongToCurrentUser·=·this.doesUidBelongToCurrentUser(i);1291 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(i);
1302 ········final·int·n·=·-1;1292 ········final·int·n·=·-1;
1303 ········final·String·s2·=·"WifiConfigManager";1293 ········final·String·s2·=·"WifiConfigManager";
1304 ········if·(!doesUidBelongToCurrentUser)·{1294 ········if·(!doesUidBelongToCurrentUser)·{
1305 ············final·StringBuilder·sb·=·new·StringBuilder();1295 ············final·StringBuilder·sb·=·new·StringBuilder();
1306 ············sb.append("UID·");1296 ············sb.append("UID·");
1307 ············sb.append(i);1297 ············sb.append(i);
1308 ············sb.append("·not·visible·to·the·current·user");1298 ············sb.append("·not·visible·to·the·current·user");
Offset 1449, 15 lines modifiedOffset 1439, 15 lines modified
1449 ········final·String·s2·=·"WifiConfigManager";1439 ········final·String·s2·=·"WifiConfigManager";
1450 ········if·(mVerboseLoggingEnabled)·{1440 ········if·(mVerboseLoggingEnabled)·{
1451 ············final·StringBuilder·sb·=·new·StringBuilder();1441 ············final·StringBuilder·sb·=·new·StringBuilder();
1452 ············sb.append("Disabling·network·");1442 ············sb.append("Disabling·network·");
1453 ············sb.append(updateNetworkSelectionStatus);1443 ············sb.append(updateNetworkSelectionStatus);
1454 ············Log.v(s2,·sb.toString());1444 ············Log.v(s2,·sb.toString());
1455 ········}1445 ········}
1456 ········final·boolean·doesUidBelongToCurrentUser·=·this.doesUidBelongToCurrentUser(n);1446 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(n);
1457 ········final·String·s3·=·"UID·";1447 ········final·String·s3·=·"UID·";
1458 ········if·(!doesUidBelongToCurrentUser)·{1448 ········if·(!doesUidBelongToCurrentUser)·{
1459 ············final·StringBuilder·sb2·=·new·StringBuilder();1449 ············final·StringBuilder·sb2·=·new·StringBuilder();
1460 ············sb2.append(s3);1450 ············sb2.append(s3);
1461 ············sb2.append(n);1451 ············sb2.append(n);
1462 ············sb2.append("·not·visible·to·the·current·user");1452 ············sb2.append("·not·visible·to·the·current·user");
1463 ············Log.e(s2,·sb2.toString());1453 ············Log.e(s2,·sb2.toString());
Offset 1531, 15 lines modifiedOffset 1521, 15 lines modified
1531 ············sb.append("Enabling·network·");1521 ············sb.append("Enabling·network·");
1532 ············sb.append(updateNetworkSelectionStatus);1522 ············sb.append(updateNetworkSelectionStatus);
1533 ············sb.append("·(disableOthers·");1523 ············sb.append("·(disableOthers·");
1534 ············sb.append(b);1524 ············sb.append(b);
1535 ············sb.append(")");1525 ············sb.append(")");
1536 ············Log.v(s2,·sb.toString());1526 ············Log.v(s2,·sb.toString());
1537 ········}1527 ········}
1538 ········final·boolean·doesUidBelongToCurrentUser·=·this.doesUidBelongToCurrentUser(n);1528 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(n);
1539 ········final·String·s3·=·"UID·";1529 ········final·String·s3·=·"UID·";
1540 ········if·(!doesUidBelongToCurrentUser)·{1530 ········if·(!doesUidBelongToCurrentUser)·{
1541 ············final·StringBuilder·sb2·=·new·StringBuilder();1531 ············final·StringBuilder·sb2·=·new·StringBuilder();
1542 ············sb2.append(s3);1532 ············sb2.append(s3);
1543 ············sb2.append(n);1533 ············sb2.append(n);
1544 ············sb2.append("·not·visible·to·the·current·user");1534 ············sb2.append("·not·visible·to·the·current·user");
1545 ············Log.e(s2,·sb2.toString());1535 ············Log.e(s2,·sb2.toString());
Offset 1707, 38 lines modifiedOffset 1697, 14 lines modified
1707 ········return·internalConfiguredNetwork.getKey();1697 ········return·internalConfiguredNetwork.getKey();
1708 ····}1698 ····}
1709 ····1699 ····
1710 ····public·long·getLastSelectedTimeStamp()·{1700 ····public·long·getLastSelectedTimeStamp()·{
1711 ········return·this.mLastSelectedTimeStamp;1701 ········return·this.mLastSelectedTimeStamp;
1712 ····}1702 ····}
1713 ····1703 ····
1714 ····public·int·getNetworkSelectionDisableThreshold(final·int·i)·{ 
1715 ········final·WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·=·(WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo)this.mDisableReasonInfo.get(i); 
1716 ········if·(wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·==·null)·{ 
1717 ············final·StringBuilder·sb·=·new·StringBuilder(); 
1718 ············sb.append("Unrecognized·network·disable·reason·code·for·disable·threshold:·"); 
1719 ············sb.append(i); 
1720 ············Log.e("WifiConfigManager",·sb.toString()); 
1721 ············return·-1; 
1722 ········} 
1723 ········return·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo.mDisableThreshold; 
1724 ····} 
1725 ···· 
1726 ····public·int·getNetworkSelectionDisableTimeoutMillis(final·int·i)·{ 
1727 ········final·WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·=·(WifiConfiguration$NetworkSelectionStatus$DisableReasonInfo)this.mDisableReasonInfo.get(i); 
1728 ········if·(wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo·==·null)·{ 
1729 ············final·StringBuilder·sb·=·new·StringBuilder(); 
1730 ············sb.append("Unrecognized·network·disable·reason·code·for·disable·timeout:·"); 
1731 ············sb.append(i); 
1732 ············Log.e("WifiConfigManager",·sb.toString()); 
1733 ············return·-1; 
1734 ········} 
1735 ········return·wifiConfiguration$NetworkSelectionStatus$DisableReasonInfo.mDisableTimeoutMillis; 
1736 ····} 
1737 ···· 
1738 ····protected·int·getRandomizedMacAddressMappingSize()·{1704 ····protected·int·getRandomizedMacAddressMappingSize()·{
1739 ········return·this.mRandomizedMacAddressMapping.size();1705 ········return·this.mRandomizedMacAddressMapping.size();
1740 ····}1706 ····}
1741 ····1707 ····
1742 ····public·MacAddress·getRandomizedMacAndUpdateIfNeeded(final·WifiConfiguration·randomizedMacToPersistentMac)·{1708 ····public·MacAddress·getRandomizedMacAndUpdateIfNeeded(final·WifiConfiguration·randomizedMacToPersistentMac)·{
1743 ········MacAddress·macAddress;1709 ········MacAddress·macAddress;
1744 ········if·(this.shouldUseAggressiveRandomization(randomizedMacToPersistentMac))·{1710 ········if·(this.shouldUseAggressiveRandomization(randomizedMacToPersistentMac))·{
Offset 1959, 15 lines modifiedOffset 1925, 15 lines modified
1959 ············}1925 ············}
1960 ············++i;1926 ············++i;
1961 ········}1927 ········}
1962 ········return·b;1928 ········return·b;
1963 ····}1929 ····}
1964 ····1930 ····
1965 ····public·boolean·removeNetwork(int·n,·int·n2,·final·String·s)·{1931 ····public·boolean·removeNetwork(int·n,·int·n2,·final·String·s)·{
1966 ········final·boolean·doesUidBelongToCurrentUser·=·this.doesUidBelongToCurrentUser(n2);1932 ········final·boolean·doesUidBelongToCurrentUser·=·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(n2);
1967 ········final·String·s2·=·"UID·";1933 ········final·String·s2·=·"UID·";
1968 ········final·String·s3·=·"WifiConfigManager";1934 ········final·String·s3·=·"WifiConfigManager";
1969 ········if·(!doesUidBelongToCurrentUser)·{1935 ········if·(!doesUidBelongToCurrentUser)·{
1970 ············final·StringBuilder·sb·=·new·StringBuilder();1936 ············final·StringBuilder·sb·=·new·StringBuilder();
1971 ············sb.append(s2);1937 ············sb.append(s2);
1972 ············sb.append(n2);1938 ············sb.append(n2);
1973 ············sb.append("·not·visible·to·the·current·user");1939 ············sb.append("·not·visible·to·the·current·user");
Offset 2175, 27 lines modifiedOffset 2141, 27 lines modified
2175 ········final·ArrayList<WifiConfiguration>·configurations2·=·new·ArrayList<WifiConfiguration>();2141 ········final·ArrayList<WifiConfiguration>·configurations2·=·new·ArrayList<WifiConfiguration>();
2176 ········final·ArrayList<Integer>·list·=·new·ArrayList<Integer>();2142 ········final·ArrayList<Integer>·list·=·new·ArrayList<Integer>();
2177 ········for·(final·WifiConfiguration·wifiConfiguration·:·this.mConfiguredNetworks.valuesForAllUsers())·{2143 ········for·(final·WifiConfiguration·wifiConfiguration·:·this.mConfiguredNetworks.valuesForAllUsers())·{
2178 ············if·(!wifiConfiguration.ephemeral)·{2144 ············if·(!wifiConfiguration.ephemeral)·{
2179 ················if·(wifiConfiguration.isPasspoint()·&&·!wifiConfiguration.isLegacyPasspointConfig)·{2145 ················if·(wifiConfiguration.isPasspoint()·&&·!wifiConfiguration.isLegacyPasspointConfig)·{
2180 ····················continue;2146 ····················continue;
2181 ················}2147 ················}
2182 ················if·(wifiConfiguration.isLegacyPasspointConfig·&&·this.doesUidBelongToCurrentUser(wifiConfiguration.creatorUid))·{2148 ················if·(wifiConfiguration.isLegacyPasspointConfig·&&·!this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(wifiConfiguration.creatorUid))·{
2183 ····················list.add(wifiConfiguration.networkId);2149 ····················list.add(wifiConfiguration.networkId);
2184 ····················if·(PasspointManager.addLegacyPasspointConfig(wifiConfiguration))·{2150 ····················if·(PasspointManager.addLegacyPasspointConfig(wifiConfiguration))·{
2185 ························continue;2151 ························continue;
2186 ····················}2152 ····················}
2187 ····················final·StringBuilder·sb·=·new·StringBuilder();2153 ····················final·StringBuilder·sb·=·new·StringBuilder();
2188 ····················sb.append("Failed·to·migrate·legacy·Passpoint·config:·");2154 ····················sb.append("Failed·to·migrate·legacy·Passpoint·config:·");
2189 ····················sb.append(wifiConfiguration.FQDN);2155 ····················sb.append(wifiConfiguration.FQDN);
2190 ····················Log.e(s,·sb.toString());2156 ····················Log.e(s,·sb.toString());
2191 ················}2157 ················}
2192 ················else·{2158 ················else·{
2193 ····················wifiConfiguration.isMostRecentlyConnected·=·this.mLruConnectionTracker.isMostRecentlyConnected(wifiConfiguration);2159 ····················wifiConfiguration.isMostRecentlyConnected·=·this.mLruConnectionTracker.isMostRecentlyConnected(wifiConfiguration);
2194 ····················if·(!wifiConfiguration.shared·&&·this.doesUidBelongToCurrentUser(wifiConfiguration.creatorUid))·{2160 ····················if·(!wifiConfiguration.shared·&&·this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(wifiConfiguration.creatorUid))·{
2195 ························configurations2.add(wifiConfiguration);2161 ························configurations2.add(wifiConfiguration);
2196 ····················}2162 ····················}
2197 ····················else·{2163 ····················else·{
2198 ························configurations.add(wifiConfiguration);2164 ························configurations.add(wifiConfiguration);
2199 ····················}2165 ····················}
2200 ················}2166 ················}
2201 ············}2167 ············}
Offset 2334, 15 lines modifiedOffset 2300, 15 lines modified
2334 ········final·String·s·=·"WifiConfigManager";2300 ········final·String·s·=·"WifiConfigManager";
2335 ········if·(mVerboseLoggingEnabled)·{2301 ········if·(mVerboseLoggingEnabled)·{
2336 ············final·StringBuilder·sb·=·new·StringBuilder();2302 ············final·StringBuilder·sb·=·new·StringBuilder();
2337 ············sb.append("Update·network·last·connect·UID·for·");2303 ············sb.append("Update·network·last·connect·UID·for·");
2338 ············sb.append(i);2304 ············sb.append(i);
2339 ············Log.v(s,·sb.toString());2305 ············Log.v(s,·sb.toString());
2340 ········}2306 ········}
2341 ········if·(!this.doesUidBelongToCurrentUser(n))·{2307 ········if·(!this.mWifiPermissionsUtil.doesUidBelongToCurrentUser(n))·{
2342 ············final·StringBuilder·sb2·=·new·StringBuilder();2308 ············final·StringBuilder·sb2·=·new·StringBuilder();
2343 ············sb2.append("UID·");2309 ············sb2.append("UID·");
2344 ············sb2.append(n);2310 ············sb2.append(n);
2345 ············sb2.append("·not·visible·to·the·current·user");2311 ············sb2.append("·not·visible·to·the·current·user");
2346 ············Log.e(s,·sb2.toString());2312 ············Log.e(s,·sb2.toString());
2347 ············return·false;2313 ············return·false;
2348 ········}2314 ········}
Offset 2386, 17 lines modifiedOffset 2352, 16 lines modified
2386 ············sb.append(i);2352 ············sb.append(i);
2387 ············Log.v("WifiConfigManager",·sb.toString());2353 ············Log.v("WifiConfigManager",·sb.toString());
2388 ········}2354 ········}
2389 ········final·WifiConfiguration·internalConfiguredNetwork·=·this.getInternalConfiguredNetwork(i);2355 ········final·WifiConfiguration·internalConfiguredNetwork·=·this.getInternalConfiguredNetwork(i);
2390 ········if·(internalConfiguredNetwork·==·null)·{2356 ········if·(internalConfiguredNetwork·==·null)·{
2391 ············return·false;2357 ············return·false;
2392 ········}2358 ········}
2393 ········final·long·wallClockMillis·=·this.mClock.getWallClockMillis(); 
2394 ········internalConfiguredNetwork.lastDisconnected·=·wallClockMillis;2359 ········internalConfiguredNetwork.lastDisconnected·=·this.mClock.getWallClockMillis();
2395 ········internalConfiguredNetwork.randomizedMacExpirationTimeMs·=·Math.max(internalConfiguredNetwork.randomizedMacExpirationTimeMs,·wallClockMillis·+·14400000L);2360 ········internalConfiguredNetwork.randomizedMacExpirationTimeMs·=·Math.max(internalConfiguredNetwork.randomizedMacExpirationTimeMs,·internalConfiguredNetwork.lastDisconnected·+·14400000L);
2396 ········if·(internalConfiguredNetwork.status·==·0)·{2361 ········if·(internalConfiguredNetwork.status·==·0)·{
2397 ············this.setNetworkStatus(internalConfiguredNetwork,·2);2362 ············this.setNetworkStatus(internalConfiguredNetwork,·2);
2398 ········}2363 ········}
2399 ········this.saveToStore(false);2364 ········this.saveToStore(false);
2400 ········return·true;2365 ········return·true;
2401 ····}2366 ····}
2402 ····2367 ····
Offset 2430, 22 lines modifiedOffset 2395, 21 lines modified
2430 ········if·(internalConfiguredNetwork·!=·null·&&·scanDetailCacheForNetwork·!=·null)·{2395 ········if·(internalConfiguredNetwork·!=·null·&&·scanDetailCacheForNetwork·!=·null)·{
2431 ············final·ScanDetail·scanDetail·=·scanDetailCacheForNetwork.getScanDetail(wifiInfo.getBSSID());2396 ············final·ScanDetail·scanDetail·=·scanDetailCacheForNetwork.getScanDetail(wifiInfo.getBSSID());
2432 ············if·(scanDetail·!=·null)·{2397 ············if·(scanDetail·!=·null)·{
2433 ················final·ScanResult·scanResult·=·scanDetail.getScanResult();2398 ················final·ScanResult·scanResult·=·scanDetail.getScanResult();
2434 ················final·long·seen·=·scanResult.seen;2399 ················final·long·seen·=·scanResult.seen;
2435 ················final·int·level·=·scanResult.level;2400 ················final·int·level·=·scanResult.level;
2436 ················scanDetail.setSeen();2401 ················scanDetail.setSeen();
2437 ················final·int·rssi·=·wifiInfo.getRssi(); 
2438 ················scanResult.level·=·rssi;2402 ················scanResult.level·=·wifiInfo.getRssi();
2439 ················final·long·n·=·40000L;2403 ················final·long·n·=·40000L;
2440 ················final·long·n2·=·scanResult.seen·-·seen;2404 ················final·long·n2·=·scanResult.seen·-·seen;
2441 ················final·long·n3·=·0L;2405 ················final·long·n3·=·0L;
2442 ················if·(seen·>·n3·&&·n2·>·n3·&&·n2·<·20000L)·{2406 ················if·(seen·>·n3·&&·n2·>·n3·&&·n2·<·20000L)·{
2443 ····················final·double·n4·=·0.5·-·n2·/·n;2407 ····················final·double·n4·=·0.5·-·n2·/·n;
2444 ····················scanResult.level·=·(int)(rssi·*·(1.0·-·n4)·+·level·*·n4);2408 ····················scanResult.level·=·(int)(scanResult.level·*·(1.0·-·n4)·+·level·*·n4);
2445 ················}2409 ················}
2446 ················if·(this.mVerboseLoggingEnabled)·{2410 ················if·(this.mVerboseLoggingEnabled)·{
2447 ····················final·StringBuilder·sb·=·new·StringBuilder();2411 ····················final·StringBuilder·sb·=·new·StringBuilder();
2448 ····················sb.append("Updating·scan·detail·cache·freq=");2412 ····················sb.append("Updating·scan·detail·cache·freq=");
2449 ····················sb.append(scanResult.frequency);2413 ····················sb.append(scanResult.frequency);
2450 ····················sb.append("·BSSID=");2414 ····················sb.append("·BSSID=");
2451 ····················sb.append(scanResult.BSSID);2415 ····················sb.append(scanResult.BSSID);