2

In previous versions of Android, one "Aquire Wakelock" by going to notifications-list, and tapping on the Termux in the list, then Aquire Wakelock is an option.

But on Android 13, there are no Termux notification to tap on at all, so how do you do it on Android 13? (observed on Samsung Galaxy S22 Ultra updated to Android 13~)

(I can theorize that Termux not showing up in the notifications list is a bug, and that the procedure is supposed to be the same, but that is just a guess)

1 Answer 1

1

The procedure for Termux to acquire wakelock on Android is still the same; through the notification.

However, since Android 13, Termux needs to have the newly introduced Notification runtime permission allowed for the app to show ("post") a notification.

Android 13 (API level 33) and higher supports a runtime permission for sending non-exempt (including Foreground Services (FGS)) notifications from an app: POST_NOTIFICATIONS.

User selects "Allow"

If the user selects the allow option, your app can do the following:

  • Send notifications. All notification channels are allowed.
  • Post notifications related to foreground services. These notifications appear in the notification drawer.

User selects "Don't allow"

If the user selects the don't allow option, your app can't send notifications unless it qualifies for an exemption. All notification channels are blocked, except for a few specific roles. This is similar to the behavior that occurs when the user manually turns off all notifications for your app in system settings.

If the notification is not shown and the app does not request permission on startup, then the user must manually enable the Notification permission from the app info (e.g. from the Android Settings, or long-pressing the app icon, etc.)

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .