diff options
Diffstat (limited to 'java/com')
13 files changed, 109 insertions, 67 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 04545b5c7..01bdfc223 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -93,6 +93,7 @@ import com.android.dialer.app.widget.ActionBarController; import com.android.dialer.app.widget.SearchEditTextLayout; import com.android.dialer.callcomposer.CallComposerActivity; import com.android.dialer.calldetails.CallDetailsActivity; +import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.callintent.CallSpecificAppData; import com.android.dialer.common.Assert; @@ -305,8 +306,11 @@ public class DialtactsActivity extends TransactionSafeActivity mSmartDialSearchFragment.setQueryString(mSearchQuery); } else if (mRegularSearchFragment != null && mRegularSearchFragment.isVisible()) { mRegularSearchFragment.setQueryString(mSearchQuery); - } else if (mNewSearchFragment != null) { + } else if (mNewSearchFragment != null && mNewSearchFragment.isVisible()) { mNewSearchFragment.setQuery(mSearchQuery); + // When the user switches between dialpad and the serachbar, we need to reset the + // call initiation type. + mNewSearchFragment.setCallInitiationType(getCallInitiationType()); } } @@ -965,9 +969,10 @@ public class DialtactsActivity extends TransactionSafeActivity fragment.updatePosition(true /* animate */); } else if (mNewSearchFragment != null) { int animationDuration = getResources().getInteger(R.integer.dialpad_slide_in_duration); + int actionbarHeight = getResources().getDimensionPixelSize(R.dimen.action_bar_height_large); int shadowHeight = getResources().getDrawable(R.drawable.search_shadow).getIntrinsicHeight(); - int start = isDialpadShown() ? mActionBarHeight - shadowHeight : 0; - int end = isDialpadShown() ? 0 : mActionBarHeight - shadowHeight; + int start = isDialpadShown() ? actionbarHeight - shadowHeight : 0; + int end = isDialpadShown() ? 0 : actionbarHeight - shadowHeight; mNewSearchFragment.animatePosition(start, end, animationDuration); } } @@ -1209,6 +1214,7 @@ public class DialtactsActivity extends TransactionSafeActivity ((SearchFragment) fragment).setQueryString(query); } else if (useNewSearch) { ((NewSearchFragment) fragment).setQuery(query); + ((NewSearchFragment) fragment).setCallInitiationType(getCallInitiationType()); } transaction.commit(); @@ -1596,6 +1602,12 @@ public class DialtactsActivity extends TransactionSafeActivity return isMultiSelectModeEnabled; } + private CallInitiationType.Type getCallInitiationType() { + return mIsDialpadShown + ? CallInitiationType.Type.DIALPAD + : CallInitiationType.Type.REGULAR_SEARCH; + } + /** Popup menu accessible from the search bar */ protected class OptionsPopupMenu extends PopupMenu { diff --git a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java index 507a51af6..78c329a0e 100644 --- a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java +++ b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java @@ -39,6 +39,7 @@ class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper { .append(AnnotatedCallLog._ID + " integer primary key, ") .append(AnnotatedCallLog.TIMESTAMP + " integer, ") .append(AnnotatedCallLog.NAME + " string, ") + .append(AnnotatedCallLog.FORMATTED_NUMBER + " string, ") .append(AnnotatedCallLog.NEW + " integer, ") .append(AnnotatedCallLog.TYPE + " integer, ") .append(AnnotatedCallLog.CONTACT_PHOTO_URI + " string, ") diff --git a/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java b/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java index c669bdae5..be891c534 100644 --- a/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java +++ b/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java @@ -53,6 +53,13 @@ public class AnnotatedCallLogContract { String NAME = "name"; /** + * Copied from {@link android.provider.CallLog.Calls#CACHED_FORMATTED_NUMBER}. + * + * <p>Type: TEXT + */ + String FORMATTED_NUMBER = "formatted_number"; + + /** * Local photo URI for the contact associated with the phone number, if it exists. * * <p>Photos currently only come from local contacts database and not caller ID sources. If @@ -136,6 +143,7 @@ public class AnnotatedCallLogContract { _ID, TIMESTAMP, NAME, + FORMATTED_NUMBER, CONTACT_PHOTO_URI, NUMBER_TYPE_LABEL, IS_READ, @@ -213,14 +221,6 @@ public class AnnotatedCallLogContract { public static final String NUMBER_CALLS = "number_calls"; /** - * The phone number formatted in a way suitable for display to the user. This value is generated - * on the fly when the {@link CoalescedAnnotatedCallLog} is generated. - * - * <p>Type: TEXT - */ - public static final String FORMATTED_NUMBER = "formatted_number"; - - /** * The call types of the most recent 3 calls, encoded as a CallTypes proto. * * <p>TYPE: BLOB @@ -232,7 +232,7 @@ public class AnnotatedCallLogContract { * AnnotatedCallLog}. */ private static final String[] COLUMNS_ONLY_IN_COALESCED_CALL_LOG = - new String[] {NUMBER_CALLS, FORMATTED_NUMBER, CALL_TYPES}; + new String[] {NUMBER_CALLS, CALL_TYPES}; /** All columns in the {@link CoalescedAnnotatedCallLog}. */ public static final String[] ALL_COLUMNS = diff --git a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java index 7bf2972c5..e4af4170c 100644 --- a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +++ b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java @@ -38,7 +38,6 @@ import android.telecom.PhoneAccountHandle; import android.text.TextUtils; import android.util.ArraySet; import com.android.dialer.CallTypes; -import com.android.dialer.DialerPhoneNumber; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.CoalescedAnnotatedCallLog; import com.android.dialer.calllog.datasources.CallLogDataSource; @@ -52,7 +51,6 @@ import com.android.dialer.phonenumberproto.DialerPhoneNumberUtil; import com.android.dialer.theme.R; import com.android.dialer.util.PermissionsUtil; import com.google.i18n.phonenumbers.PhoneNumberUtil; -import com.google.protobuf.InvalidProtocolBufferException; import java.util.Arrays; import java.util.List; import java.util.Set; @@ -160,18 +158,9 @@ public class SystemCallLogDataSource implements CallLogDataSource { .useMostRecentLong(AnnotatedCallLog.NEW) .useMostRecentString(AnnotatedCallLog.NUMBER_TYPE_LABEL) .useMostRecentString(AnnotatedCallLog.GEOCODED_LOCATION) + .useMostRecentString(AnnotatedCallLog.FORMATTED_NUMBER) .combine(); - // All phone numbers in the provided group should be equivalent (but could be formatted - // differently). Arbitrarily show the raw phone number of the most recent call. - DialerPhoneNumber mostRecentPhoneNumber = - getMostRecentPhoneNumber(individualRowsSortedByTimestampDesc); - if (mostRecentPhoneNumber != null) { - coalescedValues.put( - CoalescedAnnotatedCallLog.FORMATTED_NUMBER, - mostRecentPhoneNumber.getRawInput().getNumber()); - } - CallTypes.Builder callTypes = CallTypes.newBuilder(); // Store a maximum of 3 call types since that's all we show to users via icons. for (int i = 0; i < 3 && i < individualRowsSortedByTimestampDesc.size(); i++) { @@ -183,23 +172,6 @@ public class SystemCallLogDataSource implements CallLogDataSource { return coalescedValues; } - @Nullable - private static DialerPhoneNumber getMostRecentPhoneNumber( - List<ContentValues> individualRowsSortedByTimestampDesc) { - byte[] protoBytes = - individualRowsSortedByTimestampDesc.get(0).getAsByteArray(AnnotatedCallLog.NUMBER); - if (protoBytes == null) { - return null; - } - DialerPhoneNumber dialerPhoneNumber; - try { - dialerPhoneNumber = DialerPhoneNumber.parseFrom(protoBytes); - } catch (InvalidProtocolBufferException e) { - throw Assert.createAssertionFailException("couldn't parse DialerPhoneNumber", e); - } - return dialerPhoneNumber; - } - @TargetApi(Build.VERSION_CODES.M) // Uses try-with-resources private void handleInsertsAndUpdates( Context appContext, CallLogMutations mutations, Set<Long> existingAnnotatedCallLogIds) { @@ -223,6 +195,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { Calls.NUMBER, Calls.TYPE, Calls.COUNTRY_ISO, + Calls.CACHED_FORMATTED_NUMBER, Calls.CACHED_NUMBER_TYPE, Calls.CACHED_NUMBER_LABEL, Calls.IS_READ, @@ -253,6 +226,8 @@ public class SystemCallLogDataSource implements CallLogDataSource { int numberColumn = cursor.getColumnIndexOrThrow(Calls.NUMBER); int typeColumn = cursor.getColumnIndexOrThrow(Calls.TYPE); int countryIsoColumn = cursor.getColumnIndexOrThrow(Calls.COUNTRY_ISO); + int cachedFormattedNumberColumn = + cursor.getColumnIndexOrThrow(Calls.CACHED_FORMATTED_NUMBER); int cachedNumberTypeColumn = cursor.getColumnIndexOrThrow(Calls.CACHED_NUMBER_TYPE); int cachedNumberLabelColumn = cursor.getColumnIndexOrThrow(Calls.CACHED_NUMBER_LABEL); int isReadColumn = cursor.getColumnIndexOrThrow(Calls.IS_READ); @@ -272,7 +247,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { String numberAsStr = cursor.getString(numberColumn); long type = cursor.getType(typeColumn); String countryIso = cursor.getString(countryIsoColumn); - // TODO(zachh): Decide if should use "cached" columns from call log or recompute. + String formattedNumber = cursor.getString(cachedFormattedNumberColumn); int cachedNumberType = cursor.getInt(cachedNumberTypeColumn); String cachedNumberLabel = cursor.getString(cachedNumberLabelColumn); int isRead = cursor.getInt(isReadColumn); @@ -293,6 +268,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { } contentValues.put(AnnotatedCallLog.TYPE, type); + contentValues.put(AnnotatedCallLog.FORMATTED_NUMBER, formattedNumber); // Phone.getTypeLabel returns "Custom" if given (0, null) which is not of any use. Just // omit setting the label if there's no information for it. diff --git a/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java b/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java index f45ac27b9..51a55328e 100644 --- a/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java +++ b/java/com/android/dialer/calllog/ui/CoalescedAnnotatedCallLogCursorLoader.java @@ -31,18 +31,18 @@ final class CoalescedAnnotatedCallLogCursorLoader extends CursorLoader { private static final int TIMESTAMP = 1; private static final int NAME = 2; - private static final int CONTACT_PHOTO_URI = 3; - private static final int NUMBER_TYPE_LABEL = 4; - private static final int IS_READ = 5; - private static final int NEW = 6; - private static final int GEOCODED_LOCATION = 7; - private static final int PHONE_ACCOUNT_LABEL = 8; - private static final int PHONE_ACCOUNT_COLOR = 9; - private static final int FEATURES = 10; - private static final int IS_BUSINESS = 11; - private static final int IS_VOICEMAIL = 12; - private static final int NUMBER_CALLS = 13; - private static final int FORMATTED_NUMBER = 14; + private static final int FORMATTED_NUMBER = 3; + private static final int CONTACT_PHOTO_URI = 4; + private static final int NUMBER_TYPE_LABEL = 5; + private static final int IS_READ = 6; + private static final int NEW = 7; + private static final int GEOCODED_LOCATION = 8; + private static final int PHONE_ACCOUNT_LABEL = 9; + private static final int PHONE_ACCOUNT_COLOR = 10; + private static final int FEATURES = 11; + private static final int IS_BUSINESS = 12; + private static final int IS_VOICEMAIL = 13; + private static final int NUMBER_CALLS = 14; private static final int CALL_TYPES = 15; /** Convenience class for accessing values using an abbreviated syntax. */ 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/dialer/searchfragment/cp2/SearchContactsCursorLoader.java b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java index d75a66122..84fd64ae5 100644 --- a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java @@ -20,12 +20,16 @@ import android.content.Context; import android.content.CursorLoader; import android.database.Cursor; import android.provider.ContactsContract.CommonDataKinds.Phone; +import android.support.annotation.Nullable; import com.android.dialer.searchfragment.common.Projections; /** Cursor Loader for CP2 contacts. */ public final class SearchContactsCursorLoader extends CursorLoader { - public SearchContactsCursorLoader(Context context) { + private final String query; + + /** @param query Contacts cursor will be filtered based on this query. */ + public SearchContactsCursorLoader(Context context, @Nullable String query) { super( context, Phone.CONTENT_URI, @@ -33,6 +37,7 @@ public final class SearchContactsCursorLoader extends CursorLoader { null, null, Phone.SORT_KEY_PRIMARY + " ASC"); + this.query = query; } @Override @@ -40,7 +45,7 @@ public final class SearchContactsCursorLoader extends CursorLoader { // All contacts Cursor cursor = super.loadInBackground(); // Filtering logic - ContactFilterCursor contactFilterCursor = new ContactFilterCursor(cursor, null); + ContactFilterCursor contactFilterCursor = new ContactFilterCursor(cursor, query); // Header logic return SearchContactsCursor.newInstnace(getContext(), contactFilterCursor); } diff --git a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java index 7d355c91c..7fee9699a 100644 --- a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java +++ b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java @@ -34,6 +34,7 @@ import android.view.ViewGroup; import android.view.animation.Interpolator; import com.android.contacts.common.extensions.PhoneDirectoryExtenderAccessor; import com.android.dialer.animation.AnimUtils; +import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.ThreadUtil; @@ -77,6 +78,7 @@ public final class NewSearchFragment extends Fragment private RecyclerView recyclerView; private SearchAdapter adapter; private String query; + private CallInitiationType.Type callInitiationType = CallInitiationType.Type.UNKNOWN_INITIATION; private boolean remoteDirectoriesDisabledForTesting; private final List<Directory> directories = new ArrayList<>(); @@ -94,6 +96,7 @@ public final class NewSearchFragment extends Fragment LayoutInflater inflater, @Nullable ViewGroup parent, @Nullable Bundle bundle) { View view = inflater.inflate(R.layout.fragment_search, parent, false); adapter = new SearchAdapter(getActivity(), new SearchCursorManager()); + adapter.setCallInitiationType(callInitiationType); emptyContentView = view.findViewById(R.id.empty_view); recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); @@ -123,9 +126,8 @@ public final class NewSearchFragment extends Fragment @Override public Loader<Cursor> onCreateLoader(int id, Bundle bundle) { - // TODO(calderwoodra) add enterprise loader if (id == CONTACTS_LOADER_ID) { - return new SearchContactsCursorLoader(getContext()); + return new SearchContactsCursorLoader(getContext(), query); } else if (id == NEARBY_PLACES_LOADER_ID) { return new NearbyPlacesCursorLoader(getContext(), query); } else if (id == REMOTE_DIRECTORIES_LOADER_ID) { @@ -182,6 +184,13 @@ public final class NewSearchFragment extends Fragment } } + public void setCallInitiationType(CallInitiationType.Type callInitiationType) { + this.callInitiationType = callInitiationType; + if (adapter != null) { + adapter.setCallInitiationType(callInitiationType); + } + } + public void animatePosition(int start, int end, int duration) { // Called before the view is ready, prepare a runnable to run in onCreateView if (getView() == null) { diff --git a/java/com/android/dialer/searchfragment/list/SearchAdapter.java b/java/com/android/dialer/searchfragment/list/SearchAdapter.java index 4cb44a2db..f08d60e09 100644 --- a/java/com/android/dialer/searchfragment/list/SearchAdapter.java +++ b/java/com/android/dialer/searchfragment/list/SearchAdapter.java @@ -25,7 +25,6 @@ import android.view.LayoutInflater; import android.view.ViewGroup; import com.android.dialer.callcomposer.CallComposerActivity; import com.android.dialer.callintent.CallInitiationType; -import com.android.dialer.callintent.CallInitiationType.Type; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.callintent.CallSpecificAppData; import com.android.dialer.common.Assert; @@ -51,6 +50,7 @@ public final class SearchAdapter extends RecyclerView.Adapter<ViewHolder> private final Activity activity; private String query; + private CallInitiationType.Type callInitiationType = CallInitiationType.Type.UNKNOWN_INITIATION; @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public SearchAdapter(Activity activity, SearchCursorManager searchCursorManager) { @@ -124,6 +124,10 @@ public final class SearchAdapter extends RecyclerView.Adapter<ViewHolder> } } + void setCallInitiationType(CallInitiationType.Type callInitiationType) { + this.callInitiationType = callInitiationType; + } + public void setNearbyPlacesCursor(SearchCursor nearbyPlacesCursor) { if (searchCursorManager.setNearbyPlacesCursor(nearbyPlacesCursor)) { notifyDataSetChanged(); @@ -149,7 +153,7 @@ public final class SearchAdapter extends RecyclerView.Adapter<ViewHolder> private void placeCall(String phoneNumber, int position, boolean isVideoCall) { CallSpecificAppData callSpecificAppData = CallSpecificAppData.newBuilder() - .setCallInitiationType(getCallInitiationType()) + .setCallInitiationType(callInitiationType) .setPositionOfSelectedSearchResult(position) .setCharactersInSearchString(query == null ? 0 : query.length()) .build(); @@ -172,9 +176,4 @@ public final class SearchAdapter extends RecyclerView.Adapter<ViewHolder> Intent intent = CallComposerActivity.newIntent(activity, contact); DialerUtils.startActivityWithErrorToast(activity, intent); } - - private CallInitiationType.Type getCallInitiationType() { - // TODO(calderwoodra): add correct initiation type - return Type.REGULAR_SEARCH; - } } 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); |