Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 15a9171

Browse files
Raphael Kubo da CostaMrunal Kapade
authored andcommitted
[Android] Stop using org.apache.http classes in AccessibilityInjector.
As part of the efforts to stop depending on external packages in the code, replace usage of org.apache.http classes with an implementation that only uses apache.net.Uri. This allows us to drop the dependency on the legacy_http_client target and end up having to bundle org.apache.http.legacy.jar into xwalk_core_library.jar. Not upstreamable, as the code in question was removed upstream when they dropped support for ICS. BUG=XWALK-5092
1 parent b6447eb commit 15a9171

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

content/content.gyp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@
600600
'dependencies': [
601601
'java_set_jni_headers',
602602
'motionevent_jni_headers',
603-
'../third_party/android_tools/android_tools.gyp:legacy_http_javalib',
604603
],
605604
'includes': [ 'content_jni.gypi' ],
606605
},

content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityInjector.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.accessibilityservice.AccessibilityServiceInfo;
88
import android.content.Context;
99
import android.content.pm.PackageManager;
10+
import android.net.Uri;
1011
import android.os.Build;
1112
import android.os.Bundle;
1213
import android.os.Vibrator;
@@ -15,17 +16,13 @@
1516
import android.view.accessibility.AccessibilityManager;
1617
import android.view.accessibility.AccessibilityNodeInfo;
1718

18-
import org.apache.http.NameValuePair;
19-
import org.apache.http.client.utils.URLEncodedUtils;
2019
import org.chromium.base.CommandLine;
2120
import org.chromium.content.browser.ContentViewCore;
2221
import org.chromium.content.browser.JavascriptInterface;
2322
import org.chromium.content.common.ContentSwitches;
2423
import org.json.JSONException;
2524
import org.json.JSONObject;
2625

27-
import java.net.URI;
28-
import java.net.URISyntaxException;
2926
import java.util.HashMap;
3027
import java.util.Iterator;
3128
import java.util.List;
@@ -305,16 +302,11 @@ private int getAxsUrlParameterValue() {
305302
}
306303

307304
try {
308-
List<NameValuePair> params = URLEncodedUtils.parse(
309-
new URI(mContentViewCore.getWebContents().getUrl()), null);
310-
311-
for (NameValuePair param : params) {
312-
if ("axs".equals(param.getName())) {
313-
return Integer.parseInt(param.getValue());
314-
}
305+
Uri uri = Uri.parse(mContentViewCore.getWebContents().getUrl());
306+
String axs = uri.getQueryParameter("axs");
307+
if (axs != null) {
308+
return Integer.parseInt(axs);
315309
}
316-
} catch (URISyntaxException ex) {
317-
// Intentional no-op.
318310
} catch (NumberFormatException ex) {
319311
// Intentional no-op.
320312
} catch (IllegalArgumentException ex) {

0 commit comments

Comments
 (0)