鴻蒙OS INotificationSubscriber

2022-10-11 09:47 更新

INotificationSubscriber

@Deprecatedpublic interface INotificationSubscriberextends IRemoteBroker

已棄用。 此更改從 API 版本 5 開始生效。此 API 僅在高級(jí)通知系統(tǒng)中使用,不對(duì)外部系統(tǒng)開放。

Since:

1

字段摘要

修飾符和類型 字段 描述
static String DESCRIPTOR 已棄用。
static int NOTIFICATION_CONNECTED 已棄用。
static int NOTIFICATION_DISCONNECT 已棄用。
static int NOTIFICATION_DISTURB_MODE_CHANGE 已棄用。
static int NOTIFICATION_POSTED 已棄用。
static int NOTIFICATION_REMOVED 已棄用。
static int NOTIFICATION_UPDATE 已棄用。

方法總結(jié)

修飾符和類型 方法 描述
void onDisturbModeChange(int disturbMode) 已棄用。
void onNotificationPosted(NotificationRequest info) 已棄用。
void onNotificationPosted(NotificationRequest info, NotificationSortingMap sortingMap) 已棄用。
void onNotificationRankingUpdate(NotificationSortingMap sortingMap) 已棄用。
void onNotificationRemoved(NotificationRequest info) 已棄用。
void onNotificationRemoved(NotificationRequest info, NotificationSortingMap sortingMap, int deleteReason) 已棄用。
void onSubscribeConnected() 已棄用。
void onSubscribeDisConnected() 已棄用。
從接口 ohos.rpc.IRemoteBroker 繼承的方法
asObject

字段詳細(xì)信息

DESCRIPTOR

@Deprecated static final String DESCRIPTOR

已棄用。

唯一標(biāo)識(shí)遠(yuǎn)程過(guò)程調(diào)用 (RPC) 對(duì)象。

Since:

1

NOTIFICATION_CONNECTED

@Deprecated static final int NOTIFICATION_CONNECTED

已棄用。

表示訂閱者已連接到 ANS。 此常量用于調(diào)用 onSubscribeConnected() 方法。

Since:

1

NOTIFICATION_DISCONNECT

@Deprecated static final int NOTIFICATION_DISCONNECT

已棄用。

表示訂閱者與 ANS 斷開連接。 此常量用于調(diào)用 onSubscribeDisConnected() 方法。

Since:

1

NOTIFICATION_DISTURB_MODE_CHANGE

@Deprecated static final int NOTIFICATION_DISTURB_MODE_CHANGE

已棄用。

表示請(qǐng)勿打擾模式類型更改。 此常量用于調(diào)用 onDisturbModeChange(int) 方法。

Since:

4

NOTIFICATION_POSTED

@Deprecated static final int NOTIFICATION_POSTED

已棄用。

表示訂閱者成功接收到通知。 該常量用于調(diào)用 onNotificationPosted(ohos.event.notification.NotificationRequest) 方法。

Since:

1

NOTIFICATION_REMOVED

@Deprecated static final int NOTIFICATION_REMOVED

已棄用。

表示訂閱者收到的通知被移除。 該常量用于調(diào)用 onNotificationRemoved(ohos.event.notification.NotificationRequest) 方法。

Since:

1

NOTIFICATION_UPDATE

@Deprecated static final int NOTIFICATION_UPDATE

已棄用。

表示通知的排名信息發(fā)生變化。 該常量用于調(diào)用 onNotificationRankingUpdate(ohos.event.notification.NotificationSortingMap) 方法。

Since:

1

方法詳情

onNotificationPosted

@Deprecated void onNotificationPosted(NotificationRequest info) throws RemoteException

已棄用。

當(dāng)訂閱者收到新通知時(shí)回調(diào)。

參數(shù):

參數(shù)名稱 參數(shù)描述
info 表示接收到的 NotificationRequest 對(duì)象。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

1

onNotificationPosted

@Deprecated void onNotificationPosted(NotificationRequest info, NotificationSortingMap sortingMap) throws RemoteException

已棄用。

當(dāng)訂閱者收到新通知時(shí)回調(diào)。

參數(shù):

參數(shù)名稱 參數(shù)描述
info 表示接收到的 NotificationRequest 對(duì)象。
sortingMap 表示當(dāng)前訂閱者獲取通知排名信息所使用的排序圖。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

2

onNotificationRemoved

@Deprecated void onNotificationRemoved(NotificationRequest info) throws RemoteException

已棄用。

刪除通知時(shí)回調(diào)。

參數(shù):

參數(shù)名稱 參數(shù)描述
info 表示已移除的 NotificationRequest 對(duì)象。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

1

onNotificationRemoved

@Deprecated void onNotificationRemoved(NotificationRequest info, NotificationSortingMap sortingMap, int deleteReason) throws RemoteException

已棄用。

刪除通知時(shí)回調(diào)。

參數(shù):

參數(shù)名稱 參數(shù)描述
info 表示已移除的 NotificationRequest 對(duì)象。
sortingMap 表示當(dāng)前訂閱者獲取通知排名信息所使用的排序圖。
deleteReason 表示刪除的原因。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

2

onNotificationRankingUpdate

@Deprecated void onNotificationRankingUpdate(NotificationSortingMap sortingMap) throws RemoteException

已棄用。

當(dāng)前通知的排名信息發(fā)生變化時(shí)回調(diào)。

參數(shù):

參數(shù)名稱 參數(shù)描述
sortingMap 表示用于獲取通知排名信息的排序圖。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

1

onSubscribeConnected

@Deprecated void onSubscribeConnected() throws RemoteException

已棄用。

當(dāng)訂閱者連接到高級(jí)通知服務(wù) (ANS) 時(shí)回調(diào)。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

1

onSubscribeDisConnected

@Deprecated void onSubscribeDisConnected() throws RemoteException

已棄用。

當(dāng)訂閱者與 ANS 斷開連接時(shí)回調(diào)。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

1

onDisturbModeChange

@Deprecated void onDisturbModeChange(int disturbMode) throws RemoteException

已棄用。

當(dāng)請(qǐng)勿打擾模式類型更改時(shí)調(diào)用。

參數(shù):

參數(shù)名稱 參數(shù)描述
disturbMode 指示當(dāng)前的請(qǐng)勿打擾模式類型。

Throws:

Throw名稱 Throw描述
RemoteException 如果發(fā)生 IPC 異常,則拋出此異常。

Since:

4

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)