Package com.aurelienpierre.sioul
Class Replies
java.lang.Object
com.aurelienpierre.sioul.Replies
A reply from your computers sent through a notification's own Reply, as
the phone's shade sends one typed under it (docs/android.md, "Replies from
your computers"; Rust's side: crates/sioul-app/src/replies.rs,
crates/sioul-core/src/replies.rs). Here: which of a notification's actions
is its Reply and which its Mark as read, found by what they mean, never by
their titles nor their places (
choose(java.util.List<com.aurelienpierre.sioul.Replies.Act>, boolean, boolean)); which may not be sent
(refusal(com.aurelienpierre.sioul.Replies.Act, boolean, boolean)); and the sending, the shade's own way (send(android.content.Context, com.aurelienpierre.sioul.Replies.Found, java.lang.String, boolean)).
Nothing else is ever sent: no Delete, Archive, Block, Call, a bot's
button nor Copy; no notification is tapped, dismissed or cancelled; no
action that would open an app on the phone. Before Android 12 nothing is
offered at all: its actions do not say what refusal(com.aurelienpierre.sioul.Replies.Act, boolean, boolean) needs.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classOne action of a notification as the choice reads it: plain data, made on the phone from a Notification.Action or a car extender's bundle (found(android.app.Notification)), by hand in android/jvm-checks/RepliesCheck.java.(package private) static final classWhat a notification offers (choose(java.util.List<com.aurelienpierre.sioul.Replies.Act>, boolean, boolean)): its Reply and its Mark as read, each null when none.(package private) static final classAn action found on the phone: what the choice reads, and what sends it. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate static final StringWhere AndroidX keeps a car extender's invisible actions in the extras (NotificationCompat.CarExtender, addInvisibleAction).private static final Stringprivate static final int[]The places, in the order they are looked in.(package private) static final intWhere an action was found: the notification's own actions, the car extender's invisible ones, the watch's.(package private) static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static List<Replies.Act> acts(List<Replies.Found> found) What the choice reads of the actions found.private static voidadd(List<Replies.Found> out, int place, Notification.Action action) One of a notification's own or a watch's actions.private static voidcar(Bundle extras, List<Replies.Found> out) A car extender's invisible actions, as AndroidX keeps them: bundles "0", "1"… each with its PendingIntent ("actionIntent"), its meaning ("semanticAction"), its title and its inputs as bundles of their own ("remoteInputs": "resultKey", "allowFreeFormInput"); an input made again here from its key, which is all the shade's filling reads of it.(package private) static Replies.Choicechoose(List<Replies.Act> acts, boolean conversation, boolean smsApp) A notification's Reply and Mark as read, by what Android says they mean, looked for in its own actions, then the car extender's, then the watch's: Reply, an action that says it is one (SEMANTIC_ACTION_REPLY) with an input that takes free text; Mark as read, one that says it is one (SEMANTIC_ACTION_MARK_AS_READ).(package private) static List<Replies.Found> A notification's actions in the three places: its own, the car extender's invisible ones, the watch's.(package private) static intWhich of the notifications listed a reply names: the one whose name is its (AppNotes.talkKey of its app and Android's key, as Rust's `replies::notice`), of this phone's own profile, never a work profile's; -1 for none.(package private) static JSONObjectnothing()What another profile's notification (a work profile's) offers your computers: nothing, since the listener never answers one (live(java.lang.String[], java.lang.String[], boolean[], java.lang.String)).(package private) static Replies.Foundof(List<Replies.Found> found, Replies.Act act) The action found for an act chosen; null for none.(package private) static JSONObjectoffer(Notification n, boolean conversation, boolean smsApp) What a notification offers a reply from your computers, for Rust (phonemsgs.rs, `Offer`): a Reply and a Mark as read there and sendable (the lock aside, which is looked at when one is sent).(package private) static Stringrefusal(Replies.Act act, boolean fill, boolean locked) Why an action may not be sent; "" when it may.(package private) static voidsend(Context context, Replies.Found found, String words, boolean fill) Sent as the phone's shade sends a reply typed under a notification (SystemUI's RemoteInputViewController): the words under its first free-text input's key, in a fill-in intent sent to the foreground's receivers, marked typed by a person (SOURCE_FREE_FORM_INPUT); a Mark as read (`fill` false), with no fill-in.
-
Field Details
-
VISIBLE
Where an action was found: the notification's own actions, the car extender's invisible ones, the watch's.- See Also:
-
CAR
- See Also:
-
WATCH
- See Also:
-
PLACES
The places, in the order they are looked in. -
CAR_EXTENSIONS
Where AndroidX keeps a car extender's invisible actions in the extras (NotificationCompat.CarExtender, addInvisibleAction).- See Also:
-
CAR_INVISIBLE
- See Also:
-
-
Constructor Details
-
Replies
private Replies()
-
-
Method Details
-
choose
A notification's Reply and Mark as read, by what Android says they mean, looked for in its own actions, then the car extender's, then the watch's: Reply, an action that says it is one (SEMANTIC_ACTION_REPLY) with an input that takes free text; Mark as read, one that says it is one (SEMANTIC_ACTION_MARK_AS_READ). The first place that has one decides; two in that place ("Reply" and "Reply privately" in a group, two Mark as read) would be a guess: none, never the first by order. When no action says it is a Reply, the one action whose input takes free text, said nothing of, in a notification Android takes as a conversation or the phone's SMS app's; two such would be a guess: none. Never one the system added (contextual), never one found by its title or its place. Pure: android/jvm-checks/RepliesCheck.java. -
refusal
Why an action may not be sent; "" when it may. "none": there is none; "activity": it would open an app on the phone; "closed": a Reply (`fill`) whose PendingIntent is immutable; "locked": its app asks for an unlocked phone and the phone is locked. Pure: android/jvm-checks/RepliesCheck.java. -
live
Which of the notifications listed a reply names: the one whose name is its (AppNotes.talkKey of its app and Android's key, as Rust's `replies::notice`), of this phone's own profile, never a work profile's; -1 for none. Pure: android/jvm-checks/RepliesCheck.java. -
acts
What the choice reads of the actions found. -
of
The action found for an act chosen; null for none. -
found
A notification's actions in the three places: its own, the car extender's invisible ones, the watch's. None before Android 12. -
add
One of a notification's own or a watch's actions. -
car
A car extender's invisible actions, as AndroidX keeps them: bundles "0", "1"… each with its PendingIntent ("actionIntent"), its meaning ("semanticAction"), its title and its inputs as bundles of their own ("remoteInputs": "resultKey", "allowFreeFormInput"); an input made again here from its key, which is all the shade's filling reads of it. -
offer
What a notification offers a reply from your computers, for Rust (phonemsgs.rs, `Offer`): a Reply and a Mark as read there and sendable (the lock aside, which is looked at when one is sent).- Throws:
JSONException
-
nothing
What another profile's notification (a work profile's) offers your computers: nothing, since the listener never answers one (live(java.lang.String[], java.lang.String[], boolean[], java.lang.String)).- Throws:
JSONException
-
send
static void send(Context context, Replies.Found found, String words, boolean fill) throws PendingIntent.CanceledException Sent as the phone's shade sends a reply typed under a notification (SystemUI's RemoteInputViewController): the words under its first free-text input's key, in a fill-in intent sent to the foreground's receivers, marked typed by a person (SOURCE_FREE_FORM_INPUT); a Mark as read (`fill` false), with no fill-in. No start of an activity is asked for. Throws when the intent is spent or cancelled: its notification is gone.- Throws:
PendingIntent.CanceledException
-