summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/dialer/DialtactsActivity.java18
-rw-r--r--src/com/android/dialer/util/DialerUtils.java14
2 files changed, 32 insertions, 0 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 5a76ffa74..12c52da9c 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -65,6 +65,7 @@ import android.widget.Toast;
import com.android.contacts.common.CallUtil;
import com.android.contacts.common.dialog.ClearFrequentsDialog;
import com.android.contacts.common.interactions.ImportExportDialogFragment;
+import com.android.contacts.common.interactions.TouchPointManager;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
import com.android.contacts.common.widget.FloatingActionButtonController;
import com.android.dialer.activity.TransactionSafeActivity;
@@ -89,6 +90,7 @@ import com.android.dialer.widget.ActionBarController;
import com.android.dialer.widget.SearchEditTextLayout;
import com.android.dialer.widget.SearchEditTextLayout.OnBackButtonClickedListener;
import com.android.dialerbind.DatabaseHelperManager;
+import com.android.incallui.CallCardFragment;
import com.android.phone.common.animation.AnimUtils;
import com.android.phone.common.animation.AnimationListenerAdapter;
@@ -100,6 +102,7 @@ import java.util.Locale;
* The dialer tab's title is 'phone', a more common name (see strings.xml).
*/
public class DialtactsActivity extends TransactionSafeActivity implements View.OnClickListener,
+ View.OnTouchListener,
DialpadFragment.OnDialpadQueryChangedListener,
OnListFragmentScrolledListener,
DialpadFragment.HostInterface,
@@ -387,6 +390,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
int floatingActionButtonWidth = resources.getDimensionPixelSize(
R.dimen.floating_action_button_width);
mFloatingActionButton.setOnClickListener(this);
+ mFloatingActionButton.setOnTouchListener(this);
mFloatingActionButtonController = new FloatingActionButtonController(this,
floatingActionButtonContainer);
mFloatingActionButtonDialpadMarginBottomOffset = resources.getDimensionPixelOffset(
@@ -463,6 +467,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
if (!mIsDialpadShown) {
maybeExitSearchUi();
}
+
+ recordTouchEvent(v, event);
return false;
}
});
@@ -564,6 +570,18 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
@Override
+ public boolean onTouch(View view, MotionEvent event) {
+ recordTouchEvent(view, event);
+ return false;
+ }
+
+ private void recordTouchEvent(View view, MotionEvent event) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ TouchPointManager.getInstance().setPoint((int) event.getRawX(), (int) event.getRawY());
+ }
+ }
+
+ @Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_history:
diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java
index e24b642eb..7f6e75b57 100644
--- a/src/com/android/dialer/util/DialerUtils.java
+++ b/src/com/android/dialer/util/DialerUtils.java
@@ -23,8 +23,11 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
+import android.graphics.Point;
import android.net.Uri;
+import android.os.Bundle;
import android.provider.Telephony;
+import android.telecomm.TelecommManager;
import android.text.TextUtils;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
@@ -33,7 +36,10 @@ import android.widget.TextView;
import android.widget.Toast;
import com.android.contacts.common.CallUtil;
+import com.android.contacts.common.interactions.TouchPointManager;
import com.android.dialer.R;
+import com.android.incallui.CallCardFragment;
+import com.android.incallui.Log;
import java.util.List;
import java.util.Locale;
@@ -66,6 +72,14 @@ public class DialerUtils {
public static void startActivityWithErrorToast(Context context, Intent intent, int msgId) {
try {
if (Intent.ACTION_CALL.equals(intent.getAction())) {
+ // All dialer-initiated calls should pass the touch point to the InCallUI
+ Point touchPoint = TouchPointManager.getInstance().getPoint();
+ if (touchPoint.x != 0 || touchPoint.y != 0) {
+ Bundle extras = new Bundle();
+ extras.putParcelable(TouchPointManager.TOUCH_POINT, touchPoint);
+ intent.putExtra(TelecommManager.EXTRA_OUTGOING_CALL_EXTRAS, extras);
+ }
+
((Activity) context).startActivityForResult(intent, 0);
} else {
context.startActivity(intent);