• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.server.accounts;
17 
18 import android.accounts.Account;
19 
20 import java.util.ArrayList;
21 import java.util.List;
22 
23 /**
24  * Constants shared between test AccountAuthenticators and AccountManagerServiceTest.
25  */
26 public final class AccountManagerServiceTestFixtures {
27     public static final String KEY_ACCOUNT_NAME = "account_manager_service_test:account_name_key";
28     public static final String KEY_ACCOUNT_SESSION_BUNDLE =
29             "account_manager_service_test:account_session_bundle_key";
30     public static final String KEY_ACCOUNT_STATUS_TOKEN =
31             "account_manager_service_test:account_status_token_key";
32     public static final String KEY_ACCOUNT_PASSWORD =
33             "account_manager_service_test:account_password_key";
34     public static final String KEY_OPTIONS_BUNDLE =
35             "account_manager_service_test:option_bundle_key";
36     public static final String ACCOUNT_NAME_SUCCESS = "success_on_return@fixture.com";
37     public static final String ACCOUNT_NAME_SUCCESS_2 = "success_on_return_2@fixture.com";
38     public static final String ACCOUNT_NAME_INTERVENE = "intervene@fixture.com";
39     public static final String ACCOUNT_NAME_ERROR = "error@fixture.com";
40 
41     public static final String ACCOUNT_NAME =
42             "com.android.server.accounts.account_manager_service_test.account.name";
43     public static final String ACCOUNT_TYPE_1 =
44             "com.android.server.accounts.account_manager_service_test.account.type1";
45     public static final String ACCOUNT_TYPE_2 =
46             "com.android.server.accounts.account_manager_service_test.account.type2";
47     public static final String ACCOUNT_FAKE_TYPE =
48             "com.android.server.accounts.account_manager_service_test.account.type.fake";
49 
50     public static final String ACCOUNT_STATUS_TOKEN =
51             "com.android.server.accounts.account_manager_service_test.account.status.token";
52     public static final String AUTH_TOKEN_LABEL =
53             "com.android.server.accounts.account_manager_service_test.auth.token.label";
54     public static final String AUTH_TOKEN =
55             "com.android.server.accounts.account_manager_service_test.auth.token";
56     public static final String KEY_TOKEN_EXPIRY =
57             "com.android.server.accounts.account_manager_service_test.auth.token.expiry";
58     public static final String ACCOUNT_FEATURE1 =
59             "com.android.server.accounts.account_manager_service_test.feature1";
60     public static final String ACCOUNT_FEATURE2 =
61             "com.android.server.accounts.account_manager_service_test.feature2";
62     public static final String[] ACCOUNT_FEATURES =
63             new String[]{ACCOUNT_FEATURE1, ACCOUNT_FEATURE2};
64     public static final String CALLER_PACKAGE =
65             "com.android.server.accounts.account_manager_service_test.caller.package";
66     public static final String ACCOUNT_PASSWORD =
67             "com.android.server.accounts.account_manager_service_test.account.password";
68     public static final String KEY_RESULT = "account_manager_service_test:result";
69     public static final String KEY_CALLBACK = "account_manager_service_test:callback";
70 
71     public static final Account ACCOUNT_SUCCESS =
72             new Account(ACCOUNT_NAME_SUCCESS, ACCOUNT_TYPE_1);
73     public static final Account ACCOUNT_SUCCESS_2 =
74             new Account(ACCOUNT_NAME_SUCCESS_2, ACCOUNT_TYPE_1);
75     public static final Account ACCOUNT_INTERVENE =
76             new Account(ACCOUNT_NAME_INTERVENE, ACCOUNT_TYPE_1);
77     public static final Account ACCOUNT_ERROR =
78             new Account(ACCOUNT_NAME_ERROR, ACCOUNT_TYPE_1);
79     public static final Account ACCOUNT_SUCCESS_TYPE_2 =
80             new Account(ACCOUNT_NAME_SUCCESS, ACCOUNT_TYPE_2);
81 
82     public static final String SESSION_DATA_NAME_1 = "session.data.name.1";
83     public static final String SESSION_DATA_VALUE_1 = "session.data.value.1";
84 
85     public static final String ERROR_MESSAGE =
86         "com.android.server.accounts.account_manager_service_test.error.message";
87 
AccountManagerServiceTestFixtures()88     private AccountManagerServiceTestFixtures() {}
89 }
90