Do DataUsageFeedback update after starting ACTION_CALL
In QuickContactActivity, when clicking the Call button,
DataUsageFeedback update blocks the starting of ACTION_CALL
for 30-60ms.
"DataUsageFeedback update" and "ACTION_CALL" doesn't interfere with
each other. So it is harmless to update the DataUsageFeedback after
starting CallActivity.
Benefit:
Reduces 30-60ms of time needed to bring up the dialing UI.
Change-Id: I8a349b43c63f70724c89152a9e251f5a2230556f
Signed-off-by: LIANGTAO GAO <w20048@motorola.com>
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 3584fa8..9633716 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -340,6 +340,31 @@
return;
}
+ // Pass the touch point through the intent for use in the InCallUI
+ if (Intent.ACTION_CALL.equals(intent.getAction())) {
+ if (TouchPointManager.getInstance().hasValidPoint()) {
+ Bundle extras = new Bundle();
+ extras.putParcelable(TouchPointManager.TOUCH_POINT,
+ TouchPointManager.getInstance().getPoint());
+ intent.putExtra(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, extras);
+ }
+ }
+
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ mHasIntentLaunched = true;
+ try {
+ startActivity(intent);
+ } catch (SecurityException ex) {
+ Toast.makeText(QuickContactActivity.this, R.string.missing_app,
+ Toast.LENGTH_SHORT).show();
+ Log.e(TAG, "QuickContacts does not have permission to launch "
+ + intent);
+ } catch (ActivityNotFoundException ex) {
+ Toast.makeText(QuickContactActivity.this, R.string.missing_app,
+ Toast.LENGTH_SHORT).show();
+ }
+
// Default to USAGE_TYPE_CALL. Usage is summed among all types for sorting each data id
// so the exact usage type is not necessary in all cases
String usageType = DataUsageFeedback.USAGE_TYPE_CALL;