Offset 55, 15 lines modifiedOffset 55, 14 lines modified
55 import·com.android.wifi.x.android.hardware.wifi.supplicant.V1_0.ISupplicant;55 import·com.android.wifi.x.android.hardware.wifi.supplicant.V1_0.ISupplicant;
56 import·com.android.wifi.x.android.hidl.manager.V1_0.IServiceManager;56 import·com.android.wifi.x.android.hidl.manager.V1_0.IServiceManager;
57 import·com.android.wifi.x.android.hardware.wifi.supplicant.V1_0.ISupplicantIface;57 import·com.android.wifi.x.android.hardware.wifi.supplicant.V1_0.ISupplicantIface;
58 import·java.util.regex.Pattern;58 import·java.util.regex.Pattern;
  
59 public·class·SupplicantP2pIfaceHal59 public·class·SupplicantP2pIfaceHal
60 {60 {
61 ····private·static·final·int·DEFAULT_GROUP_OWNER_INTENT·=·6; 
62 ····private·static·final·int·DEFAULT_OPERATING_CLASS·=·81;61 ····private·static·final·int·DEFAULT_OPERATING_CLASS·=·81;
63 ····private·static·final·int·RESULT_NOT_VALID·=·255;62 ····private·static·final·int·RESULT_NOT_VALID·=·255;
64 ····private·static·final·String·TAG·=·"SupplicantP2pIfaceHal";63 ····private·static·final·String·TAG·=·"SupplicantP2pIfaceHal";
65 ····private·static·final·Pattern·WPS_DEVICE_TYPE_PATTERN;64 ····private·static·final·Pattern·WPS_DEVICE_TYPE_PATTERN;
66 ····private·static·boolean·sVerboseLoggingEnabled·=·true;65 ····private·static·boolean·sVerboseLoggingEnabled·=·true;
67 ····private·SupplicantP2pIfaceCallback·mCallback;66 ····private·SupplicantP2pIfaceCallback·mCallback;
68 ····private·ISupplicantIface·mHidlSupplicantIface;67 ····private·ISupplicantIface·mHidlSupplicantIface;
Offset 165, 41 lines modifiedOffset 164, 44 lines modified
165 ····················for·(final·ISupplicant$IfaceInfo·supplicant$IfaceInfo·:·list)·{164 ····················for·(final·ISupplicant$IfaceInfo·supplicant$IfaceInfo·:·list)·{
166 ························if·(supplicant$IfaceInfo.type·==·1·&&·string.equals(supplicant$IfaceInfo.name))·{165 ························if·(supplicant$IfaceInfo.type·==·1·&&·string.equals(supplicant$IfaceInfo.name))·{
167 ····························try·{166 ····························try·{
168 ································final·ISupplicant·miSupplicant2·=·this.mISupplicant;167 ································final·ISupplicant·miSupplicant2·=·this.mISupplicant;
169 ································try·{168 ································try·{
170 ····································miSupplicant2.getInterface(supplicant$IfaceInfo,·(ISupplicant$getInterfaceCallback)new·-$$Lambda$SupplicantP2pIfaceHal$Rd_TkpUAjbvG4PouYvDjLjMdIJU(supplicantP2pIfaceHal$SupplicantResult));169 ····································miSupplicant2.getInterface(supplicant$IfaceInfo,·(ISupplicant$getInterfaceCallback)new·-$$Lambda$SupplicantP2pIfaceHal$Rd_TkpUAjbvG4PouYvDjLjMdIJU(supplicantP2pIfaceHal$SupplicantResult));
171 ································}170 ································}
172 ································catch·(RemoteException·ex)·{171 ································catch·(RemoteException·|·IllegalArgumentException·ex2)·{
 172 ····································final·Object·o2;
 173 ····································final·Object·o·=·o2;
173 ····································final·StringBuilder·sb·=·new·StringBuilder();174 ····································final·StringBuilder·sb·=·new·StringBuilder();
174 ····································sb.append("ISupplicant.getInterface·exception:·");175 ····································sb.append("ISupplicant.getInterface·exception:·");
175 ····································sb.append(ex);176 ····································sb.append(o);
176 ····································string·=·sb.toString();177 ····································string·=·sb.toString();
177 ····································Log.e(s,·string);178 ····································Log.e(s,·string);
178 ····································this.supplicantServiceDiedHandler();179 ····································this.supplicantServiceDiedHandler();
179 ····································return·null;180 ····································return·null;
180 ································}181 ································}
181 ····························}182 ····························}
182 ····························catch·(RemoteException·ex3)·{}183 ····························catch·(RemoteException·ex3)·{}
 184 ····························catch·(IllegalArgumentException·ex4)·{}
183 ····························break;185 ····························break;
184 ························}186 ························}
185 ····················}187 ····················}
186 ····················return·(ISupplicantIface)supplicantP2pIfaceHal$SupplicantResult.getResult();188 ····················return·(ISupplicantIface)supplicantP2pIfaceHal$SupplicantResult.getResult();
187 ················}189 ················}
188 ················catch·(RemoteException·ex2)·{190 ················catch·(RemoteException·ex)·{
189 ····················final·StringBuilder·sb2·=·new·StringBuilder();191 ····················final·StringBuilder·sb2·=·new·StringBuilder();
190 ····················sb2.append("ISupplicant.listInterfaces·exception:·");192 ····················sb2.append("ISupplicant.listInterfaces·exception:·");
191 ····················sb2.append(ex2);193 ····················sb2.append(ex);
192 ····················Log.e(s,·sb2.toString());194 ····················Log.e(s,·sb2.toString());
193 ····················return·null;195 ····················return·null;
194 ················}196 ················}
195 ············}197 ············}
196 ············catch·(RemoteException·ex4)·{}198 ············catch·(RemoteException·ex5)·{}
197 ········}199 ········}
198 ········catch·(RemoteException·ex5)·{}200 ········catch·(RemoteException·ex6)·{}
199 ····}201 ····}
200 ····202 ····
201 ····private·ISupplicantP2pNetwork·getNetwork(final·int·n)·{203 ····private·ISupplicantP2pNetwork·getNetwork(final·int·n)·{
202 ········final·Object·mLock·=·this.mLock;204 ········final·Object·mLock·=·this.mLock;
203 ········//·monitorenter(mLock)205 ········//·monitorenter(mLock)
204 ········final·String·s·=·"getNetwork";206 ········final·String·s·=·"getNetwork";
205 ········try·{207 ········try·{
Offset 855, 14 lines modifiedOffset 857, 15 lines modified
855 ········}857 ········}
856 ········finally·{858 ········finally·{
857 ········}859 ········}
858 ········//·monitorexit(mLock)860 ········//·monitorexit(mLock)
859 ····}861 ····}
860 ····862 ····
861 ····public·String·connect(final·WifiP2pConfig·wifiP2pConfig,·final·boolean·b)·{863 ····public·String·connect(final·WifiP2pConfig·wifiP2pConfig,·final·boolean·b)·{
 864 ········SupplicantP2pIfaceHal$SupplicantResult·supplicantP2pIfaceHal$SupplicantResult·=·null;
862 ········if·(wifiP2pConfig·==·null)·{865 ········if·(wifiP2pConfig·==·null)·{
863 ············return·null;866 ············return·null;
864 ········}867 ········}
865 ········final·Object·mLock·=·this.mLock;868 ········final·Object·mLock·=·this.mLock;
866 ········//·monitorenter(mLock)869 ········//·monitorenter(mLock)
867 ········final·String·s·=·"setSsidPostfix";870 ········final·String·s·=·"setSsidPostfix";
868 ········try·{871 ········try·{
Offset 899, 56 lines modifiedOffset 902, 58 lines modified
899 ························pin·=·"";902 ························pin·=·"";
900 ····················}903 ····················}
901 ····················else·{904 ····················else·{
902 ························pin·=·wifiP2pConfig.wps.pin;905 ························pin·=·wifiP2pConfig.wps.pin;
903 ····················}906 ····················}
904 ····················final·String·s3·=·pin;907 ····················final·String·s3·=·pin;
905 ····················final·boolean·b2·=·wifiP2pConfig.netId·==·-2;908 ····················final·boolean·b2·=·wifiP2pConfig.netId·==·-2;
906 ····················int·n;909 ····················Label_0550:·{
907 ····················if·(!b)·{910 ························if·(wifiP2pConfig.groupOwnerIntent·<·0·||·wifiP2pConfig.groupOwnerIntent·>·15)·{
908 ························int·groupOwnerIntent·=·wifiP2pConfig.groupOwnerIntent;911 ····························break·Label_0550;
909 ························if·(groupOwnerIntent·<·0·||·groupOwnerIntent·>·15)·{ 
910 ····························groupOwnerIntent·=·6; 
911 ························}912 ························}
912 ························n·=·groupOwnerIntent;913 ························final·StringBuilder·sb2·=·new·StringBuilder();
913 ····················}914 ························sb2.append("connect(");
914 ····················else·{915 ························sb2.append(wifiP2pConfig.deviceAddress);
915 ························n·=·0;916 ························sb2.append(")");
916 ····················}917 ························supplicantP2pIfaceHal$SupplicantResult·=·new·SupplicantP2pIfaceHal$SupplicantResult(sb2.toString());
917 ····················final·StringBuilder·sb2·=·new·StringBuilder(); 
918 ····················sb2.append("connect("); 
919 ····················sb2.append(wifiP2pConfig.deviceAddress); 
920 ····················sb2.append(")"); 
921 ····················final·SupplicantP2pIfaceHal$SupplicantResult·supplicantP2pIfaceHal$SupplicantResult·=·new·SupplicantP2pIfaceHal$SupplicantResult(sb2.toString()); 
922 ····················try·{ 
923 ························final·ISupplicantP2pIface·miSupplicantP2pIface·=·this.mISupplicantP2pIface; 
924 ························try·{918 ························try·{
925 ····························miSupplicantP2pIface.connect(macAddressToByteArray,·wpsInfoToConfigMethod,·s3,·b,·b2,·n,·(ISupplicantP2pIface$connectCallback)new·-$$Lambda$SupplicantP2pIfaceHal$0IS6UuR1u92OixJHFeIj5FDBt44(supplicantP2pIfaceHal$SupplicantResult));919 ····························final·ISupplicantP2pIface·miSupplicantP2pIface·=·this.mISupplicantP2pIface;
926 ························}920 ····························try·{
927 ························catch·(RemoteException·ex)·{921 ································final·int·groupOwnerIntent·=·wifiP2pConfig.groupOwnerIntent;
928 ····························final·String·s4·=·"SupplicantP2pIfaceHal";922 ································try·{
929 ····························final·StringBuilder·sb3·=·new·StringBuilder();923 ····································miSupplicantP2pIface.connect(macAddressToByteArray,·wpsInfoToConfigMethod,·s3,·b,·b2,·groupOwnerIntent,·(ISupplicantP2pIface$connectCallback)new·-$$Lambda$SupplicantP2pIfaceHal$0IS6UuR1u92OixJHFeIj5FDBt44(supplicantP2pIfaceHal$SupplicantResult));
930 ····························sb3.append("ISupplicantP2pIface·exception:·");924 ································}
931 ····························sb3.append(ex);925 ································catch·(RemoteException·ex)·{
932 ····························Log.e(s4,·sb3.toString());926 ····································final·String·s4·=·"SupplicantP2pIfaceHal";
933 ····························this.supplicantServiceDiedHandler();927 ····································final·StringBuilder·sb3·=·new·StringBuilder();
 928 ····································sb3.append("ISupplicantP2pIface·exception:·");
 929 ····································sb3.append(ex);
 930 ····································Log.e(s4,·sb3.toString());
 931 ····································this.supplicantServiceDiedHandler();
 932 ································}
 933 ····························}
 934 ····························catch·(RemoteException·ex2)·{
 935 ································return·(String)supplicantP2pIfaceHal$SupplicantResult.getResult();
 936 ································final·String·s5·=·"SupplicantP2pIfaceHal";
 937 ································final·StringBuilder·sb4·=·new·StringBuilder();
 938 ································sb4.append("Invalid·group·owner·intent:·");
 939 ································sb4.append(wifiP2pConfig.groupOwnerIntent);
 940 ································Log.e(s5,·sb4.toString());
 941 ································return·null;
 942 ····························}
 943 ····························finally·{
 944 ····························}
 945 ····························//·monitorexit(mLock)
934 ························}946 ························}
 947 ························catch·(RemoteException·ex3)·{}
935 ····················}948 ····················}
936 ····················catch·(RemoteException·ex3)·{} 
937 ····················return·(String)supplicantP2pIfaceHal$SupplicantResult.getResult(); 
938 ················} 
939 ················catch·(Exception·ex2)·{ 
940 ····················Log.e("SupplicantP2pIfaceHal",·"Could·not·parse·peer·mac·address.",·(Throwable)ex2); 
941 ····················return·null; 
942 ················}949 ················}
943 ················finally·{950 ················catch·(Exception·ex4)·{}
944 ················} 
945 ················//·monitorexit(mLock) 
946 ············}951 ············}
947 ············catch·(Exception·ex4)·{}952 ············catch·(Exception·ex5)·{}
948 ········}953 ········}
949 ········finally·{}954 ········finally·{}
950 ····}955 ····}
951 ····956 ····
952 ····public·boolean·enableWfd(final·boolean·b)·{957 ····public·boolean·enableWfd(final·boolean·b)·{
953 ········final·Object·mLock·=·this.mLock;958 ········final·Object·mLock·=·this.mLock;
954 ········//·monitorenter(mLock)959 ········//·monitorenter(mLock)