Supporting quick actions when possible from notifications without opening app.
Summary
This patch tries to make the app more easy to use. When there is a single device connected, two quick actions can be supported from notifications which are
- Send Files
- Run Commands
The persistent notification when touched opens the MainActivity
.
This patch adds two action buttons in the notification Send Files, Run Commands which open the
corresponding activities SendFileActivity
,RunCommandActivity
. These activities are launched with intents
carrying the device ID of the only connected device.
Action Buttons are only added when there is one device connected. This is because when multiple devices are connected, there is no clear way know on which device the user wants to perform these actions. To ask for the choice an activity with options or the MainActivity
would have to be launched which would be redundant and would not be so quick.
This is very handy to use as these two actions are very frequently used and supporting these quick actions would be great for all users.
Test Plan
Use the app normally. When doing some other task, see the notification and you'll see the action buttons.
When clicked it opens the respective Activity of the operation selected.
When Send Files clicked, it opens SendFileActivity
When Run Command clicked, it opens RunCommandActivity
When multiple devices are connected, the action buttons are not added.