Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java

Issue 1247053002: Move GET_ACCOUNTS permission check to AccountManagerDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java
diff --git a/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java b/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java
index 4948ea1c7b49808348590470120430ea461b40de..206fb85f2172a4e1bfacaa2fc4d9296232dfa132 100644
--- a/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java
+++ b/sync/android/java/src/org/chromium/sync/signin/SystemAccountManagerDelegate.java
@@ -20,13 +20,18 @@ import android.os.Handler;
public class SystemAccountManagerDelegate implements AccountManagerDelegate {
private final AccountManager mAccountManager;
+ private final Context mApplicationContext;
public SystemAccountManagerDelegate(Context context) {
+ mApplicationContext = context.getApplicationContext();
mAccountManager = AccountManager.get(context.getApplicationContext());
}
@Override
public Account[] getAccountsByType(String type) {
+ if (!AccountManagerHelper.get(mApplicationContext).hasGetAccountsPermission()) {
+ return new Account[]{};
+ }
return mAccountManager.getAccountsByType(type);
}
« no previous file with comments | « sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698