Allow omission of RES_PACKAGE for status attributions.
FastTrack was being overly cautious about attribution labels
coming from third-party sources. When no RES_PACKAGE is
defined, we now fall back to using the local package instead
of completely dropping the attribution line.
Fixes http://b/2175531
diff --git a/src/com/android/contacts/util/DataStatus.java b/src/com/android/contacts/util/DataStatus.java
index 9d12894..88c6594 100644
--- a/src/com/android/contacts/util/DataStatus.java
+++ b/src/com/android/contacts/util/DataStatus.java
@@ -98,6 +98,9 @@
public CharSequence getTimestampLabel(Context context) {
final PackageManager pm = context.getPackageManager();
+ // Use local package for resources when none requested
+ if (mResPackage == null) mResPackage = context.getPackageName();
+
final boolean validTimestamp = mTimestamp > 0;
final boolean validLabel = mResPackage != null && mLabelRes != -1;
@@ -124,6 +127,10 @@
public Drawable getIcon(Context context) {
final PackageManager pm = context.getPackageManager();
+
+ // Use local package for resources when none requested
+ if (mResPackage == null) mResPackage = context.getPackageName();
+
final boolean validIcon = mResPackage != null && mIconRes != -1;
return validIcon ? pm.getDrawable(mResPackage, mIconRes, null) : null;
}