summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-11-07 01:37:49 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-11-07 01:37:49 +0000
commitf2036fa4b8e1ecdb65349dea3e2227b1f018781c (patch)
treec6ee5e79ee554d1c51649417214274330cb30b3c /src
parent827d81b98326a885096e902aed600816a262087a (diff)
parent7b2f63c7c5485bdd62a3e0ed8446b6011a786d3b (diff)
Merge "More work to hook up screen event logging" into ub-contactsdialer-a-dev am: 305eb447e8
am: 7b2f63c7c5 * commit '7b2f63c7c5485bdd62a3e0ed8446b6011a786d3b': More work to hook up screen event logging
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/DialtactsActivity.java8
-rw-r--r--src/com/android/dialer/calllog/CallLogActivity.java7
-rw-r--r--src/com/android/dialer/list/ListsFragment.java5
-rw-r--r--src/com/android/dialer/logging/ScreenTagConstants.java73
4 files changed, 86 insertions, 7 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index b4dd6c9c8..b6cf754b7 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -82,6 +82,7 @@ import com.android.dialer.list.SearchFragment;
import com.android.dialer.list.SmartDialSearchFragment;
import com.android.dialer.list.SpeedDialFragment;
import com.android.dialer.logging.Logger;
+import com.android.dialer.logging.ScreenTagConstants;
import com.android.dialer.settings.DialerSettingsActivity;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.IntentUtil;
@@ -527,7 +528,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
// This is only called when the activity goes from resumed -> paused -> resumed, so it
// will not cause an extra view to be sent out on rotation
if (mIsDialpadShown) {
- Logger.logFragmentView(mDialpadFragment);
+ Logger.logScreenView(ScreenTagConstants.DIALPAD, this,
+ ScreenTagConstants.DIALPAD_DIALER);
}
mIsRestarting = false;
}
@@ -682,6 +684,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
ImportExportDialogFragment.show(getFragmentManager(), true,
DialtactsActivity.class, ImportExportDialogFragment.EXPORT_MODE_DEFAULT);
}
+ Logger.logScreenView(ScreenTagConstants.IMPORT_EXPORT_CONTACTS, this, null);
return true;
case R.id.menu_clear_frequents:
ClearFrequentsDialog.show(getFragmentManager());
@@ -744,7 +747,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
mDialpadFragment.setAnimate(animate);
// logScreenView is used here explicitly to provide the activity as the DialpadFragment
// might not have been attached yet.
- Logger.logScreenView(DialpadFragment.class.getSimpleName(), this, null);
+ Logger.logScreenView(ScreenTagConstants.DIALPAD, this,
+ ScreenTagConstants.DIALPAD_DIALER);
ft.commit();
if (animate) {
diff --git a/src/com/android/dialer/calllog/CallLogActivity.java b/src/com/android/dialer/calllog/CallLogActivity.java
index f6defcfd9..fb1a4fb0f 100644
--- a/src/com/android/dialer/calllog/CallLogActivity.java
+++ b/src/com/android/dialer/calllog/CallLogActivity.java
@@ -41,6 +41,7 @@ import com.android.dialer.DialtactsActivity;
import com.android.dialer.R;
import com.android.dialer.TransactionSafeActivity;
import com.android.dialer.logging.Logger;
+import com.android.dialer.logging.ScreenTagConstants;
import com.android.dialer.util.DialerUtils;
public class CallLogActivity extends TransactionSafeActivity implements ViewPager.OnPageChangeListener {
@@ -223,7 +224,7 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage
}
private void sendScreenViewForChildFragment(int position) {
- Logger.logScreenView(CallLogFragment.class.getSimpleName(), this,
+ Logger.logScreenView(ScreenTagConstants.CALL_LOG, this,
getFragmentTagForPosition(position));
}
@@ -234,9 +235,9 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage
private String getFragmentTagForPosition(int position) {
switch (position) {
case TAB_INDEX_ALL:
- return "All";
+ return ScreenTagConstants.CALL_LOG_ALL;
case TAB_INDEX_MISSED:
- return "Missed";
+ return ScreenTagConstants.CALL_LOG_MISSED;
}
return null;
}
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java
index 4735926e8..c4f4b138b 100644
--- a/src/com/android/dialer/list/ListsFragment.java
+++ b/src/com/android/dialer/list/ListsFragment.java
@@ -38,6 +38,7 @@ import com.android.dialer.R;
import com.android.dialer.calllog.CallLogFragment;
import com.android.dialer.calllog.CallLogQueryHandler;
import com.android.dialer.logging.Logger;
+import com.android.dialer.logging.ScreenTagConstants;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.voicemail.VisualVoicemailEnabledChecker;
import com.android.dialer.voicemail.VoicemailStatusHelper;
@@ -401,14 +402,14 @@ public class ListsFragment extends Fragment
break;
case TAB_INDEX_HISTORY:
fragmentName = CallLogFragment.class.getSimpleName();
- tag = "History";
+ tag = ScreenTagConstants.CALL_LOG_HISTORY;
break;
case TAB_INDEX_ALL_CONTACTS:
fragmentName = AllContactsFragment.class.getSimpleName();
break;
case TAB_INDEX_VOICEMAIL:
fragmentName = CallLogFragment.class.getSimpleName();
- tag = "Voicemail";
+ tag = ScreenTagConstants.CALL_LOG_VOICEMAIL;
default:
return;
}
diff --git a/src/com/android/dialer/logging/ScreenTagConstants.java b/src/com/android/dialer/logging/ScreenTagConstants.java
new file mode 100644
index 000000000..5175cc56f
--- /dev/null
+++ b/src/com/android/dialer/logging/ScreenTagConstants.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.dialer.logging;
+
+import com.google.android.dialer.settings.GoogleDialerSettingsActivity;
+
+import com.android.contacts.common.dialog.ClearFrequentsDialog;
+import com.android.contacts.common.interactions.ImportExportDialogFragment;
+import com.android.dialer.calllog.CallLogFragment;
+import com.android.dialer.dialpad.DialpadFragment;
+import com.android.dialer.list.AllContactsFragment;
+import com.android.dialer.list.RegularSearchFragment;
+import com.android.dialer.list.SmartDialSearchFragment;
+import com.android.dialer.list.SpeedDialFragment;
+import com.android.incallui.AnswerFragment;
+import com.android.incallui.CallCardFragment;
+import com.android.incallui.ConferenceManagerFragment;
+
+/**
+ * Central repository of all string constants used to identify screens/fragments/dialogs for
+ * logging purposes.
+ */
+public class ScreenTagConstants {
+ /**
+ * Unique identifiers for each screen that is displayed in the Dialer
+ */
+ public static final String DIALPAD = DialpadFragment.class.getSimpleName();
+ public static final String SPEED_DIAL = SpeedDialFragment.class.getSimpleName();
+ public static final String CALL_LOG = CallLogFragment.class.getSimpleName();
+ public static final String ALL_CONTACTS = AllContactsFragment.class.getSimpleName();
+ public static final String REGULAR_SEARCH = RegularSearchFragment.class.getSimpleName();
+ public static final String SMART_DIAL_SEARCH = SmartDialSearchFragment.class.getSimpleName();
+ public static final String SETTINGS = GoogleDialerSettingsActivity.class.getSimpleName();
+ public static final String IMPORT_EXPORT_CONTACTS =
+ ImportExportDialogFragment.class.getSimpleName();
+ public static final String CLEAR_FREQUENTS = ClearFrequentsDialog.class.getSimpleName();
+ public static final String SEND_FEEDBACK = "SendFeedback";
+ public static final String INCALL = CallCardFragment.class.getSimpleName();
+ public static final String INCOMING_CALL = AnswerFragment.class.getSimpleName();
+ public static final String CONFERENCE_MANAGEMENT =
+ ConferenceManagerFragment.class.getSimpleName();
+
+ /**
+ * Additional constants that allow disambiguation between similar fragments in different
+ * activities.
+ */
+ // The dialpad in DialtactsActivity
+ public static final String DIALPAD_DIALER = "Dialer";
+ // The dialpad in InCallActivity
+ public static final String DIALPAD_INCALL = "InCall";
+
+ // The HISTORY tab in DialtactsActivity
+ public static final String CALL_LOG_HISTORY = "History";
+ // The VOICEMAIL tab in DialtactsActivity
+ public static final String CALL_LOG_VOICEMAIL = "Voicemail";
+ // The ALL tab in CallLogActivity
+ public static final String CALL_LOG_ALL = "All";
+ // The MISSED tab in CallLogActivity
+ public static final String CALL_LOG_MISSED = "Missed";
+}