OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.components.signin; | 5 package org.chromium.components.signin; |
6 | 6 |
7 import android.accounts.Account; | 7 import android.accounts.Account; |
8 import android.content.BroadcastReceiver; | 8 import android.content.BroadcastReceiver; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 private void setIsChildAccount(boolean isChildAccount) { | 86 private void setIsChildAccount(boolean isChildAccount) { |
87 Log.d(TAG, "Setting child account status for %s to %s", mAccount.name, | 87 Log.d(TAG, "Setting child account status for %s to %s", mAccount.name, |
88 Boolean.toString(isChildAccount)); | 88 Boolean.toString(isChildAccount)); |
89 nativeSetIsChildAccount(mNativeAccountFetcherService, mAccountId, isChil
dAccount); | 89 nativeSetIsChildAccount(mNativeAccountFetcherService, mAccountId, isChil
dAccount); |
90 } | 90 } |
91 | 91 |
92 @CalledByNative | 92 @CalledByNative |
93 private static void initializeForTests() { | 93 private static void initializeForTests() { |
94 Context context = ContextUtils.getApplicationContext(); | |
95 AccountManagerDelegate delegate = new SystemAccountManagerDelegate(); | 94 AccountManagerDelegate delegate = new SystemAccountManagerDelegate(); |
96 AccountManagerHelper.overrideAccountManagerHelperForTests(context, deleg
ate); | 95 AccountManagerHelper.overrideAccountManagerHelperForTests(delegate); |
97 } | 96 } |
98 | 97 |
99 private static native void nativeSetIsChildAccount( | 98 private static native void nativeSetIsChildAccount( |
100 long accountFetcherServicePtr, String accountId, boolean isChildAcco
unt); | 99 long accountFetcherServicePtr, String accountId, boolean isChildAcco
unt); |
101 } | 100 } |
OLD | NEW |