rootkiwi / an2linuxclient

Sync Android notifications encrypted to a Linux desktop
GNU General Public License v3.0
279 stars 34 forks source link

Work Profile notifications not coming through #37

Open Tycho-S opened 3 years ago

Tycho-S commented 3 years ago

Notifications from Work Profile apps are not coming through, also not selectable under the whitelist. Work Profile is a separate container for apps, managed by work on a personal phone.

I know it should be possible because other apps that handle notifications (like Gadgetbridge for connecting to smart bands) are able to show these.

It would be nice if you could also enable these somehow. I already tried enabling everything in the whitelist but it didn't help.

rootkiwi commented 3 years ago

I'm not familiar with how Work Profile works, but found this:

https://developer.android.com/work/managed-profiles#notification-listener-service

Devices with work profiles might affect how NotificationListenerService works with your app.

When your app runs in the personal profile, you might not get notifications for apps running in the work profile. By default, all personal profile apps receive callbacks but an IT admin can allowlist one or more personal profile apps that they allow to listen for notification changes. The system then blocks non-allowlisted apps. In Android 8.0 (API level 26) or later, a device policy controller (DPC) that manages a work profile might block your app from listening to the work profile's notifications using the DevicePolicyManager method setPermittedCrossProfileNotificationListeners(). Your app still receives callbacks about notifications posted in the personal profile.

Tycho-S commented 3 years ago

Sorry for taking so long to reply. But I think the main issue is that I don't see any of the work profile apps in the whitelist in the app, so I can't enable them. I could set up two instances of An2Linux though (one inside the work profile) but not in the one managed by work because they have to whitelist any app I put in there :)

You can put a work profile on your own phone using the Insular app from F-Droid. Any work profile app has a blue briefcase overlaid over the icon.

I did notice that other apps (like my smartwatch notification listener) do see all the apps. So it should be posible somehow. I checked in Insular but I don't see any way to set the CrossProfileNotificationListeners.

I'll have a google around, I don't know Android development myself but I'm very familiar with work profiles because I manage them as part of work. So I'll have a look to see if I can enable that flag somewhere! Thanks for your reply!