Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5519,12 +5519,14 @@ package android.app { public final class NotificationChannelGroup implements android.os.Parcelable { ctor public NotificationChannelGroup(java.lang.String, java.lang.CharSequence); ctor public NotificationChannelGroup(java.lang.String, int); ctor protected NotificationChannelGroup(android.os.Parcel); method public android.app.NotificationChannelGroup clone(); method public int describeContents(); method public java.util.List<android.app.NotificationChannel> getChannels(); method public java.lang.String getId(); method public java.lang.CharSequence getName(); method public int getNameResId(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.app.NotificationChannelGroup> CREATOR; } api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5712,6 +5712,7 @@ package android.app { public final class NotificationChannelGroup implements android.os.Parcelable { ctor public NotificationChannelGroup(java.lang.String, java.lang.CharSequence); ctor public NotificationChannelGroup(java.lang.String, int); ctor protected NotificationChannelGroup(android.os.Parcel); method public void addChannel(android.app.NotificationChannel); method public android.app.NotificationChannelGroup clone(); Loading @@ -5719,6 +5720,7 @@ package android.app { method public java.util.List<android.app.NotificationChannel> getChannels(); method public java.lang.String getId(); method public java.lang.CharSequence getName(); method public int getNameResId(); method public org.json.JSONObject toJson() throws org.json.JSONException; method public void writeToParcel(android.os.Parcel, int); method public void writeXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException; api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5529,12 +5529,14 @@ package android.app { public final class NotificationChannelGroup implements android.os.Parcelable { ctor public NotificationChannelGroup(java.lang.String, java.lang.CharSequence); ctor public NotificationChannelGroup(java.lang.String, int); ctor protected NotificationChannelGroup(android.os.Parcel); method public android.app.NotificationChannelGroup clone(); method public int describeContents(); method public java.util.List<android.app.NotificationChannel> getChannels(); method public java.lang.String getId(); method public java.lang.CharSequence getName(); method public int getNameResId(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.app.NotificationChannelGroup> CREATOR; } core/java/android/app/NotificationChannelGroup.java +42 −3 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.app; import android.annotation.StringRes; import android.annotation.SystemApi; import android.net.Uri; import android.os.Parcel; Loading @@ -40,23 +41,38 @@ public final class NotificationChannelGroup implements Parcelable { private static final String TAG_GROUP = "channelGroup"; private static final String ATT_NAME = "name"; private static final String ATT_NAME_RES_ID = "name_res_id"; private static final String ATT_ID = "id"; private final String mId; private CharSequence mName; private int mNameResId = 0; private List<NotificationChannel> mChannels = new ArrayList<>(); /** * Creates a notification channel. * * @param id The id of the group. Must be unique per package. * @param name The user visible name of the group. * @param name The user visible name of the group. Unchangeable once created; use this * constructor if the group represents something user-defined that does not * need to be translated. */ public NotificationChannelGroup(String id, CharSequence name) { this.mId = id; this.mName = name; } /** * Creates a notification channel. * * @param id The id of the group. Must be unique per package. * @param nameResId String resource id of the user visible name of the group. */ public NotificationChannelGroup(String id, @StringRes int nameResId) { this.mId = id; this.mNameResId = nameResId; } protected NotificationChannelGroup(Parcel in) { if (in.readByte() != 0) { mId = in.readString(); Loading @@ -64,6 +80,7 @@ public final class NotificationChannelGroup implements Parcelable { mId = null; } mName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); mNameResId = in.readInt(); in.readParcelableList(mChannels, NotificationChannel.class.getClassLoader()); } Loading @@ -76,6 +93,7 @@ public final class NotificationChannelGroup implements Parcelable { dest.writeByte((byte) 0); } TextUtils.writeToParcel(mName, dest, flags); dest.writeInt(mNameResId); dest.writeParcelableList(mChannels, flags); } Loading @@ -93,6 +111,13 @@ public final class NotificationChannelGroup implements Parcelable { return mName; } /** * Returns the resource id of the user visible name of this group. */ public @StringRes int getNameResId() { return mNameResId; } /* * Returns the list of channels that belong to this group * Loading @@ -119,7 +144,12 @@ public final class NotificationChannelGroup implements Parcelable { out.startTag(null, TAG_GROUP); out.attribute(null, ATT_ID, getId()); if (getName() != null) { out.attribute(null, ATT_NAME, getName().toString()); } if (getNameResId() != 0) { out.attribute(null, ATT_NAME_RES_ID, Integer.toString(getNameResId())); } out.endTag(null, TAG_GROUP); } Loading @@ -132,6 +162,7 @@ public final class NotificationChannelGroup implements Parcelable { JSONObject record = new JSONObject(); record.put(ATT_ID, getId()); record.put(ATT_NAME, getName()); record.put(ATT_NAME_RES_ID, getNameResId()); return record; } Loading Loading @@ -160,6 +191,7 @@ public final class NotificationChannelGroup implements Parcelable { NotificationChannelGroup that = (NotificationChannelGroup) o; if (getNameResId() != that.getNameResId()) return false; if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) return false; if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) { return false; Loading @@ -171,13 +203,18 @@ public final class NotificationChannelGroup implements Parcelable { @Override public NotificationChannelGroup clone() { if (getName() != null) { return new NotificationChannelGroup(getId(), getName()); } else { return new NotificationChannelGroup(getId(), getNameResId()); } } @Override public int hashCode() { int result = getId() != null ? getId().hashCode() : 0; result = 31 * result + (getName() != null ? getName().hashCode() : 0); result = 31 * result + getNameResId(); result = 31 * result + (getChannels() != null ? getChannels().hashCode() : 0); return result; } Loading @@ -187,6 +224,8 @@ public final class NotificationChannelGroup implements Parcelable { return "NotificationChannelGroup{" + "mId='" + mId + '\'' + ", mName=" + mName + ", mNameResId=" + mNameResId + ", mChannels=" + mChannels + '}'; } } packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java +6 −1 Original line number Diff line number Diff line Loading @@ -154,8 +154,13 @@ public class NotificationInfo extends LinearLayout implements GutsContent { iNotificationManager.getNotificationChannelGroupForPackage( channel.getGroup(), pkg, appUid); if (notificationChannelGroup != null) { if (info != null && notificationChannelGroup.getNameResId() != 0) { groupName = pm.getText(pkg, notificationChannelGroup.getNameResId(), info); } if (notificationChannelGroup.getName() != null) { groupName = notificationChannelGroup.getName(); } } } catch (RemoteException e) { Log.e(TAG, e.toString()); } Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5519,12 +5519,14 @@ package android.app { public final class NotificationChannelGroup implements android.os.Parcelable { ctor public NotificationChannelGroup(java.lang.String, java.lang.CharSequence); ctor public NotificationChannelGroup(java.lang.String, int); ctor protected NotificationChannelGroup(android.os.Parcel); method public android.app.NotificationChannelGroup clone(); method public int describeContents(); method public java.util.List<android.app.NotificationChannel> getChannels(); method public java.lang.String getId(); method public java.lang.CharSequence getName(); method public int getNameResId(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.app.NotificationChannelGroup> CREATOR; }
api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5712,6 +5712,7 @@ package android.app { public final class NotificationChannelGroup implements android.os.Parcelable { ctor public NotificationChannelGroup(java.lang.String, java.lang.CharSequence); ctor public NotificationChannelGroup(java.lang.String, int); ctor protected NotificationChannelGroup(android.os.Parcel); method public void addChannel(android.app.NotificationChannel); method public android.app.NotificationChannelGroup clone(); Loading @@ -5719,6 +5720,7 @@ package android.app { method public java.util.List<android.app.NotificationChannel> getChannels(); method public java.lang.String getId(); method public java.lang.CharSequence getName(); method public int getNameResId(); method public org.json.JSONObject toJson() throws org.json.JSONException; method public void writeToParcel(android.os.Parcel, int); method public void writeXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException;
api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5529,12 +5529,14 @@ package android.app { public final class NotificationChannelGroup implements android.os.Parcelable { ctor public NotificationChannelGroup(java.lang.String, java.lang.CharSequence); ctor public NotificationChannelGroup(java.lang.String, int); ctor protected NotificationChannelGroup(android.os.Parcel); method public android.app.NotificationChannelGroup clone(); method public int describeContents(); method public java.util.List<android.app.NotificationChannel> getChannels(); method public java.lang.String getId(); method public java.lang.CharSequence getName(); method public int getNameResId(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.app.NotificationChannelGroup> CREATOR; }
core/java/android/app/NotificationChannelGroup.java +42 −3 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.app; import android.annotation.StringRes; import android.annotation.SystemApi; import android.net.Uri; import android.os.Parcel; Loading @@ -40,23 +41,38 @@ public final class NotificationChannelGroup implements Parcelable { private static final String TAG_GROUP = "channelGroup"; private static final String ATT_NAME = "name"; private static final String ATT_NAME_RES_ID = "name_res_id"; private static final String ATT_ID = "id"; private final String mId; private CharSequence mName; private int mNameResId = 0; private List<NotificationChannel> mChannels = new ArrayList<>(); /** * Creates a notification channel. * * @param id The id of the group. Must be unique per package. * @param name The user visible name of the group. * @param name The user visible name of the group. Unchangeable once created; use this * constructor if the group represents something user-defined that does not * need to be translated. */ public NotificationChannelGroup(String id, CharSequence name) { this.mId = id; this.mName = name; } /** * Creates a notification channel. * * @param id The id of the group. Must be unique per package. * @param nameResId String resource id of the user visible name of the group. */ public NotificationChannelGroup(String id, @StringRes int nameResId) { this.mId = id; this.mNameResId = nameResId; } protected NotificationChannelGroup(Parcel in) { if (in.readByte() != 0) { mId = in.readString(); Loading @@ -64,6 +80,7 @@ public final class NotificationChannelGroup implements Parcelable { mId = null; } mName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); mNameResId = in.readInt(); in.readParcelableList(mChannels, NotificationChannel.class.getClassLoader()); } Loading @@ -76,6 +93,7 @@ public final class NotificationChannelGroup implements Parcelable { dest.writeByte((byte) 0); } TextUtils.writeToParcel(mName, dest, flags); dest.writeInt(mNameResId); dest.writeParcelableList(mChannels, flags); } Loading @@ -93,6 +111,13 @@ public final class NotificationChannelGroup implements Parcelable { return mName; } /** * Returns the resource id of the user visible name of this group. */ public @StringRes int getNameResId() { return mNameResId; } /* * Returns the list of channels that belong to this group * Loading @@ -119,7 +144,12 @@ public final class NotificationChannelGroup implements Parcelable { out.startTag(null, TAG_GROUP); out.attribute(null, ATT_ID, getId()); if (getName() != null) { out.attribute(null, ATT_NAME, getName().toString()); } if (getNameResId() != 0) { out.attribute(null, ATT_NAME_RES_ID, Integer.toString(getNameResId())); } out.endTag(null, TAG_GROUP); } Loading @@ -132,6 +162,7 @@ public final class NotificationChannelGroup implements Parcelable { JSONObject record = new JSONObject(); record.put(ATT_ID, getId()); record.put(ATT_NAME, getName()); record.put(ATT_NAME_RES_ID, getNameResId()); return record; } Loading Loading @@ -160,6 +191,7 @@ public final class NotificationChannelGroup implements Parcelable { NotificationChannelGroup that = (NotificationChannelGroup) o; if (getNameResId() != that.getNameResId()) return false; if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) return false; if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) { return false; Loading @@ -171,13 +203,18 @@ public final class NotificationChannelGroup implements Parcelable { @Override public NotificationChannelGroup clone() { if (getName() != null) { return new NotificationChannelGroup(getId(), getName()); } else { return new NotificationChannelGroup(getId(), getNameResId()); } } @Override public int hashCode() { int result = getId() != null ? getId().hashCode() : 0; result = 31 * result + (getName() != null ? getName().hashCode() : 0); result = 31 * result + getNameResId(); result = 31 * result + (getChannels() != null ? getChannels().hashCode() : 0); return result; } Loading @@ -187,6 +224,8 @@ public final class NotificationChannelGroup implements Parcelable { return "NotificationChannelGroup{" + "mId='" + mId + '\'' + ", mName=" + mName + ", mNameResId=" + mNameResId + ", mChannels=" + mChannels + '}'; } }
packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java +6 −1 Original line number Diff line number Diff line Loading @@ -154,8 +154,13 @@ public class NotificationInfo extends LinearLayout implements GutsContent { iNotificationManager.getNotificationChannelGroupForPackage( channel.getGroup(), pkg, appUid); if (notificationChannelGroup != null) { if (info != null && notificationChannelGroup.getNameResId() != 0) { groupName = pm.getText(pkg, notificationChannelGroup.getNameResId(), info); } if (notificationChannelGroup.getName() != null) { groupName = notificationChannelGroup.getName(); } } } catch (RemoteException e) { Log.e(TAG, e.toString()); } Loading