Merge UnityNotificationManager and UnityNotificationManagerOreo classes into one.
We had two classes where UnityNotificationManager would provide a simulation implementation of channels, while UnityNotificationManagerOreo would override the same methods and implement real channel support. This causes more confusion than is worth, since channel support code is not that big.
Also, the current state of UnityNotificationManager where we actually have two instances and some statics is difficult to maintain and is error prone. The intent is to move away from that and two classes are a bit in a way, so another point for merging them.
Additionally move NotificationChannelWrapper and NotificationCallback into the same source file, they are very small, no real gain with that.
Lastly, querying channels was a bit optimized to avoid excessive allocations, for example return null when there are no channels and save C# size from doing several expensive JNI calls to figure that out. Added tests to cover those.
Tested on Nokia 7 Plus (10.0) and Samsung Galaxy S7 (7.0) as well as ran channel related tests on both to make sure both Oreo+ and pre-O code paths work.
Merge UnityNotificationManager and UnityNotificationManagerOreo classes into one. We had two classes where UnityNotificationManager would provide a simulation implementation of channels, while UnityNotificationManagerOreo would override the same methods and implement real channel support. This causes more confusion than is worth, since channel support code is not that big. Also, the current state of UnityNotificationManager where we actually have two instances and some statics is difficult to maintain and is error prone. The intent is to move away from that and two classes are a bit in a way, so another point for merging them.
Additionally move NotificationChannelWrapper and NotificationCallback into the same source file, they are very small, no real gain with that. Lastly, querying channels was a bit optimized to avoid excessive allocations, for example return null when there are no channels and save C# size from doing several expensive JNI calls to figure that out. Added tests to cover those.
Tested on Nokia 7 Plus (10.0) and Samsung Galaxy S7 (7.0) as well as ran channel related tests on both to make sure both Oreo+ and pre-O code paths work.