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

Commit 66b73dce authored by Julia Reynolds's avatar Julia Reynolds Committed by Android Git Automerger
Browse files

am f5e20ec3: Merge "Retrieve resources for apps, even if not installed for...

am f5e20ec3: Merge "Retrieve resources for apps, even if not installed for current user." into mnc-dev

* commit 'f5e20ec3':
  Retrieve resources for apps, even if not installed for current user.
parents 0e6360f4 f5e20ec3
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.DrawableRes;
import android.content.res.ColorStateList;
import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
@@ -294,7 +295,13 @@ public final class Icon implements Parcelable {
                    } else {
                        final PackageManager pm = context.getPackageManager();
                        try {
                            mObj1 = pm.getResourcesForApplication(resPackage);
                            ApplicationInfo ai = pm.getApplicationInfo(
                                    resPackage, PackageManager.GET_UNINSTALLED_PACKAGES);
                            if (ai != null) {
                                mObj1 = pm.getResourcesForApplication(ai);
                            } else {
                                break;
                            }
                        } catch (PackageManager.NameNotFoundException e) {
                            Log.e(TAG, String.format("Unable to find pkg=%s for icon %s",
                                    resPackage, this), e);