1 package android.accounts.cts;
2 
3 import android.accounts.AccountAuthenticatorResponse;
4 import android.accounts.cts.common.Fixtures;
5 import android.app.Activity;
6 import android.content.Intent;
7 import android.os.Bundle;
8 
9 /**
10  * Activity used by {@link android.accounts.cts.MockAccountAuthenticator} to test the
11  * behavior of {@link AccountManager} when authenticator returns intent.
12  */
13 public class AccountAuthenticatorDummyActivity extends Activity {
14 
15     @Override
onCreate(Bundle icicle)16     protected void onCreate(Bundle icicle) {
17         super.onCreate(icicle);
18         Intent intent = getIntent();
19         AccountAuthenticatorResponse response = intent.getParcelableExtra(Fixtures.KEY_CALLBACK);
20         Intent result = intent.getParcelableExtra(Fixtures.KEY_RESULT);
21         if (response != null) {
22             response.onResult(result.getExtras());
23         }
24         setResult(RESULT_OK, result);
25         finish();
26     }
27 }
28