From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 21 Feb 2022 01:24:11 +0100
Subject: Allow building without supervised users

License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
 .../browser/supervised_user/ChildAccountService.java  | 11 -----------
 .../child_accounts/child_account_service_android.cc   |  9 ---------
 2 files changed, 20 deletions(-)

diff --git a/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java b/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/supervised_user/ChildAccountService.java
@@ -31,21 +31,10 @@ public class ChildAccountService {
         ThreadUtils.assertOnUiThread();
         final Activity activity = windowAndroid.getActivity().get();
         if (activity == null) {
-            PostTask.postTask(UiThreadTaskTraits.DEFAULT, () -> {
-                ChildAccountServiceJni.get().onReauthenticationFailed(nativeOnFailureCallback);
-            });
             return;
         }
         Account account = AccountUtils.createAccountFromName(accountName);
         AccountManagerFacadeProvider.getInstance().updateCredentials(account, activity, success -> {
-            if (!success) {
-                ChildAccountServiceJni.get().onReauthenticationFailed(nativeOnFailureCallback);
-            }
         });
     }
-
-    @NativeMethods
-    interface Natives {
-        void onReauthenticationFailed(long onFailureCallbackPtr);
-    }
 }
diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
--- a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
+++ b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
@@ -39,12 +39,3 @@ void ReauthenticateChildAccount(
       env, window_android->GetJavaObject(), ConvertUTF8ToJavaString(env, email),
       reinterpret_cast<jlong>(callback_copy.release()));
 }
-
-void JNI_ChildAccountService_OnReauthenticationFailed(JNIEnv* env,
-                                                      jlong jcallbackPtr) {
-  // Cast the pointer value back to a Callback and take ownership of it.
-  std::unique_ptr<base::RepeatingCallback<void()>> callback(
-      reinterpret_cast<base::RepeatingCallback<void()>*>(jcallbackPtr));
-
-  callback->Run();
-}
--
2.25.1
