diff options
author | yueg <yueg@google.com> | 2017-08-28 13:30:21 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 23:28:36 +0000 |
commit | 864bd2a72c29533bf99c9c2dc687f95412ebaddc (patch) | |
tree | c7f3198d175df61679572d0eec76ec4c08212969 | |
parent | dfd12e6b3fec3cd4a7af247b94d950eccd34f790 (diff) |
Add logging for in-call UI buttons.
Including:
- open dialpad
- add call
- merge
- swap
- in dialpad: number or * or #
- in dialpad: hang up
- in dialpad: close dialpad
Test: CallCardPresenterTest, CallButtonPresenterTest, InCallFragmentTest, DialpadFragmentTest
PiperOrigin-RevId: 166748762
Change-Id: Iba34852505a0a76887857de4bab0664bec87ffd9
5 files changed, 42 insertions, 2 deletions
diff --git a/java/com/android/dialer/logging/dialer_impression.proto b/java/com/android/dialer/logging/dialer_impression.proto index 02dd0cb64..ef249c262 100644 --- a/java/com/android/dialer/logging/dialer_impression.proto +++ b/java/com/android/dialer/logging/dialer_impression.proto @@ -519,5 +519,16 @@ message DialerImpression { // Bubble collapse initiated by user, i.e. no hiding after collapse BUBBLE_COLLAPSE_BY_USER = 1260; + + // In in-call UI + IN_CALL_SHOW_DIALPAD_BUTTON_PRESSED = 1261; + IN_CALL_ADD_CALL_BUTTON_PRESSED = 1262; + IN_CALL_MERGE_BUTTON_PRESSED = 1263; + IN_CALL_SWAP_SECONDARY_BUTTON_PRESSED = 1264; + + // In in-call dialpad + IN_CALL_DIALPAD_NUMBER_BUTTON_PRESSED = 1265; + IN_CALL_DIALPAD_HANG_UP_BUTTON_PRESSED = 1266; + IN_CALL_DIALPAD_CLOSE_BUTTON_PRESSED = 1267; } } diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index 4da227c31..658ae649b 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -252,11 +252,21 @@ public class CallButtonPresenter @Override public void mergeClicked() { + Logger.get(mContext) + .logCallImpression( + DialerImpression.Type.IN_CALL_MERGE_BUTTON_PRESSED, + mCall.getUniqueCallId(), + mCall.getTimeAddedMs()); TelecomAdapter.getInstance().merge(mCall.getId()); } @Override public void addCallClicked() { + Logger.get(mContext) + .logCallImpression( + DialerImpression.Type.IN_CALL_ADD_CALL_BUTTON_PRESSED, + mCall.getUniqueCallId(), + mCall.getTimeAddedMs()); // Automatically mute the current call mAutomaticallyMuted = true; mPreviousMuteState = AudioModeProvider.getInstance().getAudioState().isMuted(); @@ -267,6 +277,11 @@ public class CallButtonPresenter @Override public void showDialpadClicked(boolean checked) { + Logger.get(mContext) + .logCallImpression( + DialerImpression.Type.IN_CALL_SHOW_DIALPAD_BUTTON_PRESSED, + mCall.getUniqueCallId(), + mCall.getTimeAddedMs()); LogUtil.v("CallButtonPresenter", "show dialpad " + String.valueOf(checked)); getActivity().showDialpadFragment(checked /* show */, true /* animate */); } diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index 06b59c042..653b51aa5 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -1006,6 +1006,11 @@ public class CallCardPresenter return; } + Logger.get(mContext) + .logCallImpression( + DialerImpression.Type.IN_CALL_SWAP_SECONDARY_BUTTON_PRESSED, + mPrimary.getUniqueCallId(), + mPrimary.getTimeAddedMs()); LogUtil.i( "CallCardPresenter.onSecondaryInfoClicked", "swapping call to foreground: " + mSecondary); mSecondary.unhold(); diff --git a/java/com/android/incallui/DialpadFragment.java b/java/com/android/incallui/DialpadFragment.java index c614d8412..fbcd4078e 100644 --- a/java/com/android/incallui/DialpadFragment.java +++ b/java/com/android/incallui/DialpadFragment.java @@ -35,6 +35,8 @@ import com.android.contacts.common.compat.PhoneNumberUtilsCompat; import com.android.dialer.dialpadview.DialpadKeyButton; import com.android.dialer.dialpadview.DialpadKeyButton.OnPressedListener; import com.android.dialer.dialpadview.DialpadView; +import com.android.dialer.logging.DialerImpression; +import com.android.dialer.logging.Logger; import com.android.incallui.DialpadPresenter.DialpadUi; import com.android.incallui.baseui.BaseFragment; import java.util.Map; @@ -87,6 +89,8 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi> @Override public void onClick(View v) { if (v.getId() == R.id.dialpad_back) { + Logger.get(getContext()) + .logImpression(DialerImpression.Type.IN_CALL_DIALPAD_CLOSE_BUTTON_PRESSED); getActivity().onBackPressed(); } } @@ -107,6 +111,7 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi> case KeyEvent.ACTION_UP: getPresenter().stopDtmf(); break; + default: // fall out } // do not return true [handled] here, since we want the // press / click animation to be handled by the framework. @@ -261,6 +266,8 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi> @Override public void onPressed(View view, boolean pressed) { if (pressed && mDisplayMap.containsKey(view.getId())) { + Logger.get(getContext()) + .logImpression(DialerImpression.Type.IN_CALL_DIALPAD_NUMBER_BUTTON_PRESSED); Log.d(this, "onPressed: " + pressed + " " + mDisplayMap.get(view.getId())); getPresenter().processDtmf(mDisplayMap.get(view.getId())); } @@ -315,7 +322,7 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi> * Overrides the characters used in {@link DialerKeyListener#CHARACTERS} These are the valid * dtmf characters. */ - public final char[] DTMF_CHARACTERS = + public final char[] dtmfCharacters = new char[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*'}; private DTMFKeyListener() { @@ -325,7 +332,7 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi> /** Overriden to return correct DTMF-dialable characters. */ @Override protected char[] getAcceptedChars() { - return DTMF_CHARACTERS; + return dtmfCharacters; } /** special key listener ignores backspace. */ diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index f9abf2044..d91b5f275 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -231,6 +231,8 @@ public class InCallFragment extends Fragment public void onClick(View view) { if (view == endCallButton) { LogUtil.i("InCallFragment.onClick", "end call button clicked"); + Logger.get(getContext()) + .logImpression(DialerImpression.Type.IN_CALL_DIALPAD_HANG_UP_BUTTON_PRESSED); inCallScreenDelegate.onEndCallClicked(); } else { LogUtil.e("InCallFragment.onClick", "unknown view: " + view); |