1 /*
2  * Copyright (C) 2016 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.contacts.logging;
17 
18 import com.google.common.base.MoreObjects;
19 
20 /**
21  * Describes how user views and takes action in Quick contact
22  */
23 public final class QuickContactEvent {
24 
25     /** The package name that QuickContact is launched from. **/
26     public String referrer;
27 
28     /** The type of the contact displayed in QuickContact. **/
29     public int contactType;
30 
31     /** The type of the card displayed in QuickContact. **/
32     public int cardType;
33 
34     /** The type of the user action in QuickContact. **/
35     public int actionType;
36 
37     /** The third party action that a user takes. **/
38     public String thirdPartyAction;
39 
40     // Should match ContactsExtension.QuickContactEvent values in
41     // http://cs/google3/logs/proto/wireless/android/contacts/contacts_extensions.proto
42     public static final class ContactType {
43         public static final int UNKNOWN_TYPE = 0;
44         public static final int EDITABLE = 1;
45         public static final int INVISIBLE_AND_ADDABLE = 2;
46         public static final int DIRECTORY = 3;
47     }
48 
49     public static final class CardType {
50         public static final int UNKNOWN_CARD = 0;
51         public static final int NO_CONTACT = 1;
52         public static final int CONTACT = 2;
53         public static final int RECENT = 3;
54         public static final int ABOUT = 4;
55         public static final int PERMISSION = 5;
56     }
57 
58     public static final class ActionType {
59         public static final int UNKNOWN_ACTION = 0;
60         public static final int START = 1;
61         public static final int STAR = 2;
62         public static final int UNSTAR = 3;
63         public static final int EDIT = 4;
64         public static final int ADD = 5;
65         public static final int REMOVE = 6;
66         public static final int SHARE = 7;
67         public static final int SHORTCUT = 8;
68         public static final int HELP = 9;
69         public static final int CALL = 10;
70         public static final int SMS = 11;
71         public static final int VIDEOCALL = 12;
72         public static final int EMAIL = 13;
73         public static final int SIPCALL = 14;
74         public static final int ADDRESS = 15;
75         public static final int DIRECTIONS = 16;
76         public static final int THIRD_PARTY = 17;
77     }
78 
79     @Override
toString()80     public String toString() {
81         return MoreObjects.toStringHelper(this)
82                 .add("referrer", referrer)
83                 .add("contactType", contactType)
84                 .add("cardType", cardType)
85                 .add("actionType", actionType)
86                 .add("thirdPartyAction", thirdPartyAction)
87                 .toString();
88     }
89 }
90