OSDN Git Service

Allow omission of RES_PACKAGE for status attributions.
authorJeff Sharkey <jsharkey@android.com>
Thu, 8 Oct 2009 17:22:30 +0000 (10:22 -0700)
committerJeff Sharkey <jsharkey@android.com>
Thu, 8 Oct 2009 17:54:00 +0000 (10:54 -0700)
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

src/com/android/contacts/util/DataStatus.java

index 9d12894..88c6594 100644 (file)
@@ -98,6 +98,9 @@ public class DataStatus {
     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 class DataStatus {
 
     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;
     }