Merge "Add menu items for multi-sim support"
diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml
index 5727d8a..aa4ce94 100644
--- a/res/layout/dialtacts_activity.xml
+++ b/res/layout/dialtacts_activity.xml
@@ -41,7 +41,6 @@
android:id="@+id/floating_action_button_container"
android:layout_width="@dimen/floating_action_button_width"
android:layout_height="@dimen/floating_action_button_height"
- android:layout_marginRight="@dimen/floating_action_button_margin_right"
android:layout_marginBottom="@dimen/floating_action_button_margin_bottom"
android:layout_gravity="center_horizontal|bottom" >
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e5c6795..18f0694 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -78,21 +78,6 @@
<dimen name="dismiss_button_padding_start">20dip</dimen>
<dimen name="dismiss_button_padding_end">28dip</dimen>
- <!-- Padding above the favorites menu. -->
- <dimen name="favorites_menu_padding_top">6dp</dimen>
- <!-- Padding below the favorites menu.. -->
- <dimen name="favorites_menu_padding_bottom">3dp</dimen>
- <!-- Horizontal padding in the favorites menu. -->
- <dimen name="favorites_menu_padding_horizontal">8dp</dimen>
- <!-- Text size for the "speed dial" text in the favorites menu. -->
- <dimen name="favorites_menu_speed_dial_text_size">18sp</dimen>
- <!-- Height of the speed dial TextView in the favorites menu. -->
- <dimen name="favorites_menu_speed_dial_height">24dp</dimen>
- <!-- Text size for the "All Contacts" text in the favorites menu. -->
- <dimen name="favorites_menu_all_contacts_text_size">12sp</dimen>
- <!-- Height of the all contacts Button in the favorites menu. -->
- <dimen name="favorites_menu_all_contacts_height">24dp</dimen>
-
<!-- Height of the actionBar - this is 8dps bigger than the platform standard to give more
room to the search box-->
<dimen name="action_bar_height">64dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 98f90d2..7513b50 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -616,24 +616,12 @@
<!-- Remove button that shows up when contact is long-pressed. [CHAR LIMIT=NONE] -->
<string name="remove_contact">Remove</string>
- <!-- Header text displayed on the main dialer screen above the list of favorite phone numbers.
- [CHAR LIMIT=21] -->
- <string name="favorites_menu_speed_dial">Speed Dial</string>
-
<!-- Button text for the "all contacts" button displayed on the main dialer screen above the
list of favorite phone numbers. Navigates the user to the "All Contacts" list.
This text represents the same action as the text in string "menu_allContacts".
[CHAR LIMIT=21] -->
<string name="favorites_menu_all_contacts">ALL CONTACTS</string>
- <!-- The font-family to use for the "speed dial" label on the favorites menu.
- Do not translate. -->
- <string name="favorites_menu_speed_dial_font_family">sans-serif-light</string>
-
- <!-- The font-family to use for the "all contacts" label on the favorites menu.
- Do not translate. -->
- <string name="favorites_menu_all_contacts_font_family">sans-serif</string>
-
<!-- Button text for the "call back" button displayed underneath an entry in the call log.
Tapping causes a call to be placed to the caller represented by the call log entry.
[CHAR LIMIT=30] -->
@@ -703,7 +691,7 @@
<!-- String used as a header in the call log above calls which occurred more than a week ago.
[CHAR LIMIT=65] -->
- <string name="call_log_header_other">Other</string>
+ <string name="call_log_header_other">Older</string>
<!-- String a header on the call details screen. Appears above the list calls to or from a
particular number.
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java
index 2604bf0..bb74cba 100644
--- a/src/com/android/dialer/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/PhoneCallDetailsHelper.java
@@ -139,8 +139,7 @@
mDescriptionItems.add(getCallDate(details));
// Create a comma separated list from the call type or location, and call date.
- // TextUtils.join ensures a locale appropriate list separator is used.
- return TextUtils.join((List<CharSequence>)mDescriptionItems);
+ return TextUtils.join(", " , mDescriptionItems);
}
/**
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 4b1aeab..249c30c 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -1096,7 +1096,9 @@
values.put(Calls.CACHED_LOOKUP_URI, UriUtils.uriToString(updatedInfo.lookupUri));
needsUpdate = true;
}
- if (!TextUtils.equals(updatedInfo.normalizedNumber, callLogInfo.normalizedNumber)) {
+ // Only replace the normalized number if the new updated normalized number isn't empty.
+ if (!TextUtils.isEmpty(updatedInfo.normalizedNumber) &&
+ !TextUtils.equals(updatedInfo.normalizedNumber, callLogInfo.normalizedNumber)) {
values.put(Calls.CACHED_NORMALIZED_NUMBER, updatedInfo.normalizedNumber);
needsUpdate = true;
}
diff --git a/src/com/android/dialer/calllog/CallTypeIconsView.java b/src/com/android/dialer/calllog/CallTypeIconsView.java
index 7c8afee..afbced4 100644
--- a/src/com/android/dialer/calllog/CallTypeIconsView.java
+++ b/src/com/android/dialer/calllog/CallTypeIconsView.java
@@ -17,17 +17,15 @@
package com.android.dialer.calllog;
import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
-import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.provider.CallLog.Calls;
import android.util.AttributeSet;
import android.view.View;
import com.android.contacts.common.testing.NeededForTesting;
+import com.android.contacts.common.util.BitmapUtil;
import com.android.dialer.R;
import com.google.common.collect.Lists;
@@ -156,7 +154,7 @@
incoming.setColorFilter(r.getColor(R.color.answered_call), PorterDuff.Mode.MULTIPLY);
// Create a rotated instance of the call arrow for outgoing calls.
- outgoing = getRotatedDrawable(r, R.drawable.ic_call_arrow, 180f);
+ outgoing = BitmapUtil.getRotatedDrawable(r, R.drawable.ic_call_arrow, 180f);
outgoing.setColorFilter(r.getColor(R.color.answered_call), PorterDuff.Mode.MULTIPLY);
// Need to make a copy of the arrow drawable, otherwise the same instance colored
@@ -167,29 +165,5 @@
voicemail = r.getDrawable(R.drawable.ic_call_voicemail_holo_dark);
iconMargin = r.getDimensionPixelSize(R.dimen.call_log_icon_margin);
}
-
- /**
- * Retrieves a copy of the specified drawable resource, rotated by a specified angle.
- *
- * @param resources The current resources.
- * @param resourceId The resource ID of the drawable to rotate.
- * @param angle The angle of rotation.
- * @return Rotated drawable.
- */
- private Drawable getRotatedDrawable(
- android.content.res.Resources resources, int resourceId, float angle) {
-
- // Get the original drawable and make a copy which will be rotated.
- Bitmap original = BitmapFactory.decodeResource(resources, resourceId);
- Bitmap rotated = Bitmap.createBitmap(
- original.getWidth(), original.getHeight(), Bitmap.Config.ARGB_8888);
-
- // Perform the rotation.
- Canvas tempCanvas = new Canvas(rotated);
- tempCanvas.rotate(angle, original.getWidth()/2, original.getHeight()/2);
- tempCanvas.drawBitmap(original, 0, 0, null);
-
- return new BitmapDrawable(resources,rotated);
- }
}
}
diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java
index 5d99ef4..1bebfc4 100644
--- a/src/com/android/dialer/calllog/ContactInfoHelper.java
+++ b/src/com/android/dialer/calllog/ContactInfoHelper.java
@@ -101,6 +101,8 @@
updatedInfo = new ContactInfo();
updatedInfo.number = number;
updatedInfo.formattedNumber = formatPhoneNumber(number, null, countryIso);
+ updatedInfo.normalizedNumber = PhoneNumberUtils.formatNumberToE164(
+ number, countryIso);
updatedInfo.lookupUri = createTemporaryContactUri(updatedInfo.formattedNumber);
} else {
updatedInfo = info;