StatusBarNotification.java revision 4f91efdf421e354ee2033ed640e4150cf0cef21b
118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato/*
218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * Copyright (C) 2008 The Android Open Source Project
318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato *
418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * Licensed under the Apache License, Version 2.0 (the "License");
518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * you may not use this file except in compliance with the License.
618e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * You may obtain a copy of the License at
718e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato *
818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato *      http://www.apache.org/licenses/LICENSE-2.0
918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato *
1018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * Unless required by applicable law or agreed to in writing, software
1118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * distributed under the License is distributed on an "AS IS" BASIS,
1218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * See the License for the specific language governing permissions and
1418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato * limitations under the License.
1518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato */
1618e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
175feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandlerpackage android.service.notification;
1818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
1918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onoratoimport android.app.Notification;
2018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onoratoimport android.os.Parcel;
2118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onoratoimport android.os.Parcelable;
22f02b60aa4f367516f40cf3d60fffae0c6fe3e1b8Dianne Hackbornimport android.os.UserHandle;
2318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
242561b0b10a55841a08e0e1d467e73e10b1bf256dDaniel Sandler/**
25fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler * Class encapsulating a Notification. Sent by the NotificationManagerService to clients including
265feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler * the status bar and any {@link android.service.notification.NotificationListenerService}s.
272561b0b10a55841a08e0e1d467e73e10b1bf256dDaniel Sandler */
2818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onoratopublic class StatusBarNotification implements Parcelable {
29e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final String pkg;
30e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final int id;
31e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final String tag;
325feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler
33e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final int uid;
34e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final String basePkg;
35e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final int initialPid;
366d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey    // TODO: make this field private and move callers to an accessor that
376d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey    // ensures sourceUser is applied.
385feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler
39e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final Notification notification;
40e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final UserHandle user;
41e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final long postTime;
426d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey
43e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    private final int score;
445feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler
455feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler    /** This is temporarily needed for the JB MR1 PDK.
465feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler     * @hide */
476d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey    @Deprecated
486d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey    public StatusBarNotification(String pkg, int id, String tag, int uid, int initialPid, int score,
496d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey            Notification notification) {
506d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey        this(pkg, id, tag, uid, initialPid, score, notification, UserHandle.OWNER);
5118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    }
5218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
535feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler    /** @hide */
546d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey    public StatusBarNotification(String pkg, int id, String tag, int uid, int initialPid, int score,
556d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey            Notification notification, UserHandle user) {
56fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        this(pkg, null, id, tag, uid, initialPid, score, notification, user);
57fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler    }
58fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler
595feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler    /** @hide */
60fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler    public StatusBarNotification(String pkg, String basePkg, int id, String tag, int uid,
61fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler            int initialPid, int score, Notification notification, UserHandle user) {
62fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        this(pkg, basePkg, id, tag, uid, initialPid, score, notification, user,
63fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler                System.currentTimeMillis());
64fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler    }
65fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler
66fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler    public StatusBarNotification(String pkg, String basePkg, int id, String tag, int uid,
67fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler            int initialPid, int score, Notification notification, UserHandle user,
68fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler            long postTime) {
6918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        if (pkg == null) throw new NullPointerException();
7018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        if (notification == null) throw new NullPointerException();
7118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
7218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.pkg = pkg;
73fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        this.basePkg = pkg;
7418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.id = id;
7518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.tag = tag;
769d39d0cb361c5d3bba04a6bacf299be2162a6e92Dianne Hackborn        this.uid = uid;
779d39d0cb361c5d3bba04a6bacf299be2162a6e92Dianne Hackborn        this.initialPid = initialPid;
782561b0b10a55841a08e0e1d467e73e10b1bf256dDaniel Sandler        this.score = score;
7918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.notification = notification;
806d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey        this.user = user;
816d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey        this.notification.setUser(user);
82fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler
83fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        this.postTime = postTime;
8418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    }
8518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
8618e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    public StatusBarNotification(Parcel in) {
8718e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.pkg = in.readString();
88fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        this.basePkg = in.readString();
8918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.id = in.readInt();
9018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        if (in.readInt() != 0) {
9118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            this.tag = in.readString();
9218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        } else {
9318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            this.tag = null;
9418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        }
959d39d0cb361c5d3bba04a6bacf299be2162a6e92Dianne Hackborn        this.uid = in.readInt();
969d39d0cb361c5d3bba04a6bacf299be2162a6e92Dianne Hackborn        this.initialPid = in.readInt();
972561b0b10a55841a08e0e1d467e73e10b1bf256dDaniel Sandler        this.score = in.readInt();
9818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.notification = new Notification(in);
996d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey        this.user = UserHandle.readFromParcel(in);
100fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        this.notification.setUser(this.user);
101fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        this.postTime = in.readLong();
10218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    }
10318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
10418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    public void writeToParcel(Parcel out, int flags) {
10518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        out.writeString(this.pkg);
106fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        out.writeString(this.basePkg);
10718e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        out.writeInt(this.id);
10818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        if (this.tag != null) {
10918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            out.writeInt(1);
11018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            out.writeString(this.tag);
11118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        } else {
11218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            out.writeInt(0);
11318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        }
1149d39d0cb361c5d3bba04a6bacf299be2162a6e92Dianne Hackborn        out.writeInt(this.uid);
1159d39d0cb361c5d3bba04a6bacf299be2162a6e92Dianne Hackborn        out.writeInt(this.initialPid);
1162561b0b10a55841a08e0e1d467e73e10b1bf256dDaniel Sandler        out.writeInt(this.score);
11718e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        this.notification.writeToParcel(out, flags);
1186d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey        user.writeToParcel(out, flags);
119fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler
120fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        out.writeLong(this.postTime);
12118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    }
12218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
12318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    public int describeContents() {
12418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        return 0;
12518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    }
12618e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
12718e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    public static final Parcelable.Creator<StatusBarNotification> CREATOR
12818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            = new Parcelable.Creator<StatusBarNotification>()
12918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    {
13018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        public StatusBarNotification createFromParcel(Parcel parcel)
13118e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        {
13218e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            return new StatusBarNotification(parcel);
13318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        }
13418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
13518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        public StatusBarNotification[] newArray(int size)
13618e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        {
13718e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato            return new StatusBarNotification[size];
13818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato        }
13918e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    };
14018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
1411a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler    /**
1421a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler     * @hide
1431a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler     */
1441a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler    public StatusBarNotification cloneLight() {
1451a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler        final Notification no = new Notification();
1461a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler        this.notification.cloneInto(no, false); // light copy
1471a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler        return new StatusBarNotification(this.pkg, this.basePkg,
1481a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler                this.id, this.tag, this.uid, this.initialPid,
1491a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler                this.score, no, this.user, this.postTime);
1501a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler    }
1511a497d3a2b1496c12949e47e55f8e46d8f585be5Daniel Sandler
1526d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey    @Override
15318e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    public StatusBarNotification clone() {
154fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        return new StatusBarNotification(this.pkg, this.basePkg,
155fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler                this.id, this.tag, this.uid, this.initialPid,
156fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler                this.score, this.notification.clone(), this.user, this.postTime);
15718e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    }
15818e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
1596d51571835737c7502a2e111ee9dc2527ebad984Jeff Sharkey    @Override
16018e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    public String toString() {
161fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler        return String.format(
162fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler                "StatusBarNotification(pkg=%s user=%s id=%d tag=%s score=%d: %s)",
163fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler                this.pkg, this.user, this.id, this.tag,
164fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler                this.score, this.notification);
16518e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato    }
16618e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato
1675feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler    /** Convenience method to check the notification's flags for
1685feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler     * {@link Notification#FLAG_ONGOING_EVENT}.
1695feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler     */
170e345fff2f80947b0a821f6674c197a02b7bff08eJoe Onorato    public boolean isOngoing() {
171e345fff2f80947b0a821f6674c197a02b7bff08eJoe Onorato        return (notification.flags & Notification.FLAG_ONGOING_EVENT) != 0;
172e345fff2f80947b0a821f6674c197a02b7bff08eJoe Onorato    }
173e345fff2f80947b0a821f6674c197a02b7bff08eJoe Onorato
1745feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler    /** Convenience method to check the notification's flags for
1755feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler     * either {@link Notification#FLAG_ONGOING_EVENT} or
1765feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler     * {@link Notification#FLAG_NO_CLEAR}.
1775feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandler     */
1785dd1169ae95162383acf00d1e9a1886e0ac99a70Joe Onorato    public boolean isClearable() {
1795dd1169ae95162383acf00d1e9a1886e0ac99a70Joe Onorato        return ((notification.flags & Notification.FLAG_ONGOING_EVENT) == 0)
1805dd1169ae95162383acf00d1e9a1886e0ac99a70Joe Onorato                && ((notification.flags & Notification.FLAG_NO_CLEAR) == 0);
1815dd1169ae95162383acf00d1e9a1886e0ac99a70Joe Onorato    }
182b9301c3a686df05950710ec80e2cd691c3082871Daniel Sandler
183b9301c3a686df05950710ec80e2cd691c3082871Daniel Sandler    /** Returns a userHandle for the instance of the app that posted this notification. */
184b9301c3a686df05950710ec80e2cd691c3082871Daniel Sandler    public int getUserId() {
18550cdf7c3069eb2cf82acbad73c322b7a5f3af4b1Dianne Hackborn        return this.user.getIdentifier();
186b9301c3a686df05950710ec80e2cd691c3082871Daniel Sandler    }
187e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
188e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** The package of the app that posted the notification. */
1894f91efdf421e354ee2033ed640e4150cf0cef21bDaniel Sandler    public String getPackageName() {
190e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return pkg;
191e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
192e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
193e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** The id supplied to {@link android.app.NotificationManager#notify}. */
194e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public int getId() {
195e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return id;
196e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
197e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
198e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** The tag supplied to {@link android.app.NotificationManager#notify}, or null if no tag
199e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler     * was specified. */
200e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public String getTag() {
201e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return tag;
202e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
203e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
204e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** The notifying app's calling uid. @hide */
205e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public int getUid() {
206e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return uid;
207e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
208e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
209e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** The notifying app's base package. @hide */
210e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public String getBasePkg() {
211e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return basePkg;
212e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
213e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
214e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** @hide */
215e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public int getInitialPid() {
216e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return initialPid;
217e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
218e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
219e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** The {@link android.app.Notification} supplied to
220e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler     * {@link android.app.NotificationManager#notify}. */
221e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public Notification getNotification() {
222e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return notification;
223e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
224e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
225e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /**
226e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler     * The {@link android.os.UserHandle} for whom this notification is intended.
227e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler     * @hide
228e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler     */
229e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public UserHandle getUser() {
230e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return user;
231e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
232e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
233e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** The time (in {@link System#currentTimeMillis} time) the notification was posted,
234e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler     * which may be different than {@link android.app.Notification#when}.
235e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler     */
236e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public long getPostTime() {
237e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return postTime;
238e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
239e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler
240e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    /** @hide */
241e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    public int getScore() {
242e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler        return score;
243e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler    }
24418e69dfc7235f8a4bfe257f9d1c43539049a22ceJoe Onorato}
245