appium / io.appium.settings

App for dealing with Android settings
Apache License 2.0
128 stars 56 forks source link

Get_Notifications returns -1 although Notifications could be read #106

Open SiNeumann opened 1 year ago

SiNeumann commented 1 year ago

Get Notifactions on some specific phones (mostly seen on Huawei, eg. P30 light) will return -1 on Broadcast, although the notifcation data could be read from device. Example see below
I saw no obvious code path which could lead to such a result.
Since broadcast completed returns -1: Appium will treat it as an error an all tests depending on this will result in error

Workaround:
Basically run the command via adb directly "adb shell am broadcast -a io.appium.settings.notifications" and interpret the result directly

Example:

Broadcasting: Intent { act=io.appium.settings.notifications flg=0x400000 } Broadcast completed: result=-1, data="{"statusBarNotifications":[{"packageName":"com.adresys.angel.angelapp","isClearable":true,"isOngoing":false,"id":5,"tag":null,"postTime":1673534390686,"isRemoved":false,"notification":{"title":"Error","bigTitle":null,"text":"Alarm channel not ready, although Internet access present","bigText":null,"tickerText":null,"subText":null,"infoText":null,"template":null},"isGroup":false,"userHandle":0,"groupKey":"0|com.adresys.angel.angelapp|5|null|10482","overrideGroupKey":null,"key":"0|com.adresys.angel.angelapp|5|null|10482"},{"packageName":"com.adresys.angel.angelapp","isClearable":false,"isOngoing":true,"id":6,"tag":null,"postTime":1673534388946,.....