19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/*
29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Copyright (C) 2007 The Android Open Source Project
39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
59066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * you may not use this file except in compliance with the License.
69066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * You may obtain a copy of the License at
79066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
99066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS,
129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * See the License for the specific language governing permissions and
149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * limitations under the License.
159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage android.app;
189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.content.Context;
209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Handler;
219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.IBinder;
2269ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkeyimport android.os.RemoteException;
239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.ServiceManager;
244120375d46091df8527bb701882e056fbb0e6b06Dianne Hackbornimport android.os.UserHandle;
259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.util.Log;
269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/**
289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Class to notify the user of events that happen.  This is how you tell
299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the user that something has happened in the background. {@more}
309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Notifications can take different forms:
329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <ul>
339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *      <li>A persistent icon that goes in the status bar and is accessible
349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *          through the launcher, (when the user selects it, a designated Intent
359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *          can be launched),</li>
369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *      <li>Turning on or flashing LEDs on the device, or</li>
379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *      <li>Alerting the user by flashing the backlight, playing a sound,
389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *          or vibrating.</li>
399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * </ul>
409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <p>
42b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * Each of the notify methods takes an int id parameter and optionally a
43b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * {@link String} tag parameter, which may be {@code null}.  These parameters
44b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * are used to form a pair (tag, id), or ({@code null}, id) if tag is
45b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * unspecified.  This pair identifies this notification from your app to the
46b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * system, so that pair should be unique within your app.  If you call one
47b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * of the notify methods with a (tag, id) pair that is currently active and
48b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * a new set of notification parameters, it will be updated.  For example,
49b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * if you pass a new status bar icon, the old icon in the status bar will
50b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * be replaced with the new one.  This is also the same tag and id you pass
51b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * to the {@link #cancel(int)} or {@link #cancel(String, int)} method to clear
52b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne * this notification.
539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <p>
559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * You do not instantiate this class directly; instead, retrieve it through
569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.content.Context#getSystemService}.
579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
58558459fe85f56f29a6ed6a4d0adb4a0bd6665884Joe Fernandez * <div class="special reference">
59558459fe85f56f29a6ed6a4d0adb4a0bd6665884Joe Fernandez * <h3>Developer Guides</h3>
60558459fe85f56f29a6ed6a4d0adb4a0bd6665884Joe Fernandez * <p>For a guide to creating notifications, read the
61558459fe85f56f29a6ed6a4d0adb4a0bd6665884Joe Fernandez * <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Status Bar Notifications</a>
62558459fe85f56f29a6ed6a4d0adb4a0bd6665884Joe Fernandez * developer guide.</p>
63558459fe85f56f29a6ed6a4d0adb4a0bd6665884Joe Fernandez * </div>
64558459fe85f56f29a6ed6a4d0adb4a0bd6665884Joe Fernandez *
659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @see android.app.Notification
669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @see android.content.Context#getSystemService
679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic class NotificationManager
699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project{
709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    private static String TAG = "NotificationManager";
7143a17654cf4bfe7f1ec22bd8b7b32daccdf27c09Joe Onorato    private static boolean localLOGV = false;
729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    private static INotificationManager sService;
749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
75d8a43f61680bacf0d4b52a03ff3c7a07307377fcDianne Hackborn    /** @hide */
76d8a43f61680bacf0d4b52a03ff3c7a07307377fcDianne Hackborn    static public INotificationManager getService()
779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    {
789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        if (sService != null) {
799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return sService;
809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        IBinder b = ServiceManager.getService("notification");
829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sService = INotificationManager.Stub.asInterface(b);
839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return sService;
849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /*package*/ NotificationManager(Context context, Handler handler)
879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    {
889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        mContext = context;
899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
9169ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey    /** {@hide} */
9269ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey    public static NotificationManager from(Context context) {
9369ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey        return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
9469ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey    }
9569ddab4575ff684c533c995e07ca15fe18543fc0Jeff Sharkey
969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
97e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * Post a notification to be shown in the status bar. If a notification with
98e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * the same id has already been posted by your application and has not yet been canceled, it
99e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * will be replaced by the updated information.
1009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     *
1019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * @param id An identifier for this notification unique within your
1029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     *        application.
103e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * @param notification A {@link Notification} object describing what to show the user. Must not
104e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     *        be null.
1059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void notify(int id, Notification notification)
1079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    {
1086ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana        notify(null, id, notification);
1096ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    }
1106ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana
1116ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    /**
112e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * Post a notification to be shown in the status bar. If a notification with
113e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * the same tag and id has already been posted by your application and has not yet been
114e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * canceled, it will be replaced by the updated information.
1156ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana     *
116b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne     * @param tag A string identifier for this notification.  May be {@code null}.
117b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne     * @param id An identifier for this notification.  The pair (tag, id) must be unique
118b97c34948e5fcb765f46d655bbf358d06ef89a67Peter Collingbourne     *        within your application.
119e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     * @param notification A {@link Notification} object describing what to
120e97a3bce3c91d76b623f57d309f7bf74947494daDaniel Sandler     *        show the user. Must not be null.
1216ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana     */
1226ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    public void notify(String tag, int id, Notification notification)
1236ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    {
1249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        int[] idOut = new int[1];
1259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        INotificationManager service = getService();
1269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        String pkg = mContext.getPackageName();
12765c4a2b26cd8776b0927e9b0e07ecf53bd31b627Jeff Sharkey        if (notification.sound != null) {
12865c4a2b26cd8776b0927e9b0e07ecf53bd31b627Jeff Sharkey            notification.sound = notification.sound.getCanonicalUri();
12965c4a2b26cd8776b0927e9b0e07ecf53bd31b627Jeff Sharkey        }
1309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        if (localLOGV) Log.v(TAG, pkg + ": notify(" + id + ", " + notification + ")");
1319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        try {
1324120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn            service.enqueueNotificationWithTag(pkg, tag, id, notification, idOut,
1334120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn                    UserHandle.myUserId());
1344120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn            if (id != idOut[0]) {
1354120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn                Log.w(TAG, "notify: id corrupted: sent " + id + ", got back " + idOut[0]);
1364120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn            }
1374120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        } catch (RemoteException e) {
1384120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        }
1394120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    }
1404120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn
1414120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    /**
1424120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn     * @hide
1434120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn     */
1444120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    public void notifyAsUser(String tag, int id, Notification notification, UserHandle user)
1454120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    {
1464120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        int[] idOut = new int[1];
1474120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        INotificationManager service = getService();
1484120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        String pkg = mContext.getPackageName();
14965c4a2b26cd8776b0927e9b0e07ecf53bd31b627Jeff Sharkey        if (notification.sound != null) {
15065c4a2b26cd8776b0927e9b0e07ecf53bd31b627Jeff Sharkey            notification.sound = notification.sound.getCanonicalUri();
15165c4a2b26cd8776b0927e9b0e07ecf53bd31b627Jeff Sharkey        }
1524120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        if (localLOGV) Log.v(TAG, pkg + ": notify(" + id + ", " + notification + ")");
1534120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        try {
1544120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn            service.enqueueNotificationWithTag(pkg, tag, id, notification, idOut,
1554120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn                    user.getIdentifier());
1569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            if (id != idOut[0]) {
1579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                Log.w(TAG, "notify: id corrupted: sent " + id + ", got back " + idOut[0]);
1589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            }
1599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        } catch (RemoteException e) {
1609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
1619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
1629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Cancel a previously shown notification.  If it's transient, the view
1659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * will be hidden.  If it's persistent, it will be removed from the status
1669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * bar.
1679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void cancel(int id)
1699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    {
1706ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana        cancel(null, id);
1716ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    }
1726ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana
1736ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    /**
1746ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana     * Cancel a previously shown notification.  If it's transient, the view
1756ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana     * will be hidden.  If it's persistent, it will be removed from the status
1766ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana     * bar.
1776ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana     */
1786ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    public void cancel(String tag, int id)
1796ecaff15836581336b1e8fad6ac42f3ff4a13544Fred Quintana    {
1809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        INotificationManager service = getService();
1819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        String pkg = mContext.getPackageName();
1829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        if (localLOGV) Log.v(TAG, pkg + ": cancel(" + id + ")");
1839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        try {
1844120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn            service.cancelNotificationWithTag(pkg, tag, id, UserHandle.myUserId());
1854120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        } catch (RemoteException e) {
1864120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        }
1874120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    }
1884120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn
1894120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    /**
1904120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn     * @hide
1914120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn     */
1924120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    public void cancelAsUser(String tag, int id, UserHandle user)
1934120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn    {
1944120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        INotificationManager service = getService();
1954120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        String pkg = mContext.getPackageName();
1964120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        if (localLOGV) Log.v(TAG, pkg + ": cancel(" + id + ")");
1974120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn        try {
1984120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn            service.cancelNotificationWithTag(pkg, tag, id, user.getIdentifier());
1999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        } catch (RemoteException e) {
2009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
2019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
2029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
2039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
2049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Cancel all previously shown notifications. See {@link #cancel} for the
2059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * detailed behavior.
2069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
2079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void cancelAll()
2089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    {
2099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        INotificationManager service = getService();
2109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        String pkg = mContext.getPackageName();
2119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        if (localLOGV) Log.v(TAG, pkg + ": cancelAll()");
2129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        try {
2134120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn            service.cancelAllNotifications(pkg, UserHandle.myUserId());
2149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        } catch (RemoteException e) {
2159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
2169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
2179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
2189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    private Context mContext;
2199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project}
220