Debian Codegraph @

core/java/android/service/notification/NotificationRankingUpdate.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package android.service.notification;
17
18 import android.annotation.Nullable;
19 import android.os.Parcel;
20 import android.os.Parcelable;
21
22 /**
23 * @hide
24 */
25 public class NotificationRankingUpdate implements Parcelable {
26 private final NotificationListenerService.RankingMap mRankingMap;
27
28 public NotificationRankingUpdate(NotificationListenerService.Ranking[] rankings) {
29 mRankingMap = new NotificationListenerService.RankingMap(rankings);
30 }
31
32 public NotificationRankingUpdate(Parcel in) {
33 mRankingMap = in.readParcelable(getClass().getClassLoader(), android.service.notification.NotificationListenerService.RankingMap.class);
34 }
35
36 public NotificationListenerService.RankingMap getRankingMap() {
37 return mRankingMap;
38 }
39
40 @Override
41 public int describeContents() {
42 return 0;
43 }
44
45 @Override
46 public boolean equals(@Nullable Object o) {
47 if (this == o) return true;
48 if (o == null || getClass() != o.getClass()) return false;
49
50 NotificationRankingUpdate other = (NotificationRankingUpdate) o;
51 return mRankingMap.equals(other.mRankingMap);
52 }
53
54 @Override
55 public void writeToParcel(Parcel out, int flags) {
56 out.writeParcelable(mRankingMap, flags);
57 }
58
59 public static final @android.annotation.NonNull Parcelable.Creator<NotificationRankingUpdate> CREATOR
60 = new Parcelable.Creator<NotificationRankingUpdate>() {
61 public NotificationRankingUpdate createFromParcel(Parcel parcel) {
62 return new NotificationRankingUpdate(parcel);
63 }
64
65 public NotificationRankingUpdate[] newArray(int size) {
66 return new NotificationRankingUpdate[size];
67 }
68 };
69 }