• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.globalsearch;
18 
19 import android.content.ContentResolver;
20 import android.net.Uri;
21 
22 /**
23  * URIs, columns, permissions and other constants for talking to the click log provider.
24  */
25 public class ClickLoggerContract {
26 
27     /**
28      * The content provider authority for the click log provider.
29      */
30     public static final String LOG_AUHTORITY = "com.android.globalsearch.log";
31 
32     /**
33      * Content URI path for logging clicks.
34      */
35     public static final String CLICKS_PATH = "clicks";
36 
37     /**
38      * Content URI that click log requests should be inserted at.
39      */
40     public static final Uri CLICK_LOG_URI =
41             Uri.parse("content://" + LOG_AUHTORITY + "/" + CLICKS_PATH);
42 
43     /**
44      * Media type of {@link #CLICK_LOG_URI}.
45      */
46     public static final String CLICKS_MIME_TYPE =
47         ContentResolver.CURSOR_DIR_BASE_TYPE + "/com.android.globalsearch.log.click";
48 
49     /**
50      * Permission that the application that hosts the click log provider must have in order
51      * to receive click log requests.
52      */
53     public static final String PERMISSION_RECEIVE_GLOBALSEARCH_LOG =
54             "com.android.globalsearch.permission.RECEIVE_GLOBALSEARCH_LOG";
55 
56     /**
57      * The query as typed by the user.
58      * Column for inserts on {@link #CLICK_LOG_URI}.
59      */
60     public static final String COL_QUERY = "q";
61 
62     /**
63      * The position of the clicked suggestion among all displayed suggestions.
64      * Column for inserts on {@link #CLICK_LOG_URI}.
65      */
66     public static final String COL_POS = "pos";
67 
68     /**
69      * The value (if any) of {@link android.app.SearchManager#SUGGEST_COLUMN_INTENT_EXTRA_DATA}
70      * for the suggestion that was clicked.
71      * Column for inserts on {@link #CLICK_LOG_URI}.
72      */
73     public static final String COL_EXTRA_DATA = "extra";
74 
75     /**
76      * The action key (if any) for the action key that was used to launch the suggestion.
77      * Column for inserts on {@link #CLICK_LOG_URI}.
78      */
79     public static final String COL_ACTION_KEY = "actionKey";
80 
81     /**
82      * The action key message (if any) for the action key that was used to launch the suggestion.
83      * Column for inserts on {@link #CLICK_LOG_URI}.
84      */
85     public static final String COL_ACTION_MSG = "actionMsg";
86 
87     /**
88      * A comma-separated list of suggestion types, one for suggestion that was displayed
89      * when the suggestion was launched.
90      * Column for inserts on {@link #CLICK_LOG_URI}.
91      */
92     public static final String COL_SLOTS = "slots";
93 
94     /**
95      * Suggestion from the web search provider.
96      * This is a suggestion type for {@link #COL_SLOTS}.
97      */
98     public static final String TYPE_WEB = "0";
99 
100     /**
101      * Built-in GlobalSearch suggestion (e.g. "Go to web site").
102      * This is a suggestion type for {@link #COL_SLOTS}.
103      */
104     public static final String TYPE_BUILTIN = "1";
105 
106     /**
107      * All other suggestions (e.g. Contacts, Apps, Music, third party suggestions).
108      * This is a suggestion type for {@link #COL_SLOTS}.
109      */
110     public static final String TYPE_OTHER = "2";
111 
112 }
113