@@ -160,47 +160,6 @@ public BraveShieldsHandler(Context context) {
160
160
}
161
161
}
162
162
163
- public void loadDisconnectEntityList (Context context ) {
164
- if (context == null ) return ;
165
- PostTask .postTask (TaskTraits .BEST_EFFORT , () -> {
166
- try {
167
- String jsonString = loadDisconnectEntityJSONFromAsset (context );
168
- if (jsonString == null ) return ;
169
- JSONObject obj = new JSONObject (jsonString );
170
- JSONObject entities = obj .getJSONObject ("entities" );
171
- Iterator <String > keysItr = entities .keys ();
172
- while (keysItr .hasNext ()) {
173
- String key = keysItr .next ();
174
- Object value = entities .get (key );
175
- JSONArray jsonProperties = ((JSONObject ) value ).getJSONArray ("properties" );
176
- JSONArray jsonResources = ((JSONObject ) value ).getJSONArray ("resources" );
177
-
178
- for (int i = 0 ; i < jsonResources .length (); i ++) {
179
- mResourceToCompanyNameList .add (new Pair (jsonResources .getString (i ), key ));
180
- }
181
- }
182
- isDisconnectEntityLoaded = true ;
183
- } catch (JSONException exception ) {
184
- exception .printStackTrace ();
185
- }
186
- });
187
- }
188
-
189
- private String loadDisconnectEntityJSONFromAsset (Context context ) {
190
- if (context == null ) return null ;
191
- String json = null ;
192
- try (InputStream inputStream = context .getAssets ().open ("disconnect_entitylist.json" )) {
193
- int size = inputStream .available ();
194
- byte [] buffer = new byte [size ];
195
- inputStream .read (buffer );
196
- json = new String (buffer , "UTF-8" );
197
- } catch (IOException ex ) {
198
- ex .printStackTrace ();
199
- return null ;
200
- }
201
- return json ;
202
- }
203
-
204
163
public void addStat (int tabId , String blockType , String subResource ) {
205
164
if (!mTabsStat .containsKey (tabId )) {
206
165
mTabsStat .put (tabId , new BlockersInfo ());
0 commit comments