Commit c79aa68c authored by Patrick Noland's avatar Patrick Noland Committed by Commit Bot

Revert "Modularize Omaha on Android: modularized identity/ from //chrome/android"

This reverts commit f218ef61.

Reason for revert: Breaking downstream build. Feel free to reland once you have downstream fix ready to go, but I don't think we can let downstream be broken until then

Original change's description:
> Modularize Omaha on Android: modularized identity/ from //chrome/android
>
> New location: //chrome/browser/uid; this is a dependency of Omaha on Android.
>
> Bug: 1131415
> Change-Id: Id65534f432adb733c9b1224f8fc770f30cbf00df
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426045
> Commit-Queue: Andrey Zaytsev <andzaytsev@google.com>
> Auto-Submit: Andrey Zaytsev <andzaytsev@google.com>
> Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
> Reviewed-by: Boris Sazonov <bsazonov@chromium.org>
> Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
> Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
> Reviewed-by: Natalie Chouinard <chouinard@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#811874}

TBR=nyquist@chromium.org,msarda@chromium.org,waffles@chromium.org,bsazonov@chromium.org,chouinard@chromium.org,andzaytsev@google.com

Change-Id: I729d7bc353cf44d2f6e32e7a764726c82b6dd83a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1131415
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439026Reviewed-by: default avatarPatrick Noland <pnoland@chromium.org>
Commit-Queue: Patrick Noland <pnoland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811880}
parent 0de44fa5
......@@ -348,7 +348,6 @@ android_library("chrome_java") {
"//chrome/browser/ui/android/favicon:java",
"//chrome/browser/ui/android/native_page:java",
"//chrome/browser/ui/messages/android:java",
"//chrome/browser/uid/android:java",
"//chrome/browser/user_education:java",
"//chrome/browser/util:java",
"//chrome/browser/video_tutorials:factory_java",
......@@ -1044,8 +1043,6 @@ android_library("chrome_test_java") {
"//chrome/browser/ui/android/favicon:java",
"//chrome/browser/ui/android/native_page:java",
"//chrome/browser/ui/messages/android:java",
"//chrome/browser/uid/android:java",
"//chrome/browser/uid/android:javatests",
"//chrome/browser/util:java",
"//chrome/test:sync_integration_test_support_java",
"//chrome/test/android:chrome_java_test_pagecontroller",
......
......@@ -22,7 +22,6 @@ include_rules = [
"+chrome/browser/ui/android/favicon/java",
"+chrome/browser/ui/android/native_page",
"+chrome/browser/ui/messages/android",
"+chrome/browser/uid/android",
"+chrome/browser/util/android/java",
"+chrome/browser/webauthn/android",
"+components/browser_ui/android/bottomsheet",
......
......@@ -798,6 +798,10 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/homepage/settings/HomepageMetricsEnums.java",
"java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java",
"java/src/org/chromium/chrome/browser/homepage/settings/RadioButtonGroupHomepagePreference.java",
"java/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGenerator.java",
"java/src/org/chromium/chrome/browser/identity/UniqueIdentificationGenerator.java",
"java/src/org/chromium/chrome/browser/identity/UniqueIdentificationGeneratorFactory.java",
"java/src/org/chromium/chrome/browser/identity/UuidBasedUniqueIdentificationGenerator.java",
"java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java",
"java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationManager.java",
"java/src/org/chromium/chrome/browser/incognito/IncognitoNotificationPresenceController.java",
......
......@@ -223,6 +223,9 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/homepage/HomepageTestRule.java",
"javatests/src/org/chromium/chrome/browser/homepage/settings/HomepageSettingsFragmentTest.java",
"javatests/src/org/chromium/chrome/browser/homepage/settings/HomepageSettingsFragmentWithEditorTest.java",
"javatests/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGeneratorTest.java",
"javatests/src/org/chromium/chrome/browser/identity/UniqueIdentificationGeneratorFactoryTest.java",
"javatests/src/org/chromium/chrome/browser/identity/UuidBasedUniqueIdentificationGeneratorTest.java",
"javatests/src/org/chromium/chrome/browser/identity_disc/IdentityDiscControllerTest.java",
"javatests/src/org/chromium/chrome/browser/incognito/IncognitoCookieLeakageTest.java",
"javatests/src/org/chromium/chrome/browser/incognito/IncognitoDataTestUtils.java",
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.uid;
package org.chromium.chrome.browser.identity;
import android.annotation.SuppressLint;
import android.content.Context;
......@@ -35,7 +35,8 @@ public class SettingsSecureBasedIdentificationGenerator implements UniqueIdentif
return "";
}
String md5Hash = HashUtil.getMd5Hash(new HashUtil.Params(androidId).withSalt(salt));
String md5Hash = HashUtil.getMd5Hash(
new HashUtil.Params(androidId).withSalt(salt));
return md5Hash == null ? "" : md5Hash;
}
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.uid;
package org.chromium.chrome.browser.identity;
import androidx.annotation.Nullable;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.uid;
package org.chromium.chrome.browser.identity;
import androidx.annotation.VisibleForTesting;
......@@ -21,7 +21,8 @@ public final class UniqueIdentificationGeneratorFactory {
private static final Map<String, UniqueIdentificationGenerator> GENERATOR_MAP =
new HashMap<String, UniqueIdentificationGenerator>();
private UniqueIdentificationGeneratorFactory() {}
private UniqueIdentificationGeneratorFactory() {
}
/**
* Returns a UniqueIdentificationGenerator if it exists, else throws IllegalArgumentException.
......@@ -48,8 +49,8 @@ public final class UniqueIdentificationGeneratorFactory {
* @param force if set to true, will override any existing generator for this type. Else
* discards calls where a generator exists.
*/
public static void registerGenerator(
String generatorType, UniqueIdentificationGenerator gen, boolean force) {
public static void registerGenerator(String generatorType, UniqueIdentificationGenerator gen,
boolean force) {
synchronized (LOCK) {
if (GENERATOR_MAP.containsKey(generatorType) && !force) {
return;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.uid;
package org.chromium.chrome.browser.identity;
import android.content.Context;
......@@ -40,6 +40,7 @@ public class UuidBasedUniqueIdentificationGenerator implements UniqueIdentificat
// Store the field so we ensure we always return the same unique ID.
preferences.writeString(mPreferenceKey, uniqueId);
return uniqueId;
}
@VisibleForTesting
......
......@@ -51,6 +51,8 @@ import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.history.HistoryDeletionBridge;
import org.chromium.chrome.browser.homepage.HomepageManager;
import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator;
import org.chromium.chrome.browser.incognito.IncognitoTabLauncher;
import org.chromium.chrome.browser.locale.LocaleManager;
import org.chromium.chrome.browser.media.MediaCaptureNotificationService;
......@@ -73,8 +75,6 @@ import org.chromium.chrome.browser.share.clipboard.ClipboardImageFileProvider;
import org.chromium.chrome.browser.sharing.shared_clipboard.SharedClipboardShareActivity;
import org.chromium.chrome.browser.signin.SigninHelper;
import org.chromium.chrome.browser.sync.SyncController;
import org.chromium.chrome.browser.uid.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.uid.UuidBasedUniqueIdentificationGenerator;
import org.chromium.chrome.browser.webapps.WebApkVersionManager;
import org.chromium.chrome.browser.webapps.WebappRegistry;
import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory;
......
......@@ -14,8 +14,8 @@ import androidx.annotation.VisibleForTesting;
import org.xmlpull.v1.XmlSerializer;
import org.chromium.base.BuildInfo;
import org.chromium.chrome.browser.uid.SettingsSecureBasedIdentificationGenerator;
import org.chromium.chrome.browser.uid.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.identity.SettingsSecureBasedIdentificationGenerator;
import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory;
import org.chromium.ui.base.DeviceFormFactor;
import java.io.IOException;
......
......@@ -10,8 +10,8 @@ import org.chromium.base.Callback;
import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.chrome.browser.identity.SettingsSecureBasedIdentificationGenerator;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.uid.SettingsSecureBasedIdentificationGenerator;
import java.util.List;
import java.util.Locale;
......
......@@ -12,11 +12,11 @@ import androidx.annotation.VisibleForTesting;
import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.identity.UniqueIdentificationGenerator;
import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.signin.IdentityServicesProvider;
import org.chromium.chrome.browser.signin.SigninManager;
import org.chromium.chrome.browser.uid.UniqueIdentificationGenerator;
import org.chromium.chrome.browser.uid.UniqueIdentificationGeneratorFactory;
import org.chromium.components.sync.ModelType;
import org.chromium.components.sync.PassphraseType;
import org.chromium.components.sync.StopSource;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.uid;
package org.chromium.chrome.browser.identity;
import androidx.test.filters.SmallTest;
......@@ -15,7 +15,6 @@ import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.util.HashUtil;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
/** Unit tests for {@link SettingsSecureBasedIdentificationGenerator}. */
@RunWith(ChromeJUnit4ClassRunner.class)
public class SettingsSecureBasedIdentificationGeneratorTest {
private static final String FLAG_ANDROID_ID = "android_id";
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.uid;
package org.chromium.chrome.browser.identity;
import androidx.annotation.Nullable;
import androidx.test.filters.SmallTest;
......@@ -14,7 +14,6 @@ import org.junit.runner.RunWith;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
/** Unit tests for {@link UniqueIdentificationGeneratorFactory}. */
@RunWith(ChromeJUnit4ClassRunner.class)
public class UniqueIdentificationGeneratorFactoryTest {
@Test
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.uid;
package org.chromium.chrome.browser.identity;
import android.support.test.InstrumentationRegistry;
......@@ -18,7 +18,6 @@ import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
/** Unit tests for {@link UuidBasedUniqueIdentificationGenerator}. */
@RunWith(ChromeJUnit4ClassRunner.class)
public class UuidBasedUniqueIdentificationGeneratorTest {
private static final String FLAG_UUID = "uuid";
......
......@@ -21,10 +21,10 @@ import org.junit.runner.RunWith;
import org.chromium.base.test.util.AdvancedMockContext;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.identity.SettingsSecureBasedIdentificationGenerator;
import org.chromium.chrome.browser.identity.UniqueIdentificationGenerator;
import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.signin.IdentityServicesProvider;
import org.chromium.chrome.browser.uid.SettingsSecureBasedIdentificationGenerator;
import org.chromium.chrome.browser.uid.UniqueIdentificationGenerator;
import org.chromium.chrome.browser.uid.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.omaha.AttributeFinder;
import org.chromium.chrome.test.omaha.MockRequestGenerator;
......
......@@ -23,11 +23,11 @@ import org.chromium.base.Promise;
import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.autofill.PersonalDataManager;
import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard;
import org.chromium.chrome.browser.identity.UniqueIdentificationGenerator;
import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.signin.UnifiedConsentServiceBridge;
import org.chromium.chrome.browser.uid.UniqueIdentificationGenerator;
import org.chromium.chrome.browser.uid.UniqueIdentificationGeneratorFactory;
import org.chromium.chrome.browser.uid.UuidBasedUniqueIdentificationGenerator;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule;
import org.chromium.chrome.test.util.browser.signin.SigninTestUtil;
......
file://components/signin/OWNERS
# TEAM: chrome-signin@chromium.org
# COMPONENT: Services>SignIn
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/uid/SettingsSecureBasedIdentificationGenerator.java",
"java/src/org/chromium/chrome/browser/uid/UniqueIdentificationGenerator.java",
"java/src/org/chromium/chrome/browser/uid/UniqueIdentificationGeneratorFactory.java",
"java/src/org/chromium/chrome/browser/uid/UuidBasedUniqueIdentificationGenerator.java",
]
deps = [
"//chrome/browser/preferences:java",
"//chrome/browser/util:java",
"//third_party/android_deps:androidx_annotation_annotation_java",
]
}
android_library("javatests") {
testonly = true
sources = [
"javatests/src/org/chromium/chrome/browser/uid/SettingsSecureBasedIdentificationGeneratorTest.java",
"javatests/src/org/chromium/chrome/browser/uid/UniqueIdentificationGeneratorFactoryTest.java",
"javatests/src/org/chromium/chrome/browser/uid/UuidBasedUniqueIdentificationGeneratorTest.java",
]
deps = [
":java",
"//base:base_java",
"//base:base_java_test_support",
"//base/test:test_support_java",
"//chrome/browser/preferences:java",
"//chrome/browser/util:java",
"//chrome/test/android:chrome_java_test_support",
"//third_party/android_deps:androidx_annotation_annotation_java",
"//third_party/android_deps:androidx_test_runner_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/junit:junit",
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment