Pipe through attributeId to notification app-op am: e4b03b589f
Change-Id: I8f9e553a0ecfcd3f332a9ec09cf8b74131c840b4
This commit is contained in:
committed by
Automerger Merge Worker
commit
53ace23998
@@ -123,10 +123,14 @@ interface INotificationManager
|
|||||||
// INotificationListener method.
|
// INotificationListener method.
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
StatusBarNotification[] getActiveNotifications(String callingPkg);
|
StatusBarNotification[] getActiveNotifications(String callingPkg);
|
||||||
|
StatusBarNotification[] getActiveNotificationsWithAttribution(String callingPkg,
|
||||||
|
String callingAttributionTag);
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count, boolean includeSnoozed);
|
StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count, boolean includeSnoozed);
|
||||||
|
StatusBarNotification[] getHistoricalNotificationsWithAttribution(String callingPkg,
|
||||||
|
String callingAttributionTag, int count, boolean includeSnoozed);
|
||||||
|
|
||||||
NotificationHistory getNotificationHistory(String callingPkg);
|
NotificationHistory getNotificationHistory(String callingPkg, String callingAttributionTag);
|
||||||
|
|
||||||
void registerListener(in INotificationListener listener, in ComponentName component, int userid);
|
void registerListener(in INotificationListener listener, in ComponentName component, int userid);
|
||||||
void unregisterListener(in INotificationListener listener, int userid);
|
void unregisterListener(in INotificationListener listener, int userid);
|
||||||
|
|||||||
@@ -3637,6 +3637,15 @@ public class NotificationManagerService extends SystemService {
|
|||||||
handleSavePolicyFile();
|
handleSavePolicyFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #getActiveNotificationsWithAttribution(String, String)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@Override
|
||||||
|
public StatusBarNotification[] getActiveNotifications(String callingPkg) {
|
||||||
|
return getActiveNotificationsWithAttribution(callingPkg, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System-only API for getting a list of current (i.e. not cleared) notifications.
|
* System-only API for getting a list of current (i.e. not cleared) notifications.
|
||||||
*
|
*
|
||||||
@@ -3644,7 +3653,8 @@ public class NotificationManagerService extends SystemService {
|
|||||||
* @returns A list of all the notifications, in natural order.
|
* @returns A list of all the notifications, in natural order.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public StatusBarNotification[] getActiveNotifications(String callingPkg) {
|
public StatusBarNotification[] getActiveNotificationsWithAttribution(String callingPkg,
|
||||||
|
String callingAttributionTag) {
|
||||||
// enforce() will ensure the calling uid has the correct permission
|
// enforce() will ensure the calling uid has the correct permission
|
||||||
getContext().enforceCallingOrSelfPermission(
|
getContext().enforceCallingOrSelfPermission(
|
||||||
android.Manifest.permission.ACCESS_NOTIFICATIONS,
|
android.Manifest.permission.ACCESS_NOTIFICATIONS,
|
||||||
@@ -3654,7 +3664,8 @@ public class NotificationManagerService extends SystemService {
|
|||||||
int uid = Binder.getCallingUid();
|
int uid = Binder.getCallingUid();
|
||||||
|
|
||||||
// noteOp will check to make sure the callingPkg matches the uid
|
// noteOp will check to make sure the callingPkg matches the uid
|
||||||
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg)
|
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg,
|
||||||
|
callingAttributionTag, null)
|
||||||
== AppOpsManager.MODE_ALLOWED) {
|
== AppOpsManager.MODE_ALLOWED) {
|
||||||
synchronized (mNotificationLock) {
|
synchronized (mNotificationLock) {
|
||||||
tmp = new StatusBarNotification[mNotificationList.size()];
|
tmp = new StatusBarNotification[mNotificationList.size()];
|
||||||
@@ -3736,12 +3747,24 @@ public class NotificationManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System-only API for getting a list of recent (cleared, no longer shown) notifications.
|
* @deprecated Use {@link #getHistoricalNotificationsWithAttribution} instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NOTIFICATIONS)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NOTIFICATIONS)
|
||||||
public StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count,
|
public StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count,
|
||||||
boolean includeSnoozed) {
|
boolean includeSnoozed) {
|
||||||
|
return getHistoricalNotificationsWithAttribution(callingPkg, null, count,
|
||||||
|
includeSnoozed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* System-only API for getting a list of recent (cleared, no longer shown) notifications.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@RequiresPermission(android.Manifest.permission.ACCESS_NOTIFICATIONS)
|
||||||
|
public StatusBarNotification[] getHistoricalNotificationsWithAttribution(String callingPkg,
|
||||||
|
String callingAttributionTag, int count, boolean includeSnoozed) {
|
||||||
// enforce() will ensure the calling uid has the correct permission
|
// enforce() will ensure the calling uid has the correct permission
|
||||||
getContext().enforceCallingOrSelfPermission(
|
getContext().enforceCallingOrSelfPermission(
|
||||||
android.Manifest.permission.ACCESS_NOTIFICATIONS,
|
android.Manifest.permission.ACCESS_NOTIFICATIONS,
|
||||||
@@ -3751,7 +3774,8 @@ public class NotificationManagerService extends SystemService {
|
|||||||
int uid = Binder.getCallingUid();
|
int uid = Binder.getCallingUid();
|
||||||
|
|
||||||
// noteOp will check to make sure the callingPkg matches the uid
|
// noteOp will check to make sure the callingPkg matches the uid
|
||||||
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg)
|
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg,
|
||||||
|
callingAttributionTag, null)
|
||||||
== AppOpsManager.MODE_ALLOWED) {
|
== AppOpsManager.MODE_ALLOWED) {
|
||||||
synchronized (mArchive) {
|
synchronized (mArchive) {
|
||||||
tmp = mArchive.getArray(count, includeSnoozed);
|
tmp = mArchive.getArray(count, includeSnoozed);
|
||||||
@@ -3767,7 +3791,8 @@ public class NotificationManagerService extends SystemService {
|
|||||||
@Override
|
@Override
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
@RequiresPermission(android.Manifest.permission.ACCESS_NOTIFICATIONS)
|
@RequiresPermission(android.Manifest.permission.ACCESS_NOTIFICATIONS)
|
||||||
public NotificationHistory getNotificationHistory(String callingPkg) {
|
public NotificationHistory getNotificationHistory(String callingPkg,
|
||||||
|
String callingAttributionTag) {
|
||||||
// enforce() will ensure the calling uid has the correct permission
|
// enforce() will ensure the calling uid has the correct permission
|
||||||
getContext().enforceCallingOrSelfPermission(
|
getContext().enforceCallingOrSelfPermission(
|
||||||
android.Manifest.permission.ACCESS_NOTIFICATIONS,
|
android.Manifest.permission.ACCESS_NOTIFICATIONS,
|
||||||
@@ -3775,7 +3800,8 @@ public class NotificationManagerService extends SystemService {
|
|||||||
int uid = Binder.getCallingUid();
|
int uid = Binder.getCallingUid();
|
||||||
|
|
||||||
// noteOp will check to make sure the callingPkg matches the uid
|
// noteOp will check to make sure the callingPkg matches the uid
|
||||||
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg)
|
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg,
|
||||||
|
callingAttributionTag, null)
|
||||||
== AppOpsManager.MODE_ALLOWED) {
|
== AppOpsManager.MODE_ALLOWED) {
|
||||||
IntArray currentUserIds = mUserProfiles.getCurrentProfileIds();
|
IntArray currentUserIds = mUserProfiles.getCurrentProfileIds();
|
||||||
Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "notifHistoryReadHistory");
|
Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "notifHistoryReadHistory");
|
||||||
|
|||||||
Reference in New Issue
Block a user