Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public static int analyze(Context context, String packageName, int defaultColor)
boolean adjust = false;
try {
PackageManager pm = context.getPackageManager();
ApplicationInfo info = pm.getApplicationInfo(packageName, 0);

// This flag allows to query apps on the work profile as well
ApplicationInfo info = pm.getApplicationInfo(packageName, PackageManager.MATCH_UNINSTALLED_PACKAGES);
if (!packageName.equals(BuildConfig.APPLICATION_ID) && (info.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) == 0) {
// Average color from icon
adjust = true;
Expand Down Expand Up @@ -71,6 +73,7 @@ public static int analyze(Context context, String packageName, int defaultColor)
hsv[2] = 1.0f;
color = Color.HSVToColor(255, hsv);
}
colorMap.put(packageName, color);
} else {
color = cached;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import android.os.Looper;
import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.service.notification.StatusBarNotification;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
Expand Down Expand Up @@ -456,7 +457,16 @@ private synchronized void handleLEDNotificationsInternal() {
if (not.getChannelId() != null) {
channelName = sanitizeChannelId(not.getChannelId());

List<NotificationChannel> chans = getNotificationChannels(sbn.getPackageName(), Process.myUserHandle());
// Get a list of all users (to read Work Profile notifications)
final UserManager um = (UserManager) getBaseContext().getSystemService(Context.USER_SERVICE);
List<UserHandle> list = um.getUserProfiles();

// Flatten a list of everything available
List<NotificationChannel> chans = new ArrayList<>();
for (UserHandle userHandle : list) {
chans.addAll(getNotificationChannels(sbn.getPackageName(), userHandle));
}

for (NotificationChannel chan : chans) {
if (chan.getId().equals(not.getChannelId())) {
if (Build.VERSION.SDK_INT >= 29) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public void loadAppItems(Map<String, Settings.PackageColor> packagesChannelsAndC
}

List<AppItem> target = found != null ? activeItems : inactiveItems;
ApplicationInfo info = pm.getApplicationInfo(packageColor.packageName, 0);
ApplicationInfo info = pm.getApplicationInfo(packageColor.packageName, PackageManager.MATCH_UNINSTALLED_PACKAGES);
target.add(new AppItem(
getLabel(pm, info),
packageColor.packageName,
Expand Down