Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

[How] can one force toasts to render as notifications in AOSP?

+0
−0

Context

Name ≈ Implementation
“Toast” Toast.makeText
“Notification” NotificationCompat.Builder

My Rationale

I ask because:

  1. As android.stackexchange.com/revisions/27612/1 explains, when an activity or service posts a toast, the user cannot remove it. They must, instead, merely wait for it to disappear. This proves problematic when infinite amounts are posted, or the duration of them is manually increased, because the user cannot click through them.

  2. As android.stackexchange.com/revisions/58288/1 explains, for those with visual accessibility deficiencies, like myself, reading them before they disappear, when the duration of their appearance isn't sufficient to (I'm merely myopic, but without my glasses, can miss them), they are easily missed. Notifications, by contrast, always exist in cmd statusbar expand-notifications and com.android.settings/.notification.history.NotificationHistoryActivity if accidentally removed from even there. [1]

    Similarly, acquiring diagnostic data for situations like github.com/tasks/tasks/issues/3952's would be easier, because dumpsys doesn't include toast information, due to its ephemerality (although this applies to discarded notifications, too, per the aforecited).

These are problems that I have frequently encountered, to severe extents. Therefore, I haven't posted this to rant; I want a solution, but if this is not remediable, I'll file an issue at issuetracker.google.com/issues/new?component=190923&template=845103.

Potential Solutions

  1. Obviously, one may modify AOSP's source. However, maintaining an OS is not a feasible endeavour for most, and no current distributions, that I know of, provide this. If the aforementioned potentially-to-be-filed ticket with Google is rejected, I'll file downstream instead.

    However, something that intercepts via adb, or even superuser permissions, would be applicable to more distributions.

  2. Alternative OSes, like postmarketOS, do not provide similarly homogenous APIs, nor as comprehensive security. Therefore, although QWidgets and wxWidgets (etcetera) might not post any toasts, GTK 4 and KDE's Kirigami QML superset do, and are not configurable. It would also be a somewhat out-of-scope “solution”, if one at all.

The Placement Of The Question

See posts/294864/history#2's citation.


  1. android.stackexchange.com/revisions/260316/2 ↩︎

History

0 comment threads

Sign up to answer this question »