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

Commit 157a3f98 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

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
parent f1a4b507
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.pm.PackageManager;
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 @@ public final class ForegroundServicesDialog extends AlertActivity implements
    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 @@ public final class ForegroundServicesDialog extends AlertActivity implements
            }

            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));