Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7da2d0f authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

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
parent 43455184
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;
    }