blob: e92351609256dd286c252e3b075cdd56d6b61453 [file] [log] [blame]
Andrii Kulian9c5ea9c2017-12-07 09:31:01 -08001/*
2 * Copyright 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
17package android.app.servertransaction;
18
19import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
20
21import android.app.ResultInfo;
22import android.content.Intent;
23import android.content.res.Configuration;
24
25import com.android.internal.content.ReferrerIntent;
26
27import java.util.ArrayList;
28import java.util.List;
29
30class TestUtils {
31
32 static Configuration config() {
33 Configuration config = new Configuration();
34 config.densityDpi = 10;
35 config.fontScale = 0.3f;
36 config.screenHeightDp = 15;
37 config.orientation = ORIENTATION_LANDSCAPE;
38 return config;
39 }
40
41 static List<ResultInfo> resultInfoList() {
42 String resultWho1 = "resultWho1";
43 int requestCode1 = 7;
44 int resultCode1 = 4;
45 Intent data1 = new Intent("action1");
46 ResultInfo resultInfo1 = new ResultInfo(resultWho1, requestCode1, resultCode1, data1);
47
48 String resultWho2 = "resultWho2";
49 int requestCode2 = 8;
50 int resultCode2 = 6;
51 Intent data2 = new Intent("action2");
52 ResultInfo resultInfo2 = new ResultInfo(resultWho2, requestCode2, resultCode2, data2);
53
54 List<ResultInfo> resultInfoList = new ArrayList<>();
55 resultInfoList.add(resultInfo1);
56 resultInfoList.add(resultInfo2);
57
58 return resultInfoList;
59 }
60
61 static List<ReferrerIntent> referrerIntentList() {
62 Intent intent1 = new Intent("action1");
63 ReferrerIntent referrerIntent1 = new ReferrerIntent(intent1, "referrer1");
64
65 Intent intent2 = new Intent("action2");
66 ReferrerIntent referrerIntent2 = new ReferrerIntent(intent2, "referrer2");
67
68 List<ReferrerIntent> referrerIntents = new ArrayList<>();
69 referrerIntents.add(referrerIntent1);
70 referrerIntents.add(referrerIntent2);
71
72 return referrerIntents;
73 }
74}