From 24943994160fe0c9fae5c344eb635a67a7c1536c Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Sat, 7 Nov 2015 01:40:01 +0000 Subject: Revert "More work to hook up screen event logging" This reverts commit 8bea0950ff04891b7aaf58bb4ca758010c813fb4. Change-Id: I1ad4cbda2dc4e6212084399fe53142e9e19dc888 --- src/com/android/dialer/DialtactsActivity.java | 8 +-- .../android/dialer/calllog/CallLogActivity.java | 7 +-- src/com/android/dialer/list/ListsFragment.java | 5 +- .../android/dialer/logging/ScreenTagConstants.java | 73 ---------------------- 4 files changed, 7 insertions(+), 86 deletions(-) delete mode 100644 src/com/android/dialer/logging/ScreenTagConstants.java diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 3cae8a19d..4fa4bc2d7 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -82,7 +82,6 @@ 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; @@ -528,8 +527,7 @@ 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.logScreenView(ScreenTagConstants.DIALPAD, this, - ScreenTagConstants.DIALPAD_DIALER); + Logger.logFragmentView(mDialpadFragment); } mIsRestarting = false; } @@ -684,7 +682,6 @@ 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()); @@ -747,8 +744,7 @@ 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(ScreenTagConstants.DIALPAD, this, - ScreenTagConstants.DIALPAD_DIALER); + Logger.logScreenView(DialpadFragment.class.getSimpleName(), this, null); ft.commit(); if (animate) { diff --git a/src/com/android/dialer/calllog/CallLogActivity.java b/src/com/android/dialer/calllog/CallLogActivity.java index fb1a4fb0f..f6defcfd9 100644 --- a/src/com/android/dialer/calllog/CallLogActivity.java +++ b/src/com/android/dialer/calllog/CallLogActivity.java @@ -41,7 +41,6 @@ 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 { @@ -224,7 +223,7 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage } private void sendScreenViewForChildFragment(int position) { - Logger.logScreenView(ScreenTagConstants.CALL_LOG, this, + Logger.logScreenView(CallLogFragment.class.getSimpleName(), this, getFragmentTagForPosition(position)); } @@ -235,9 +234,9 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage private String getFragmentTagForPosition(int position) { switch (position) { case TAB_INDEX_ALL: - return ScreenTagConstants.CALL_LOG_ALL; + return "All"; case TAB_INDEX_MISSED: - return ScreenTagConstants.CALL_LOG_MISSED; + return "Missed"; } return null; } diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index f3edd4501..08a23732f 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -46,7 +46,6 @@ import com.android.dialer.calllog.CallLogFragment; import com.android.dialer.calllog.CallLogQueryHandler; import com.android.dialer.calllog.ContactInfoHelper; import com.android.dialer.logging.Logger; -import com.android.dialer.logging.ScreenTagConstants; import com.android.dialer.util.DialerUtils; import com.android.dialer.voicemail.VoicemailStatusHelper; import com.android.dialer.voicemail.VoicemailStatusHelperImpl; @@ -412,14 +411,14 @@ public class ListsFragment extends Fragment break; case TAB_INDEX_HISTORY: fragmentName = CallLogFragment.class.getSimpleName(); - tag = ScreenTagConstants.CALL_LOG_HISTORY; + tag = "History"; break; case TAB_INDEX_ALL_CONTACTS: fragmentName = AllContactsFragment.class.getSimpleName(); break; case TAB_INDEX_VOICEMAIL: fragmentName = CallLogFragment.class.getSimpleName(); - tag = ScreenTagConstants.CALL_LOG_VOICEMAIL; + tag = "Voicemail"; default: return; } diff --git a/src/com/android/dialer/logging/ScreenTagConstants.java b/src/com/android/dialer/logging/ScreenTagConstants.java deleted file mode 100644 index 5175cc56f..000000000 --- a/src/com/android/dialer/logging/ScreenTagConstants.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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"; -} -- cgit v1.2.3