Loading core/java/android/app/Profile.java +6 −2 Original line number Diff line number Diff line Loading @@ -83,10 +83,14 @@ public class Profile implements Parcelable { /** @hide */ public void addProfileGroup(ProfileGroup value) { profileGroups.put(value.getUuid(), value); if (value.isDefaultGroup()) { /* we must not have more than one default group */ if (mDefaultGroup != null) { return; } mDefaultGroup = value; } profileGroups.put(value.getUuid(), value); mDirty = true; } Loading core/java/android/app/ProfileGroup.java +18 −7 Original line number Diff line number Diff line Loading @@ -80,20 +80,31 @@ public class ProfileGroup implements Parcelable { } /** @hide */ public boolean matches(NotificationGroup group) { public boolean matches(NotificationGroup group, boolean defaultGroup) { if (mUuid.equals(group.getUuid())) { return true; } /* second try: match name for backwards compat */ /* fallback matches for backwards compatibility */ boolean matches = false; /* fallback attempt 1: match name */ if (mName != null && mName.equals(group.getName())) { matches = true; /* fallback attempt 2: match for the 'defaultGroup' flag to match the wildcard group */ } else if (mDefaultGroup && defaultGroup) { matches = true; } if (!matches) { return false; } mName = null; mUuid = group.getUuid(); mDirty = true; return true; } return false; return true; } public UUID getUuid() { Loading services/java/com/android/server/ProfileManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ public class ProfileManagerService extends IProfileManager.Stub { /* enforce a matchup between profile and notification group, which not only * works by UUID, but also by name for backwards compatibility */ for (ProfileGroup pg : profile.getProfileGroups()) { if (pg.matches(group)) { if (pg.matches(group, defaultGroup)) { return; } } Loading Loading
core/java/android/app/Profile.java +6 −2 Original line number Diff line number Diff line Loading @@ -83,10 +83,14 @@ public class Profile implements Parcelable { /** @hide */ public void addProfileGroup(ProfileGroup value) { profileGroups.put(value.getUuid(), value); if (value.isDefaultGroup()) { /* we must not have more than one default group */ if (mDefaultGroup != null) { return; } mDefaultGroup = value; } profileGroups.put(value.getUuid(), value); mDirty = true; } Loading
core/java/android/app/ProfileGroup.java +18 −7 Original line number Diff line number Diff line Loading @@ -80,20 +80,31 @@ public class ProfileGroup implements Parcelable { } /** @hide */ public boolean matches(NotificationGroup group) { public boolean matches(NotificationGroup group, boolean defaultGroup) { if (mUuid.equals(group.getUuid())) { return true; } /* second try: match name for backwards compat */ /* fallback matches for backwards compatibility */ boolean matches = false; /* fallback attempt 1: match name */ if (mName != null && mName.equals(group.getName())) { matches = true; /* fallback attempt 2: match for the 'defaultGroup' flag to match the wildcard group */ } else if (mDefaultGroup && defaultGroup) { matches = true; } if (!matches) { return false; } mName = null; mUuid = group.getUuid(); mDirty = true; return true; } return false; return true; } public UUID getUuid() { Loading
services/java/com/android/server/ProfileManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ public class ProfileManagerService extends IProfileManager.Stub { /* enforce a matchup between profile and notification group, which not only * works by UUID, but also by name for backwards compatibility */ for (ProfileGroup pg : profile.getProfileGroups()) { if (pg.matches(group)) { if (pg.matches(group, defaultGroup)) { return; } } Loading