Arunabh Das
Arunabh Das

Reputation: 14392

In AOSP 4.2.2 what private APIs in NotificationManager can be used to list all system notifications?

If I am compiling AOSP 4.2.2 from source, what private APIs in NotificationManager can I use to display system notifications?

Upvotes: 1

Views: 322

Answers (1)

nandeesh
nandeesh

Reputation: 24820

You can use the below api.

 private INotificationManager mNoMan;

 mNoMan = INotificationManager.Stub.asInterface(
              ServiceManager.getService(Context.NOTIFICATION_SERVICE));


StatusBarNotification[] notis = mNoMan.getActiveNotifications(mContext.getPackageName());

You need this permission

android.permission.ACCESS_NOTIFICATIONS

Upvotes: 2

Related Questions