|
@@ -2,14 +2,670 @@ From: Wengling Chen <feiyu2817@gmail.com>
|
|
Date: Sat, 2 Nov 2019 07:57:37 +0100
|
|
Date: Sat, 2 Nov 2019 07:57:37 +0100
|
|
Subject: Remove dependency on flags, places and stats
|
|
Subject: Remove dependency on flags, places and stats
|
|
|
|
|
|
|
|
+FILE:Remove-dependency-on-flags-places-and-stats.patch
|
|
---
|
|
---
|
|
- third_party/android_deps/BUILD.gn | 31 -------------------------------
|
|
|
|
- 1 file changed, 31 deletions(-)
|
|
|
|
-
|
|
|
|
|
|
+diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
|
|
|
+index 8b54d136f8..da497804a9 100644
|
|
|
|
+--- a/chrome/android/BUILD.gn
|
|
|
|
++++ b/chrome/android/BUILD.gn
|
|
|
|
+@@ -277,8 +277,6 @@ android_library("chrome_java") {
|
|
|
|
+ ":usage_stats_proto_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_base_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_basement_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_fido_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_iid_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_tasks_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:jni_java",
|
|
|
|
+@@ -777,7 +775,6 @@ junit_binary("chrome_junit_tests") {
|
|
|
|
+ ":partner_location_descriptor_proto_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_base_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_basement_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_fido_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:base_java_test_support",
|
|
|
|
+ "//base:base_junit_test_support",
|
|
|
|
+@@ -1020,8 +1017,6 @@ android_library("chrome_test_java") {
|
|
|
|
+ ":partner_location_descriptor_proto_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_base_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_basement_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_fido_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_iid_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_tasks_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:base_java_test_support",
|
|
|
|
+diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
|
|
|
|
+index 8a18b53981..12d6af514e 100644
|
|
|
|
+--- a/chrome/android/chrome_java_sources.gni
|
|
|
|
++++ b/chrome/android/chrome_java_sources.gni
|
|
|
|
+@@ -1501,9 +1501,6 @@ chrome_java_sources = [
|
|
|
|
+ "java/src/org/chromium/chrome/browser/webapps/addtohomescreen/AddToHomescreenViewBinder.java",
|
|
|
|
+ "java/src/org/chromium/chrome/browser/webauth/AuthenticatorFactory.java",
|
|
|
|
+ "java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java",
|
|
|
|
+- "java/src/org/chromium/chrome/browser/webauth/Fido2ApiHandler.java",
|
|
|
|
+- "java/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequest.java",
|
|
|
|
+- "java/src/org/chromium/chrome/browser/webauth/Fido2Helper.java",
|
|
|
|
+ "java/src/org/chromium/chrome/browser/webauth/HandlerResponseCallback.java",
|
|
|
|
+ "java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorActivity.java",
|
|
|
|
+ "java/src/org/chromium/chrome/browser/webshare/ShareServiceImplementationFactory.java",
|
|
|
|
+diff --git a/chrome/android/features/cablev2_authenticator/BUILD.gn b/chrome/android/features/cablev2_authenticator/BUILD.gn
|
|
|
|
+index 0e69b3444f..7e4428fc22 100644
|
|
|
|
+--- a/chrome/android/features/cablev2_authenticator/BUILD.gn
|
|
|
|
++++ b/chrome/android/features/cablev2_authenticator/BUILD.gn
|
|
|
|
+@@ -18,7 +18,6 @@ android_library("java") {
|
|
|
|
+ deps = [
|
|
|
|
+ ":java_resources",
|
|
|
|
+ "$google_play_services_package:google_play_services_base_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_fido_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_tasks_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:jni_java",
|
|
|
|
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
|
|
|
|
+index 929771676e..4a970d0417 100644
|
|
|
|
+--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
|
|
|
|
++++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
|
|
|
|
+@@ -216,12 +216,8 @@ public class ExternalNavigationDelegateImpl implements ExternalNavigationDelegat
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void maybeAdjustInstantAppExtras(Intent intent, boolean isIntentToInstantApp) {
|
|
|
|
+- if (isIntentToInstantApp) {
|
|
|
|
+- intent.putExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER, true);
|
|
|
|
+- } else {
|
|
|
|
+- // Make sure this extra is not sent unless we've done the verification.
|
|
|
|
+- intent.removeExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER);
|
|
|
|
+- }
|
|
|
|
++ // Always remove this extra
|
|
|
|
++ intent.removeExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
|
|
|
|
+index 0ccde209b9..2d7f762ade 100644
|
|
|
|
+--- a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
|
|
|
|
++++ b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
|
|
|
|
+@@ -40,31 +40,9 @@ public class InstantAppsHandler {
|
|
|
|
+ // TODO(mariakhomenko): Use system once we roll to O SDK.
|
|
|
|
+ private static final int FLAG_DO_NOT_LAUNCH = 0x00000200;
|
|
|
|
+
|
|
|
|
+- // TODO(mariakhomenko): Depend directly on the constants once we roll to v8 libraries.
|
|
|
|
+- private static final String DO_NOT_LAUNCH_EXTRA =
|
|
|
|
+- "com.google.android.gms.instantapps.DO_NOT_LAUNCH_INSTANT_APP";
|
|
|
|
+-
|
|
|
|
+- protected static final String IS_REFERRER_TRUSTED_EXTRA =
|
|
|
|
+- "com.google.android.gms.instantapps.IS_REFERRER_TRUSTED";
|
|
|
|
+-
|
|
|
|
+- protected static final String IS_USER_CONFIRMED_LAUNCH_EXTRA =
|
|
|
|
+- "com.google.android.gms.instantapps.IS_USER_CONFIRMED_LAUNCH";
|
|
|
|
+-
|
|
|
|
+- protected static final String TRUSTED_REFERRER_PKG_EXTRA =
|
|
|
|
+- "com.google.android.gms.instantapps.TRUSTED_REFERRER_PKG";
|
|
|
|
+-
|
|
|
|
+ public static final String IS_GOOGLE_SEARCH_REFERRER =
|
|
|
|
+ "com.google.android.gms.instantapps.IS_GOOGLE_SEARCH_REFERRER";
|
|
|
|
+
|
|
|
|
+- private static final String BROWSER_LAUNCH_REASON =
|
|
|
|
+- "com.google.android.gms.instantapps.BROWSER_LAUNCH_REASON";
|
|
|
|
+-
|
|
|
|
+- private static final String SUPERVISOR_PKG = "com.google.android.instantapps.supervisor";
|
|
|
|
+-
|
|
|
|
+- private static final String[] SUPERVISOR_START_ACTIONS = {
|
|
|
|
+- "com.google.android.instantapps.START", "com.google.android.instantapps.nmr1.INSTALL",
|
|
|
|
+- "com.google.android.instantapps.nmr1.VIEW"};
|
|
|
|
+-
|
|
|
|
+ /** Finch experiment name. */
|
|
|
|
+ private static final String INSTANT_APPS_EXPERIMENT_NAME = "InstantApps";
|
|
|
|
+
|
|
|
|
+@@ -93,14 +71,6 @@ public class InstantAppsHandler {
|
|
|
|
+ * @return Whether the given intent is going to open an Instant App.
|
|
|
|
+ */
|
|
|
|
+ public static boolean isIntentToInstantApp(Intent intent) {
|
|
|
|
+- if (SUPERVISOR_PKG.equals(intent.getPackage())) return true;
|
|
|
|
+-
|
|
|
|
+- String intentAction = intent.getAction();
|
|
|
|
+- for (String action : SUPERVISOR_START_ACTIONS) {
|
|
|
|
+- if (action.equals(intentAction)) {
|
|
|
|
+- return true;
|
|
|
|
+- }
|
|
|
|
+- }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+@@ -135,20 +105,6 @@ public class InstantAppsHandler {
|
|
|
|
+ * @param intent The current intent.
|
|
|
|
+ */
|
|
|
|
+ private void maybeRecordFallbackStats(Intent intent) {
|
|
|
|
+- Long startTime = IntentUtils.safeGetLongExtra(intent, INSTANT_APP_START_TIME_EXTRA, 0);
|
|
|
|
+- if (startTime > 0) {
|
|
|
|
+- RecordHistogram.recordTimesHistogram("Android.InstantApps.FallbackDuration",
|
|
|
|
+- SystemClock.elapsedRealtime() - startTime);
|
|
|
|
+- intent.removeExtra(INSTANT_APP_START_TIME_EXTRA);
|
|
|
|
+- }
|
|
|
|
+- int callSource = IntentUtils.safeGetIntExtra(intent, BROWSER_LAUNCH_REASON, 0);
|
|
|
|
+- if (callSource > 0 && callSource < SOURCE_BOUNDARY) {
|
|
|
|
+- RecordHistogram.recordEnumeratedHistogram(
|
|
|
|
+- "Android.InstantApps.CallSource", callSource, SOURCE_BOUNDARY);
|
|
|
|
+- intent.removeExtra(BROWSER_LAUNCH_REASON);
|
|
|
|
+- } else if (callSource >= SOURCE_BOUNDARY) {
|
|
|
|
+- Log.e(TAG, "Unexpected call source constant for Instant Apps: " + callSource);
|
|
|
|
+- }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+@@ -183,14 +139,6 @@ public class InstantAppsHandler {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+- if (IntentUtils.safeGetBooleanExtra(intent, DO_NOT_LAUNCH_EXTRA, false)
|
|
|
|
+- || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
|
|
|
+- && (intent.getFlags() & FLAG_DO_NOT_LAUNCH) != 0)) {
|
|
|
|
+- maybeRecordFallbackStats(intent);
|
|
|
|
+- Log.i(TAG, "Not handling with Instant Apps (DO_NOT_LAUNCH_EXTRA)");
|
|
|
|
+- return false;
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+ if (IntentUtils.safeGetBooleanExtra(
|
|
|
|
+ intent, IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, false)
|
|
|
|
+ || IntentUtils.safeHasExtra(intent, ShortcutHelper.EXTRA_SOURCE)
|
|
|
|
+@@ -215,7 +163,6 @@ public class InstantAppsHandler {
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Intent callbackIntent = new Intent(intent);
|
|
|
|
+- callbackIntent.putExtra(DO_NOT_LAUNCH_EXTRA, true);
|
|
|
|
+ callbackIntent.putExtra(INSTANT_APP_START_TIME_EXTRA, startTime);
|
|
|
|
+
|
|
|
|
+ return tryLaunchingInstantApp(context, intent, isCustomTabsIntent, callbackIntent);
|
|
|
|
+@@ -318,12 +265,9 @@ public class InstantAppsHandler {
|
|
|
|
+ Intent iaIntent = data.getIntent();
|
|
|
|
+ if (data.getReferrer() != null) {
|
|
|
|
+ iaIntent.putExtra(Intent.EXTRA_REFERRER, data.getReferrer());
|
|
|
|
+- iaIntent.putExtra(IS_REFERRER_TRUSTED_EXTRA, true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Context appContext = ContextUtils.getApplicationContext();
|
|
|
|
+- iaIntent.putExtra(TRUSTED_REFERRER_PKG_EXTRA, appContext.getPackageName());
|
|
|
|
+- iaIntent.putExtra(IS_USER_CONFIRMED_LAUNCH_EXTRA, true);
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ appContext.startActivity(iaIntent);
|
|
|
|
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java
|
|
|
|
+index e4036c51ca..a694686344 100644
|
|
|
|
+--- a/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java
|
|
|
|
++++ b/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java
|
|
|
|
+@@ -102,14 +102,7 @@ public class AuthenticatorImpl extends HandlerResponseCallback implements Authen
|
|
|
|
+
|
|
|
|
+ mMakeCredentialCallback = callback;
|
|
|
|
+ Context context = ContextUtils.getApplicationContext();
|
|
|
|
+- if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME)
|
|
|
|
+- < Fido2ApiHandler.GMSCORE_MIN_VERSION) {
|
|
|
|
+- onError(AuthenticatorStatus.NOT_IMPLEMENTED);
|
|
|
|
+- return;
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- mIsOperationPending = true;
|
|
|
|
+- Fido2ApiHandler.getInstance().makeCredential(options, mRenderFrameHost, mOrigin, this);
|
|
|
|
++ onError(AuthenticatorStatus.NOT_IMPLEMENTED);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+@@ -137,14 +130,7 @@ public class AuthenticatorImpl extends HandlerResponseCallback implements Authen
|
|
|
|
+ mGetAssertionCallback = callback;
|
|
|
|
+ Context context = ContextUtils.getApplicationContext();
|
|
|
|
+
|
|
|
|
+- if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME)
|
|
|
|
+- < Fido2ApiHandler.GMSCORE_MIN_VERSION) {
|
|
|
|
+- onError(AuthenticatorStatus.NOT_IMPLEMENTED);
|
|
|
|
+- return;
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- mIsOperationPending = true;
|
|
|
|
+- Fido2ApiHandler.getInstance().getAssertion(options, mRenderFrameHost, mOrigin, this);
|
|
|
|
++ onError(AuthenticatorStatus.NOT_IMPLEMENTED);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+@@ -177,15 +163,8 @@ public class AuthenticatorImpl extends HandlerResponseCallback implements Authen
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+- if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME)
|
|
|
|
+- < Fido2ApiHandler.GMSCORE_MIN_VERSION) {
|
|
|
|
+- callback.call(false);
|
|
|
|
+- return;
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- mIsUserVerifyingPlatformAuthenticatorAvailableCallbackQueue.add(callback);
|
|
|
|
+- Fido2ApiHandler.getInstance().isUserVerifyingPlatformAuthenticatorAvailable(
|
|
|
|
+- mRenderFrameHost, this);
|
|
|
|
++ callback.call(false);
|
|
|
|
++ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm_driver/instance_id/android/BUILD.gn
|
|
|
|
+index a296a848c3..d32069e3c2 100644
|
|
|
|
+--- a/components/gcm_driver/instance_id/android/BUILD.gn
|
|
|
|
++++ b/components/gcm_driver/instance_id/android/BUILD.gn
|
|
|
|
+@@ -15,7 +15,6 @@ generate_jni("test_support_jni_headers") {
|
|
|
|
+
|
|
|
|
+ android_library("instance_id_driver_java") {
|
|
|
|
+ deps = [
|
|
|
|
+- "$google_play_services_package:google_play_services_iid_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:jni_java",
|
|
|
|
+ "//components/gcm_driver/android:gcm_driver_java",
|
|
|
|
+@@ -34,7 +33,6 @@ android_library("instance_id_driver_java") {
|
|
|
|
+ android_library("instance_id_driver_test_support_java") {
|
|
|
|
+ deps = [
|
|
|
|
+ ":instance_id_driver_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_iid_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ ]
|
|
|
|
+
|
|
|
|
+diff --git a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java
|
|
|
|
+index c945225a81..e815c2abca 100644
|
|
|
|
+--- a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java
|
|
|
|
++++ b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java
|
|
|
|
+@@ -10,8 +10,6 @@ import android.text.TextUtils;
|
|
|
|
+
|
|
|
|
+ import androidx.annotation.VisibleForTesting;
|
|
|
|
+
|
|
|
|
+-import com.google.android.gms.iid.InstanceID;
|
|
|
|
+-
|
|
|
|
+ import org.chromium.base.ContextUtils;
|
|
|
|
+
|
|
|
|
+ import java.io.IOException;
|
|
|
|
+@@ -26,8 +24,6 @@ public class InstanceIDWithSubtype {
|
|
|
|
+ // Must match the private InstanceID.OPTION_SUBTYPE, which is guaranteed to not change.
|
|
|
|
+ private static final String OPTION_SUBTYPE = "subtype";
|
|
|
|
+
|
|
|
|
+- private final InstanceID mInstanceID;
|
|
|
|
+-
|
|
|
|
+ /**
|
|
|
|
+ * Cached instances. May be accessed from multiple threads; synchronize on sSubtypeInstancesLock
|
|
|
|
+ */
|
|
|
|
+@@ -39,10 +35,6 @@ public class InstanceIDWithSubtype {
|
|
|
|
+ @VisibleForTesting
|
|
|
|
+ protected static FakeFactory sFakeFactoryForTesting;
|
|
|
|
+
|
|
|
|
+- protected InstanceIDWithSubtype(InstanceID instanceID) {
|
|
|
|
+- mInstanceID = instanceID;
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+ /**
|
|
|
|
+ * Returns an instance of this class. Unlike {@link InstanceID#getInstance(Context)}, it is not
|
|
|
|
+ * a singleton, but instead a different instance will be returned for each {@code subtype}.
|
|
|
|
+@@ -58,11 +50,6 @@ public class InstanceIDWithSubtype {
|
|
|
|
+ if (sFakeFactoryForTesting != null) {
|
|
|
|
+ existing = sFakeFactoryForTesting.create(subtype);
|
|
|
|
+ } else {
|
|
|
|
+- Bundle options = new Bundle();
|
|
|
|
+- options.putCharSequence(OPTION_SUBTYPE, subtype);
|
|
|
|
+- InstanceID instanceID =
|
|
|
|
+- InstanceID.getInstance(ContextUtils.getApplicationContext(), options);
|
|
|
|
+- existing = new InstanceIDWithSubtype(instanceID);
|
|
|
|
+ }
|
|
|
|
+ sSubtypeInstances.put(subtype, existing);
|
|
|
|
+ }
|
|
|
|
+@@ -71,30 +58,30 @@ public class InstanceIDWithSubtype {
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getSubtype() {
|
|
|
|
+- return mInstanceID.getSubtype();
|
|
|
|
++ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getId() {
|
|
|
|
+- return mInstanceID.getId();
|
|
|
|
++ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public long getCreationTime() {
|
|
|
|
+- return mInstanceID.getCreationTime();
|
|
|
|
++ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void deleteInstanceID() throws IOException {
|
|
|
|
+- synchronized (sSubtypeInstancesLock) {
|
|
|
|
+- sSubtypeInstances.remove(mInstanceID.getSubtype());
|
|
|
|
+- mInstanceID.deleteInstanceID();
|
|
|
|
+- }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void deleteToken(String authorizedEntity, String scope) throws IOException {
|
|
|
|
+- mInstanceID.deleteToken(authorizedEntity, scope);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getToken(String authorizedEntity, String scope) throws IOException {
|
|
|
|
+- return mInstanceID.getToken(authorizedEntity, scope);
|
|
|
|
++ return "";
|
|
|
|
++ }
|
|
|
|
++
|
|
|
|
++ public String getToken(String authorizedEntity, String scope, Bundle extras)
|
|
|
|
++ throws IOException {
|
|
|
|
++ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** Fake subclasses can set {@link #sFakeFactoryForTesting} to an implementation of this. */
|
|
|
|
+diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
|
|
|
+index 6e64633486..fe32d7cfbc 100644
|
|
|
|
+--- a/content/public/common/content_features.cc
|
|
|
|
++++ b/content/public/common/content_features.cc
|
|
|
|
+@@ -786,7 +786,7 @@ const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
|
|
|
|
+ // Controls whether the WebAuthentication API is enabled:
|
|
|
|
+ // https://w3c.github.io/webauthn
|
|
|
|
+ const base::Feature kWebAuth{"WebAuthentication",
|
|
|
|
+- base::FEATURE_ENABLED_BY_DEFAULT};
|
|
|
|
++ base::FEATURE_DISABLED_BY_DEFAULT};
|
|
|
|
+
|
|
|
|
+ // Controls whether CTAP2 devices can communicate via the WebAuthentication API
|
|
|
|
+ // using pairingless BLE protocol.
|
|
|
|
+diff --git a/device/BUILD.gn b/device/BUILD.gn
|
|
|
|
+index f76417ee6b..ca8f645534 100644
|
|
|
|
+--- a/device/BUILD.gn
|
|
|
|
++++ b/device/BUILD.gn
|
|
|
|
+@@ -424,7 +424,6 @@ if (is_android) {
|
|
|
|
+ deps = [
|
|
|
|
+ "$google_play_services_package:google_play_services_base_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_basement_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_location_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:base_java_test_support",
|
|
|
|
+ "//base:base_junit_test_support",
|
|
|
|
+diff --git a/services/BUILD.gn b/services/BUILD.gn
|
|
|
|
+index b8513e615b..2a91fb1476 100644
|
|
|
|
+--- a/services/BUILD.gn
|
|
|
|
++++ b/services/BUILD.gn
|
|
|
|
+@@ -104,9 +104,6 @@ if (is_android) {
|
|
|
|
+ "shape_detection/android/junit/src/org/chromium/shape_detection/BitmapUtilsTest.java",
|
|
|
|
+ ]
|
|
|
|
+ deps = [
|
|
|
|
+- "$google_play_services_package:google_play_services_base_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_basement_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_location_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:base_java_test_support",
|
|
|
|
+ "//base:base_junit_test_support",
|
|
|
|
+diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn
|
|
|
|
+index 9962b70c85..fd51d9562a 100644
|
|
|
|
+--- a/services/device/geolocation/BUILD.gn
|
|
|
|
++++ b/services/device/geolocation/BUILD.gn
|
|
|
|
+@@ -158,7 +158,6 @@ if (is_android) {
|
|
|
|
+ ":geolocation_jni_headers",
|
|
|
|
+ "$google_play_services_package:google_play_services_base_java",
|
|
|
|
+ "$google_play_services_package:google_play_services_basement_java",
|
|
|
|
+- "$google_play_services_package:google_play_services_location_java",
|
|
|
|
+ "//base:base_java",
|
|
|
|
+ "//base:jni_java",
|
|
|
|
+ "//components/location/android:location_java",
|
|
|
|
+diff --git a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java
|
|
|
|
+index 545cb6a292..8557f5f473 100644
|
|
|
|
+--- a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java
|
|
|
|
++++ b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java
|
|
|
|
+@@ -8,132 +8,40 @@ import android.content.Context;
|
|
|
|
+ import android.location.Location;
|
|
|
|
+ import android.os.Bundle;
|
|
|
|
+
|
|
|
|
+-import com.google.android.gms.common.ConnectionResult;
|
|
|
|
+-import com.google.android.gms.common.api.GoogleApiClient;
|
|
|
|
+-import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
|
|
|
|
+-import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
|
|
|
|
+-import com.google.android.gms.location.FusedLocationProviderApi;
|
|
|
|
+-import com.google.android.gms.location.LocationListener;
|
|
|
|
+-import com.google.android.gms.location.LocationRequest;
|
|
|
|
+-import com.google.android.gms.location.LocationServices;
|
|
|
|
+-
|
|
|
|
+ import org.chromium.base.Log;
|
|
|
|
+ import org.chromium.base.ThreadUtils;
|
|
|
|
+ import org.chromium.components.location.LocationUtils;
|
|
|
|
+-import org.chromium.gms.ChromiumPlayServicesAvailability;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * This is a LocationProvider using Google Play Services.
|
|
|
|
+ *
|
|
|
|
+ * https://developers.google.com/android/reference/com/google/android/gms/location/package-summary
|
|
|
|
+ */
|
|
|
|
+-public class LocationProviderGmsCore implements ConnectionCallbacks, OnConnectionFailedListener,
|
|
|
|
+- LocationListener, LocationProvider {
|
|
|
|
++public class LocationProviderGmsCore implements LocationProvider {
|
|
|
|
+ private static final String TAG = "LocationProvider";
|
|
|
|
+
|
|
|
|
+ // Values for the LocationRequest's setInterval for normal and high accuracy, respectively.
|
|
|
|
+ private static final long UPDATE_INTERVAL_MS = 1000;
|
|
|
|
+ private static final long UPDATE_INTERVAL_FAST_MS = 500;
|
|
|
|
+
|
|
|
|
+- private final GoogleApiClient mGoogleApiClient;
|
|
|
|
+- private FusedLocationProviderApi mLocationProviderApi = LocationServices.FusedLocationApi;
|
|
|
|
+-
|
|
|
|
+- private boolean mEnablehighAccuracy;
|
|
|
|
+- private LocationRequest mLocationRequest;
|
|
|
|
+-
|
|
|
|
+ public static boolean isGooglePlayServicesAvailable(Context context) {
|
|
|
|
+- return ChromiumPlayServicesAvailability.isGooglePlayServicesAvailable(context);
|
|
|
|
++ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ LocationProviderGmsCore(Context context) {
|
|
|
|
+ Log.i(TAG, "Google Play Services");
|
|
|
|
+- mGoogleApiClient = new GoogleApiClient.Builder(context)
|
|
|
|
+- .addApi(LocationServices.API)
|
|
|
|
+- .addConnectionCallbacks(this)
|
|
|
|
+- .addOnConnectionFailedListener(this)
|
|
|
|
+- .build();
|
|
|
|
+- assert mGoogleApiClient != null;
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- LocationProviderGmsCore(GoogleApiClient client, FusedLocationProviderApi locationApi) {
|
|
|
|
+- mGoogleApiClient = client;
|
|
|
|
+- mLocationProviderApi = locationApi;
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- // ConnectionCallbacks implementation
|
|
|
|
+- @Override
|
|
|
|
+- public void onConnected(Bundle connectionHint) {
|
|
|
|
+- ThreadUtils.assertOnUiThread();
|
|
|
|
+-
|
|
|
|
+- mLocationRequest = LocationRequest.create();
|
|
|
|
+- if (mEnablehighAccuracy) {
|
|
|
|
+- // With enableHighAccuracy, request a faster update interval and configure the provider
|
|
|
|
+- // for high accuracy mode.
|
|
|
|
+- mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
|
|
|
|
+- .setInterval(UPDATE_INTERVAL_FAST_MS);
|
|
|
|
+- } else {
|
|
|
|
+- // Use balanced mode by default. In this mode, the API will prefer the network provider
|
|
|
|
+- // but may use sensor data (for instance, GPS) if high accuracy is requested by another
|
|
|
|
+- // app.
|
|
|
|
+- //
|
|
|
|
+- // If location is configured for sensors-only then elevate the priority to ensure GPS
|
|
|
|
+- // and other sensors are used.
|
|
|
|
+- if (LocationUtils.getInstance().isSystemLocationSettingSensorsOnly()) {
|
|
|
|
+- mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
|
|
|
+- } else {
|
|
|
|
+- mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
|
|
|
|
+- }
|
|
|
|
+- mLocationRequest.setInterval(UPDATE_INTERVAL_MS);
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- final Location location = mLocationProviderApi.getLastLocation(mGoogleApiClient);
|
|
|
|
+- if (location != null) {
|
|
|
|
+- LocationProviderAdapter.onNewLocationAvailable(location);
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- try {
|
|
|
|
+- // Request updates on UI Thread replicating LocationProviderAndroid's behaviour.
|
|
|
|
+- mLocationProviderApi.requestLocationUpdates(
|
|
|
|
+- mGoogleApiClient, mLocationRequest, this, ThreadUtils.getUiThreadLooper());
|
|
|
|
+- } catch (IllegalStateException | SecurityException e) {
|
|
|
|
+- // IllegalStateException is thrown "If this method is executed in a thread that has not
|
|
|
|
+- // called Looper.prepare()". SecurityException is thrown if there is no permission, see
|
|
|
|
+- // https://crbug.com/731271.
|
|
|
|
+- Log.e(TAG, " mLocationProviderApi.requestLocationUpdates() " + e);
|
|
|
|
+- LocationProviderAdapter.newErrorAvailable(
|
|
|
|
+- "Failed to request location updates: " + e.toString());
|
|
|
|
+- assert false;
|
|
|
|
+- }
|
|
|
|
+- }
|
|
|
|
+-
|
|
|
|
+- @Override
|
|
|
|
+- public void onConnectionSuspended(int cause) {}
|
|
|
|
+-
|
|
|
|
+- // OnConnectionFailedListener implementation
|
|
|
|
+- @Override
|
|
|
|
+- public void onConnectionFailed(ConnectionResult result) {
|
|
|
|
+- LocationProviderAdapter.newErrorAvailable(
|
|
|
|
+- "Failed to connect to Google Play Services: " + result.toString());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // LocationProvider implementation
|
|
|
|
+ @Override
|
|
|
|
+ public void start(boolean enableHighAccuracy) {
|
|
|
|
+ ThreadUtils.assertOnUiThread();
|
|
|
|
+- if (mGoogleApiClient.isConnected()) mGoogleApiClient.disconnect();
|
|
|
|
+-
|
|
|
|
+ mEnablehighAccuracy = enableHighAccuracy;
|
|
|
|
+- mGoogleApiClient.connect(); // Should return via onConnected().
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void stop() {
|
|
|
|
+ ThreadUtils.assertOnUiThread();
|
|
|
|
+- if (!mGoogleApiClient.isConnected()) return;
|
|
|
|
+-
|
|
|
|
+- mLocationProviderApi.removeLocationUpdates(mGoogleApiClient, this);
|
|
|
|
+-
|
|
|
|
+- mGoogleApiClient.disconnect();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+@@ -142,10 +50,4 @@ public class LocationProviderGmsCore implements ConnectionCallbacks, OnConnectio
|
|
|
|
+ if (mGoogleApiClient == null) return false;
|
|
|
|
+ return mGoogleApiClient.isConnecting() || mGoogleApiClient.isConnected();
|
|
|
|
+ }
|
|
|
|
+-
|
|
|
|
+- // LocationListener implementation
|
|
|
|
+- @Override
|
|
|
|
+- public void onLocationChanged(Location location) {
|
|
|
|
+- LocationProviderAdapter.onNewLocationAvailable(location);
|
|
|
|
+- }
|
|
|
|
+ }
|
|
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
|
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
|
|
|
|
+index b3f41fed1c..329ef90d82 100644
|
|
--- a/third_party/android_deps/BUILD.gn
|
|
--- a/third_party/android_deps/BUILD.gn
|
|
+++ b/third_party/android_deps/BUILD.gn
|
|
+++ b/third_party/android_deps/BUILD.gn
|
|
-@@ -2236,37 +2236,6 @@ java_prebuilt("com_github_kevinstern_software_and_algorithms_java") {
|
|
|
|
|
|
+@@ -62,7 +62,6 @@ java_group("robolectric_all_java") {
|
|
|
|
+ ":org_robolectric_shadowapi_java",
|
|
|
|
+ ":org_robolectric_shadows_framework_java",
|
|
|
|
+ ":org_robolectric_shadows_multidex_java",
|
|
|
|
+- ":org_robolectric_shadows_playservices_java",
|
|
|
|
+ ":org_robolectric_utils_java",
|
|
|
|
+ ":org_robolectric_utils_reflector_java",
|
|
|
|
+ "//third_party/robolectric:android-all-10-robolectric-5803371_java",
|
|
|
|
+@@ -1191,84 +1190,6 @@ android_aar_prebuilt("google_play_services_basement_java") {
|
|
|
|
+ "//build/android/bytecode:fragment_activity_replacer"
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+-android_aar_prebuilt("google_play_services_fido_java") {
|
|
|
|
+- aar_path = "libs/com_google_android_gms_play_services_fido/play-services-fido-18.1.0.aar"
|
|
|
|
+- info_path = "libs/com_google_android_gms_play_services_fido/com_google_android_gms_play_services_fido.info"
|
|
|
|
+- deps = [
|
|
|
|
+- ":google_play_services_base_java",
|
|
|
|
+- ":google_play_services_basement_java",
|
|
|
|
+- ":google_play_services_tasks_java",
|
|
|
|
+- ]
|
|
|
|
+-
|
|
|
|
+- # Removing drawables from GMS .aars as they are unused bloat.
|
|
|
|
+- strip_drawables = true
|
|
|
|
+-}
|
|
|
|
+-
|
|
|
|
+-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+-android_aar_prebuilt("google_play_services_gcm_java") {
|
|
|
|
+- aar_path = "libs/com_google_android_gms_play_services_gcm/play-services-gcm-17.0.0.aar"
|
|
|
|
+- info_path = "libs/com_google_android_gms_play_services_gcm/com_google_android_gms_play_services_gcm.info"
|
|
|
|
+- deps = [
|
|
|
|
+- ":androidx_collection_collection_java",
|
|
|
|
+- ":androidx_core_core_java",
|
|
|
|
+- ":androidx_legacy_legacy_support_core_utils_java",
|
|
|
|
+- ":google_play_services_base_java",
|
|
|
|
+- ":google_play_services_basement_java",
|
|
|
|
+- ":google_play_services_iid_java",
|
|
|
|
+- ":google_play_services_stats_java",
|
|
|
|
+- ]
|
|
|
|
+-
|
|
|
|
+- # Removing drawables from GMS .aars as they are unused bloat.
|
|
|
|
+- strip_drawables = true
|
|
|
|
+-}
|
|
|
|
+-
|
|
|
|
+-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+-android_aar_prebuilt("google_play_services_iid_java") {
|
|
|
|
+- aar_path = "libs/com_google_android_gms_play_services_iid/play-services-iid-17.0.0.aar"
|
|
|
|
+- info_path = "libs/com_google_android_gms_play_services_iid/com_google_android_gms_play_services_iid.info"
|
|
|
|
+- deps = [
|
|
|
|
+- ":androidx_collection_collection_java",
|
|
|
|
+- ":androidx_core_core_java",
|
|
|
|
+- ":google_play_services_base_java",
|
|
|
|
+- ":google_play_services_basement_java",
|
|
|
|
+- ":google_play_services_stats_java",
|
|
|
|
+- ":google_play_services_tasks_java",
|
|
|
|
+- ]
|
|
|
|
+-
|
|
|
|
+- # Removing drawables from GMS .aars as they are unused bloat.
|
|
|
|
+- strip_drawables = true
|
|
|
|
+-}
|
|
|
|
+-
|
|
|
|
+-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+-android_aar_prebuilt("google_play_services_instantapps_java") {
|
|
|
|
+- aar_path = "libs/com_google_android_gms_play_services_instantapps/play-services-instantapps-17.0.0.aar"
|
|
|
|
+- info_path = "libs/com_google_android_gms_play_services_instantapps/com_google_android_gms_play_services_instantapps.info"
|
|
|
|
+- deps = [
|
|
|
|
+- ":google_play_services_base_java",
|
|
|
|
+- ":google_play_services_basement_java",
|
|
|
|
+- ":google_play_services_tasks_java",
|
|
|
|
+- ]
|
|
|
|
+-
|
|
|
|
+- # Removing drawables from GMS .aars as they are unused bloat.
|
|
|
|
+- strip_drawables = true
|
|
|
|
+-}
|
|
|
|
+-
|
|
|
|
+-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+-android_aar_prebuilt("google_play_services_location_java") {
|
|
|
|
+- aar_path = "libs/com_google_android_gms_play_services_location/play-services-location-17.0.0.aar"
|
|
|
|
+- info_path = "libs/com_google_android_gms_play_services_location/com_google_android_gms_play_services_location.info"
|
|
|
|
+- deps = [
|
|
|
|
+- ":google_play_services_base_java",
|
|
|
|
+- ":google_play_services_basement_java",
|
|
|
|
+- ":google_play_services_places_placereport_java",
|
|
|
|
+- ":google_play_services_tasks_java",
|
|
|
|
+- ]
|
|
|
|
+-
|
|
|
|
+- # Removing drawables from GMS .aars as they are unused bloat.
|
|
|
|
+- strip_drawables = true
|
|
|
|
+-}
|
|
|
|
+-
|
|
|
|
+ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+ android_aar_prebuilt("google_play_services_tasks_java") {
|
|
|
|
+ aar_path = "libs/com_google_android_gms_play_services_tasks/play-services-tasks-17.0.0.aar"
|
|
|
|
+@@ -1690,20 +1611,6 @@ java_prebuilt("org_robolectric_shadows_multidex_java") {
|
|
|
|
+ bypass_platform_checks = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+-java_prebuilt("org_robolectric_shadows_playservices_java") {
|
|
|
|
+- jar_path =
|
|
|
|
+- "libs/org_robolectric_shadows_playservices/shadows-playservices-4.3.1.jar"
|
|
|
|
+- output_name = "org_robolectric_shadows_playservices"
|
|
|
|
+- enable_bytecode_checks = false
|
|
|
|
+- testonly = true
|
|
|
|
+- deps = [
|
|
|
|
+- ":com_google_guava_guava_java",
|
|
|
|
+- ":org_robolectric_annotations_java",
|
|
|
|
+- ]
|
|
|
|
+- bypass_platform_checks = true
|
|
|
|
+-}
|
|
|
|
+-
|
|
|
|
+ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
|
|
+ java_prebuilt("org_robolectric_utils_java") {
|
|
|
|
+ jar_path = "libs/org_robolectric_utils/utils-4.3.1.jar"
|
|
|
|
+@@ -2236,37 +2143,6 @@ java_prebuilt("com_github_kevinstern_software_and_algorithms_java") {
|
|
visibility = [ ":*" ]
|
|
visibility = [ ":*" ]
|
|
}
|
|
}
|
|
|
|
|
|
@@ -47,6 +703,3 @@ diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.
|
|
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
|
|
java_prebuilt("com_google_auto_auto_common_java") {
|
|
java_prebuilt("com_google_auto_auto_common_java") {
|
|
jar_path = "libs/com_google_auto_auto_common/auto-common-0.10.jar"
|
|
jar_path = "libs/com_google_auto_auto_common/auto-common-0.10.jar"
|
|
---
|
|
|
|
-2.17.1
|
|
|
|
-
|
|
|