summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Maxwell <maxwelb@google.com>2015-11-05 16:27:40 -0800
committerBrandon Maxwell <maxwelb@google.com>2015-11-12 14:31:27 -0800
commitd81cc6c64f3213f571c1f1e7a5c7e59b71491fb0 (patch)
treeec3ff1d64fa79e7e0728f16dc95be7b113ef3340
parent07c23f071adc133571613766174812bd21b25a79 (diff)
Adding Logging to call blocking interactions
+ Added Clearcut logging when users block, unblock, undo, or import blocked numbers. Location of blocking is noted, e.g. CallLog, CallDetails, ManagementScreen + Added class with Constants matching proto definition Bug: 25288435 Change-Id: I7fbef52d0e31b49c31dadbc0b4d775969d97420a
-rw-r--r--src/com/android/dialer/CallDetailActivity.java11
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java20
-rw-r--r--src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java24
-rw-r--r--src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java16
-rw-r--r--src/com/android/dialer/filterednumber/FilteredNumbersUtil.java7
-rw-r--r--src/com/android/dialer/list/BlockedListSearchFragment.java15
-rw-r--r--src/com/android/dialer/logging/InteractionEvent.java76
-rw-r--r--src/com/android/dialer/logging/Logger.java14
8 files changed, 172 insertions, 11 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index 1f9e476ed..88d3fe2d6 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -57,6 +57,8 @@ import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener;
import com.android.dialer.filterednumber.BlockNumberDialogFragment;
import com.android.dialer.filterednumber.FilteredNumbersUtil;
+import com.android.dialer.logging.InteractionEvent;
+import com.android.dialer.logging.Logger;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.IntentUtil.CallIntentBuilder;
import com.android.dialer.util.PhoneNumberUtil;
@@ -380,7 +382,14 @@ public class CallDetailActivity extends AppCompatActivity
}
@Override
- public void onChangeFilteredNumberSuccess() {
+ public void onFilterNumberSuccess() {
+ Logger.logInteraction(InteractionEvent.BLOCK_NUMBER_CALL_DETAIL);
+ updateFilteredNumberChanges();
+ }
+
+ @Override
+ public void onUnfilterNumberSuccess() {
+ Logger.logInteraction(InteractionEvent.UNBLOCK_NUMBER_CALL_DETAIL);
updateFilteredNumberChanges();
}
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 42b2f230d..55e2fa077 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -48,6 +48,9 @@ import com.android.dialer.R;
import com.android.dialer.contactinfo.ContactInfoCache;
import com.android.dialer.contactinfo.ContactInfoCache.OnContactInfoChangedListener;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
+import com.android.dialer.filterednumber.BlockNumberDialogFragment.Callback;
+import com.android.dialer.logging.InteractionEvent;
+import com.android.dialer.logging.Logger;
import com.android.dialer.util.PhoneNumberUtil;
import com.android.dialer.voicemail.VoicemailPlaybackPresenter;
@@ -361,7 +364,22 @@ public class CallLogAdapter extends GroupingListAdapter
mCallLogListItemHelper,
mVoicemailPlaybackPresenter,
mFilteredNumberAsyncQueryHandler,
- null);
+ new Callback() {
+ @Override
+ public void onFilterNumberSuccess() {
+ Logger.logInteraction(
+ InteractionEvent.BLOCK_NUMBER_CALL_LOG);
+ }
+
+ @Override
+ public void onUnfilterNumberSuccess() {
+ Logger.logInteraction(
+ InteractionEvent.UNBLOCK_NUMBER_CALL_LOG);
+ }
+
+ @Override
+ public void onChangeFilteredNumberUndo() {}
+ });
viewHolder.callLogEntryView.setTag(viewHolder);
viewHolder.callLogEntryView.setAccessibilityDelegate(mAccessibilityDelegate);
diff --git a/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java b/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java
index 21746eecc..0f4bd74bd 100644
--- a/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java
+++ b/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java
@@ -36,6 +36,8 @@ import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnBlockNumberListener;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnUnblockNumberListener;
import com.android.dialer.voicemail.VisualVoicemailEnabledChecker;
+import com.android.dialer.logging.InteractionEvent;
+import com.android.dialer.logging.Logger;
/**
* Fragment for confirming and enacting blocking/unblocking a number. Also invokes snackbar
@@ -51,8 +53,20 @@ public class BlockNumberDialogFragment extends DialogFragment {
* upon rotation instead.
*/
public interface Callback {
- public void onChangeFilteredNumberSuccess();
- public void onChangeFilteredNumberUndo();
+ /**
+ * Called when a number is successfully added to the set of filtered numbers
+ */
+ void onFilterNumberSuccess();
+
+ /**
+ * Called when a number is successfully removed from the set of filtered numbers
+ */
+ void onUnfilterNumberSuccess();
+
+ /**
+ * Called when the action of filtering or unfiltering a number is undone
+ */
+ void onChangeFilteredNumberUndo();
}
private static final String BLOCK_DIALOG_FRAGMENT = "BlockNumberDialog";
@@ -230,6 +244,7 @@ public class BlockNumberDialogFragment extends DialogFragment {
@Override
public void onClick(View view) {
// Delete the newly created row on 'undo'.
+ Logger.logInteraction(InteractionEvent.UNDO_BLOCK_NUMBER);
mHandler.unblock(onUndoListener, uri);
}
};
@@ -240,7 +255,7 @@ public class BlockNumberDialogFragment extends DialogFragment {
.show();
if (callback != null) {
- callback.onChangeFilteredNumberSuccess();
+ callback.onFilterNumberSuccess();
}
if (context != null && FilteredNumbersUtil.hasRecentEmergencyCall(context)) {
@@ -278,6 +293,7 @@ public class BlockNumberDialogFragment extends DialogFragment {
@Override
public void onClick(View view) {
// Re-insert the row on 'undo', with a new ID.
+ Logger.logInteraction(InteractionEvent.UNDO_UNBLOCK_NUMBER);
mHandler.blockNumber(onUndoListener, values);
}
};
@@ -288,7 +304,7 @@ public class BlockNumberDialogFragment extends DialogFragment {
.show();
if (callback != null) {
- callback.onChangeFilteredNumberSuccess();
+ callback.onUnfilterNumberSuccess();
}
}
}, getArguments().getInt(ARG_BLOCK_ID));
diff --git a/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java b/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java
index a23e46d1e..e33b0f810 100644
--- a/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java
+++ b/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java
@@ -26,6 +26,8 @@ import com.android.contacts.common.GeoUtil;
import com.android.dialer.R;
import com.android.dialer.calllog.ContactInfoHelper;
import com.android.dialer.database.FilteredNumberContract.FilteredNumberColumns;
+import com.android.dialer.logging.InteractionEvent;
+import com.android.dialer.logging.Logger;
public class BlockedNumbersAdapter extends NumbersAdapter {
@@ -67,7 +69,19 @@ public class BlockedNumbersAdapter extends NumbersAdapter {
PhoneNumberUtils.formatNumber(number, countryIso),
R.id.blocked_number_fragment,
getFragmentManager(),
- null /* callback */);
+ new BlockNumberDialogFragment.Callback() {
+ @Override
+ public void onFilterNumberSuccess() {}
+
+ @Override
+ public void onUnfilterNumberSuccess() {
+ Logger.logInteraction(
+ InteractionEvent.UNBLOCK_NUMBER_MANAGEMENT_SCREEN);
+ }
+
+ @Override
+ public void onChangeFilteredNumberUndo() {}
+ });
}
});
diff --git a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java
index 76d391357..23ce8a8de 100644
--- a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java
+++ b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java
@@ -26,11 +26,9 @@ import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
-import android.provider.ContactsContract.Data;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
-import android.util.Log;
import android.widget.Toast;
import java.util.LinkedList;
@@ -43,6 +41,8 @@ import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnHasBlockedNumbersListener;
import com.android.dialer.database.FilteredNumberContract.FilteredNumber;
import com.android.dialer.database.FilteredNumberContract.FilteredNumberColumns;
+import com.android.dialer.logging.InteractionEvent;
+import com.android.dialer.logging.Logger;
/**
* Utility to help with tasks related to filtered numbers.
@@ -164,10 +164,11 @@ public class FilteredNumbersUtil {
*/
public static void importSendToVoicemailContacts(
final Context context, final ImportSendToVoicemailContactsListener listener) {
+ Logger.logInteraction(InteractionEvent.IMPORT_SEND_TO_VOICEMAIL);
final FilteredNumberAsyncQueryHandler mFilteredNumberAsyncQueryHandler =
new FilteredNumberAsyncQueryHandler(context.getContentResolver());
- final AsyncTask task = new AsyncTask<Object, Void, Boolean>() {
+ final AsyncTask<Object, Void, Boolean> task = new AsyncTask<Object, Void, Boolean>() {
@Override
public Boolean doInBackground(Object[] params) {
if (context == null) {
diff --git a/src/com/android/dialer/list/BlockedListSearchFragment.java b/src/com/android/dialer/list/BlockedListSearchFragment.java
index 306847850..da6b42820 100644
--- a/src/com/android/dialer/list/BlockedListSearchFragment.java
+++ b/src/com/android/dialer/list/BlockedListSearchFragment.java
@@ -37,6 +37,8 @@ import com.android.dialer.R;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener;
import com.android.dialer.filterednumber.BlockNumberDialogFragment;
+import com.android.dialer.logging.InteractionEvent;
+import com.android.dialer.logging.Logger;
import com.android.dialer.widget.SearchEditTextLayout;
public class BlockedListSearchFragment extends RegularSearchFragment
@@ -198,7 +200,18 @@ public class BlockedListSearchFragment extends RegularSearchFragment
}
@Override
- public void onChangeFilteredNumberSuccess() {
+ public void onFilterNumberSuccess() {
+ Logger.logInteraction(InteractionEvent.BLOCK_NUMBER_MANAGEMENT_SCREEN);
+ goBack();
+ }
+
+ @Override
+ public void onUnfilterNumberSuccess() {
+ Log.wtf(TAG, "Unblocked a number from the BlockedListSearchFragment");
+ goBack();
+ }
+
+ private void goBack() {
Activity activity = getActivity();
if (activity == null) {
return;
diff --git a/src/com/android/dialer/logging/InteractionEvent.java b/src/com/android/dialer/logging/InteractionEvent.java
new file mode 100644
index 000000000..88518b47c
--- /dev/null
+++ b/src/com/android/dialer/logging/InteractionEvent.java
@@ -0,0 +1,76 @@
+/*
+ * 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;
+
+/**
+ * Class holding constants for Dialer interactions
+ */
+public class InteractionEvent {
+
+ public static final int UNKNOWN = 0;
+
+ /**
+ * An incoming call was blocked
+ */
+ public static final int CALL_BLOCKED = 15;
+
+ /**
+ * The user blocked a number from the Call Log screen
+ */
+ public static final int BLOCK_NUMBER_CALL_LOG = 16;
+
+ /**
+ * The user blocked a number from the Call details screen
+ */
+ public static final int BLOCK_NUMBER_CALL_DETAIL = 17;
+
+ /**
+ * The user blocked a number from the Management screen
+ */
+ public static final int BLOCK_NUMBER_MANAGEMENT_SCREEN = 18;
+
+ /**
+ * The user unblocked a number from the Call Log screen
+ */
+ public static final int UNBLOCK_NUMBER_CALL_LOG = 19;
+
+ /**
+ * The user unblocked a number from the Call details screen
+ */
+ public static final int UNBLOCK_NUMBER_CALL_DETAIL = 20;
+
+ /**
+ * The user unblocked a number from the Management screen
+ */
+ public static final int UNBLOCK_NUMBER_MANAGEMENT_SCREEN = 21;
+
+ /**
+ * The user blocked numbers from contacts marked as send to voicemail
+ */
+ public static final int IMPORT_SEND_TO_VOICEMAIL = 22;
+
+ /**
+ * The user blocked a number then undid the block
+ */
+ public static final int UNDO_BLOCK_NUMBER = 23;
+
+ /**
+ * The user unblocked a number then undid the unblock
+ */
+ public static final int UNDO_UNBLOCK_NUMBER = 24;
+
+}
diff --git a/src/com/android/dialer/logging/Logger.java b/src/com/android/dialer/logging/Logger.java
index fc19c8f8a..25b7268ad 100644
--- a/src/com/android/dialer/logging/Logger.java
+++ b/src/com/android/dialer/logging/Logger.java
@@ -66,6 +66,20 @@ public abstract class Logger {
}
}
+ /**
+ * Logs an interaction that occurred
+ *
+ * @param interaction an integer representing what interaction occurred.
+ * {@see com.android.dialer.logging.InteractionEvent}
+ */
+ public static void logInteraction(int interaction) {
+ final Logger logger = getInstance();
+ if (logger != null) {
+ logger.logInteractionImpl(interaction);
+ }
+ }
+
public abstract void logCallImpl(Call call);
public abstract void logScreenViewImpl(int screenType);
+ public abstract void logInteractionImpl(int dialerInteraction);
}