The Code A is from a sample project.
Is Code A correct?
Is Code B correct?
Is there a better way to set flags of NotificationCh