Merge "Change AOSP Contacts app version to 1.7.10." into oc-dev
diff --git a/src/com/android/contacts/DynamicShortcuts.java b/src/com/android/contacts/DynamicShortcuts.java
index 98e725f..e287e4a 100644
--- a/src/com/android/contacts/DynamicShortcuts.java
+++ b/src/com/android/contacts/DynamicShortcuts.java
@@ -406,9 +406,9 @@
// If on O or higher, add padding around the bitmap.
final int paddingW = (int) (bitmap.getWidth() *
- AdaptiveIconDrawable.getExtraInsetPercentage());
+ AdaptiveIconDrawable.getExtraInsetFraction());
final int paddingH = (int) (bitmap.getHeight() *
- AdaptiveIconDrawable.getExtraInsetPercentage());
+ AdaptiveIconDrawable.getExtraInsetFraction());
final Bitmap scaledBitmap = Bitmap.createBitmap(bitmap.getWidth() + paddingW,
bitmap.getHeight() + paddingH, bitmap.getConfig());
@@ -426,7 +426,7 @@
if (BuildCompat.isAtLeastO()) {
// Add padding on >= O
padding = (int) (RECOMMENDED_ICON_PIXEL_LENGTH *
- AdaptiveIconDrawable.getExtraInsetPercentage());
+ AdaptiveIconDrawable.getExtraInsetFraction());
width = RECOMMENDED_ICON_PIXEL_LENGTH + padding;
height = RECOMMENDED_ICON_PIXEL_LENGTH + padding;
} else {
diff --git a/src/com/android/contacts/ShortcutIntentBuilder.java b/src/com/android/contacts/ShortcutIntentBuilder.java
index 76ef08f..3a0b36b 100644
--- a/src/com/android/contacts/ShortcutIntentBuilder.java
+++ b/src/com/android/contacts/ShortcutIntentBuilder.java
@@ -432,7 +432,7 @@
// On >= O scale image up by AdaptiveIconDrawable.DEFAULT_VIEW_PORT_SCALE.
final int scale = (int) (icon.getHeight() *
- (1f / (1 + 2 * AdaptiveIconDrawable.getExtraInsetPercentage())));
+ (1f / (1 + 2 * AdaptiveIconDrawable.getExtraInsetFraction())));
final Bitmap scaledBitmap = Bitmap.createBitmap(icon.getWidth() + scale,
icon.getHeight() + scale, icon.getConfig());
Canvas scaledCanvas = new Canvas(scaledBitmap);
diff --git a/src/com/android/contacts/logging/ScreenEvent.java b/src/com/android/contacts/logging/ScreenEvent.java
index 9edcbc7..bdea66d 100644
--- a/src/com/android/contacts/logging/ScreenEvent.java
+++ b/src/com/android/contacts/logging/ScreenEvent.java
@@ -31,8 +31,8 @@
public static final int ALL_CONTACTS = 4;
public static final int QUICK_CONTACT = 5;
public static final int EDITOR = 6;
- public static final int LIST_ACCOUNT = 7;
- public static final int LIST_GROUP = 8;
- public static final int ME_CONTACT = 9;
+ public static final int LIST_ACCOUNT = 8;
+ public static final int LIST_GROUP = 9;
+ public static final int ME_CONTACT = 10;
}
}
diff --git a/src/com/android/contacts/model/AccountTypeManager.java b/src/com/android/contacts/model/AccountTypeManager.java
index 280d859..b442e4f 100644
--- a/src/com/android/contacts/model/AccountTypeManager.java
+++ b/src/com/android/contacts/model/AccountTypeManager.java
@@ -580,9 +580,9 @@
if (account == null) {
return null;
}
- final AccountType type = mTypeProvider.getTypeForAccount(account);
+ AccountType type = mTypeProvider.getTypeForAccount(account);
if (type == null) {
- return null;
+ type = mFallbackAccountType;
}
return type.wrapAccount(mContext, account);
}
@@ -703,7 +703,8 @@
*/
@Override
public AccountType getAccountType(AccountTypeWithDataSet accountTypeWithDataSet) {
- return mTypeProvider.getType(
+ final AccountType type = mTypeProvider.getType(
accountTypeWithDataSet.accountType, accountTypeWithDataSet.dataSet);
+ return type != null ? type : mFallbackAccountType;
}
}
diff --git a/src/com/android/contacts/model/account/FallbackAccountType.java b/src/com/android/contacts/model/account/FallbackAccountType.java
index 907fce4..288a917 100644
--- a/src/com/android/contacts/model/account/FallbackAccountType.java
+++ b/src/com/android/contacts/model/account/FallbackAccountType.java
@@ -93,4 +93,18 @@
public boolean areContactsWritable() {
return true;
}
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>This is overriden because the base class validates that the account.type matches
+ * {@link #accountType} but for the fallback case we want to be more permissive</p>
+ */
+ @Override
+ public AccountInfo wrapAccount(Context context, AccountWithDataSet account) {
+ return new AccountInfo(
+ new AccountDisplayInfo(account, account.name,
+ getDisplayLabel(context), getDisplayIcon(context), false), this);
+ }
}