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

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

Issue 1194423002: Don't check for USE_CREDENTIALS permission on Android M. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 6 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
Index: sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java
diff --git a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java
index 4d2b292172bbc04b3a969f836ea510d2bd5a575a..4d323750f2be71ad4eeb7692e9426f1b701ffb49 100644
--- a/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java
+++ b/sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java
@@ -21,6 +21,7 @@ import android.os.Bundle;
import android.os.Process;
import android.util.Log;
+import org.chromium.base.BuildInfo;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.net.NetworkChangeNotifier;
@@ -259,8 +260,9 @@ public class AccountManagerHelper {
}
private boolean hasUseCredentialsPermission() {
- return mApplicationContext.checkPermission(Manifest.permission.USE_CREDENTIALS,
- Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
+ return BuildInfo.isMncOrLater()
+ || mApplicationContext.checkPermission(Manifest.permission.USE_CREDENTIALS,
+ Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
}
// Gets the auth token synchronously

Powered by Google App Engine
This is Rietveld 408576698