More work on issue #36891897: Need to ensure foreground...

...services can't hide themselves

Add trick to put a shadow around adaptive app icons, so in our
dialog's white background we don't end up not missing the circle
around the icon.

Test: manual

Change-Id: I7f2d908250eaf969d6f8d859c1567d5b4e0830ee
diff --git a/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java b/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java
index 086e5e5..49e780c 100644
--- a/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java
@@ -26,6 +26,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.provider.Settings;
+import android.util.IconDrawableFactory;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -159,11 +160,13 @@
     static private class PackageItemAdapter extends ArrayAdapter<ApplicationInfo> {
         final PackageManager mPm;
         final LayoutInflater mInflater;
+        final IconDrawableFactory mIconDrawableFactory;
 
         public PackageItemAdapter(Context context) {
             super(context, R.layout.foreground_service_item);
             mPm = context.getPackageManager();
             mInflater = LayoutInflater.from(context);
+            mIconDrawableFactory = IconDrawableFactory.newInstance(context, true);
         }
 
         public void setPackages(String[] packages) {
@@ -193,7 +196,7 @@
             }
 
             ImageView icon = view.findViewById(R.id.app_icon);
-            icon.setImageDrawable(getItem(position).loadIcon(mPm));
+            icon.setImageDrawable(mIconDrawableFactory.getBadgedIcon(getItem(position)));
 
             TextView label = view.findViewById(R.id.app_name);
             label.setText(getItem(position).loadLabel(mPm));