AsteroidOSSync icon indicating copy to clipboard operation
AsteroidOSSync copied to clipboard

Notification actions

Open Rudloff opened this issue 7 years ago • 4 comments

Hello,

On Android Wear, it is possible to swipe to various actions on a notification: screen2 screen3 screen4

Whereas on AsteroidOS I can't execute an action from the notification: screen

Are there any plans to support this?

Rudloff avatar Nov 12 '17 14:11 Rudloff

Hi Rudloff, No plans for this in v1.0. However I mark the issue for v1.1

FlorentRevest avatar Nov 12 '17 14:11 FlorentRevest

🧪 I made a small experiment in the onNotificationPosted function (NLService).

This snipped of Kotlin code woulde automatically reject incoming calls from Telegram X or WhatsApp:

if (notification.category == Notification.CATEGORY_CALL && notification.actions.size == 2) {
  try {
    // Cancel right away
    notification.actions.first().actionIntent.send()
    } catch (e: PendingIntent.CanceledException) {
	// TODO: Handle
    }
}

As long as all the apps are setting up their actions as reject & accept (in that order), this code should work for all apps. By performing individual tests, one could build a list of apps that don't respect this order and invert the control for them.

AlejandroHCruz avatar Aug 04 '20 15:08 AlejandroHCruz

I don't think we want to hardcode any "reject & accept" behaviours in the AsteroidOS protocols. I believe we should only forward a list of possible actions to the watch, in the order that they are shown in the Android app, and let the user click on any of those actions. Keeping a list of apps is very brittle as the app developers could just decide to swap the buttons some day. Also there is no point making this specific to two actions when we can make this generic to all actions more easily.

FlorentRevest avatar Aug 06 '20 22:08 FlorentRevest

Totally agree! Good points. Still, the way the actions are triggered would apply, it's fairly simple.


De: Florent Revest [email protected] Enviado: viernes, 7 de agosto de 2020 0:21 Para: AsteroidOS/AsteroidOSSync [email protected] CC: Alejandro H. Cruz [email protected]; Comment [email protected] Asunto: Re: [AsteroidOS/AsteroidOSSync] Notification actions (#33)

I don't think we want to hardcode any "reject & accept" behaviours in the AsteroidOS protocols. I believe we should only forward a list of possible actions to the watch, in the order that they are shown in the Android app, and let the user click on any of those actions. Keeping a list of apps is very brittle as the app developers could just decide to swap the buttons some day. Also there is no point making this specific to two actions when we can make this generic to all actions more easily.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/AsteroidOS/AsteroidOSSync/issues/33#issuecomment-670220122, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAOQVOXXSZISA3OY3MZFPRTR7MUHNANCNFSM4EDLUPYA.

AlejandroHCruz avatar Aug 07 '20 11:08 AlejandroHCruz