1 /*
2  * Copyright (C) 2009 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 
17 package com.android.quicksearchbox.benchmarks;
18 
19 import android.content.ComponentName;
20 
21 /*
22 
23 To build and run:
24 
25 mmm packages/apps/QuickSearchBox/benchmarks \
26 && adb install -r $OUT/data/app/QuickSearchBoxBenchmarks.apk \
27 && sleep 10 \
28 && adb shell am start -a android.intent.action.MAIN \
29         -n com.android.quicksearchbox.benchmarks/.ApplicationsLatency \
30 && adb logcat
31 
32 */
33 
34 public class ApplicationsLatency extends SourceLatency {
35 
36     private static final String[] queries = { "", "a", "s", "e", "r", "pub", "sanxjkashasrxae" };
37 
38     private static ComponentName APPS_COMPONENT =
39             new ComponentName("com.android.providers.applications",
40                 "com.android.providers.applications.ApplicationLauncher");
41 
42     @Override
onResume()43     protected void onResume() {
44         super.onResume();
45 
46         testApps();
47     }
48 
49 
testApps()50     private void testApps() {
51         for (String query : queries) {
52             checkSource("APPS", APPS_COMPONENT, query);
53         }
54     }
55 
56 }
57