This code example shows how to use the following methods:setCheckable, setChecked, setText

public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfoinfo) {
super.onInitializeAccessibilityNodeInfo(info);
// We called the super implementation to let super classes set
// appropriate info properties. Then we add our properties
// (checkable and checked) which are not supported by a super class.
info.setCheckable(true);
info.setChecked(isChecked());
// Very often you will need to add only the text on the custom view.
CharSequencetext = getText();
if (!TextUtils.isEmpty(text)) {
info.setText(text);
}
}
@Override
public void onPopulateAccessibilityEvent(AccessibilityEventevent) {
super.onPopulateAccessibilityEvent(event);
// We called the super implementation to populate its text to the
// event. Then we add our text not present in a super class.
// Very often you will need to add only the text on the custom view.

This code example shows how to use the following methods:setCheckable, setChecked, setText

AccessibilityNodeInfoinfo) {
super.onInitializeAccessibilityNodeInfo(host, info);
// We called the super implementation to let super classes set
// appropriate info properties. Then we add our properties
// (checkable and checked) which are not supported by a super class.
info.setCheckable(true);
info.setChecked(isChecked());
// Very often you will need to add only the text on the custom view.
CharSequencetext = getText();
if (!TextUtils.isEmpty(text)) {
info.setText(text);
}
}
@Override
public void onPopulateAccessibilityEvent(Viewhost, AccessibilityEventevent) {
super.onPopulateAccessibilityEvent(host, event);
// We called the super implementation to populate its text to the
// event. Then we add our text not present in a super class.
// Very often you will need to add only the text on the custom view.

This code example shows how to use the following methods:setCheckable, setChecked, setText

AccessibilityNodeInfoinfo) {
super.onInitializeAccessibilityNodeInfo(host, info);
// We called the super implementation to let super classes set
// appropriate info properties. Then we add our properties
// (checkable and checked) which are not supported by a super class.
info.setCheckable(true);
info.setChecked(isChecked());
// Very often you will need to add only the text on the custom view.
CharSequencetext = getText();
if (!TextUtils.isEmpty(text)) {
info.setText(text);
}
}
@Override
public void onPopulateAccessibilityEvent(Viewhost, AccessibilityEventevent) {
super.onPopulateAccessibilityEvent(host, event);
// We called the super implementation to populate its text to the
// event. Then we add our text not present in a super class.
// Very often you will need to add only the text on the custom view.

You can listen all the calendar notification info. How you say, you should use an AccessibilityService and switch the notification type. Then you get the package name an compare if it's from google calendar.

After doing some investigation I realized that since Facebook bought Whatsapp, they closed all public Whatsapp API and right now it's impossible to create Whatsapp message receiver, BUT there is one thing that you can do.

Create AccessibilityService:

public class MyAccessibilityService extends AccessibilityService {

@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
//here you can implement your reaction for incoming notification
//here you can find some tags that could be helpful for you
String helpful = event.getContentDescription();
//In code below you could also retrieve some helpful info from Notification
AccessibilityNodeInfo source = event.getSource();
if (source == null) {
return;
}
// Grab the parent of the view that fired the event.
AccessibilityNodeInfo rowNode = getListItemNodeInfo(source);
if (rowNode == null) {
return;
}
// Using this parent, get references to both child nodes, the label and the checkbox.
AccessibilityNodeInfo labelNode = rowNode.getChild(0);
if (labelNode == null) {
rowNode.recycle();
return;
}
AccessibilityNodeInfo completeNode = rowNode.getChild(1);
if (completeNode == null) {
rowNode.recycle();
return;
}
// Determine what the task is and whether or not it's complete, based on
// the text inside the label, and the state of the check-box.
if (rowNode.getChildCount() < 2 || !rowNode.getChild(1).isCheckable()) {
rowNode.recycle();
return;
}
CharSequence anotherInfoFromNotification = labelNode.getText();
}
@Override
public void onInterrupt() {
}