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

Unified Diff: sync/test/android/javatests/src/org/chromium/sync/test/util/MockGrantCredentialsPermissionActivity.java

Issue 1440363002: Use GoogleAuthUtil's getToken instead of AccountManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: multidex Created 5 years 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/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/android/javatests/src/org/chromium/sync/test/util/MockGrantCredentialsPermissionActivity.java
diff --git a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockGrantCredentialsPermissionActivity.java b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockGrantCredentialsPermissionActivity.java
index 79a2914a7b1216c5bc98d665caa37ad8bacce3e0..bbc4385c887d047ee499686a3b18d3572c184d8c 100644
--- a/sync/test/android/javatests/src/org/chromium/sync/test/util/MockGrantCredentialsPermissionActivity.java
+++ b/sync/test/android/javatests/src/org/chromium/sync/test/util/MockGrantCredentialsPermissionActivity.java
@@ -4,56 +4,10 @@
package org.chromium.sync.test.util;
-import android.accounts.Account;
import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.util.Log;
-import android.widget.TextView;
/**
- * A dummy implementation of the Android {@link GrantCredentialsPermissionActivity} that is used
- * when displaying the Allow/Deny dialog when an application asks for an auth token
- * for a given auth token type and that app has never gotten the permission.
- *
- * Currently this activity just starts up, broadcasts an intent, and finishes.
- *
- * This class is used by {@link MockAccountManager}.
+ * TODO(knn): Remove this after downstream references have been removed.
*/
public class MockGrantCredentialsPermissionActivity extends Activity {
-
- private static final String TAG = "MockGrantCredentialsPermissionActivity";
-
- static final String ACCOUNT = "account";
-
- static final String AUTH_TOKEN_TYPE = "authTokenType";
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- TextView textView = new TextView(this);
- Account account = (Account) getIntent().getParcelableExtra(ACCOUNT);
- String authTokenType = getIntent().getStringExtra(AUTH_TOKEN_TYPE);
- String accountName = account == null ? null : account.name;
- String message = "account = " + accountName + ", authTokenType = " + authTokenType;
- textView.setText(message);
- setContentView(textView);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- // Send out the broadcast after the Activity has completely started up.
- Handler handler = new Handler(Looper.getMainLooper());
- handler.post(new Runnable() {
- @Override
- public void run() {
- Log.d(TAG, "Broadcasting " + MockAccountManager.MUTEX_WAIT_ACTION);
- sendBroadcast(new Intent(MockAccountManager.MUTEX_WAIT_ACTION));
- finish();
- }
- });
- }
}
« no previous file with comments | « sync/test/android/javatests/src/org/chromium/sync/test/util/MockAccountManager.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698