Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Setup system alarm using am failed #3990

Closed
HusniMuhammad opened this issue Jun 5, 2024 · 0 comments
Closed

[Bug]: Setup system alarm using am failed #3990

HusniMuhammad opened this issue Jun 5, 2024 · 0 comments

Comments

@HusniMuhammad
Copy link

Problem description

Setup system alarm using am failed

Possible Due to this missing permission
IMG_20240531_115037

Inspired from open-source Android app Timer+X from f-droid

Starting: Intent { act=android.intent.action.SET_ALARM (has extras) }
java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.termux.termuxam.CrossVersionReflectedMethod.invoke(CrossVersionReflectedMethod.java:175)
        at com.termux.termuxam.IActivityManager.startActivityAsUser(IActivityManager.java:250)
        at com.termux.termuxam.Am.runStart(Am.java:823)
        at com.termux.termuxam.Am.onRun(Am.java:437)
        at com.termux.termuxam.BaseCommand.run(BaseCommand.java:46)
        at com.termux.termuxam.Am.main(Am.java:120)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:410)
Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.SET_ALARM flg=0x10000000 cmp=com.google.android.deskclock/com.android.deskclock.HandleSetApiCalls (has extras) } from null (pid=27367, uid=10472) requires com.android.alarm.permission.SET_ALARM
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2374)
        at android.os.Parcel.createException(Parcel.java:2358)
        at android.os.Parcel.readException(Parcel.java:2341)
        at android.os.Parcel.readException(Parcel.java:2283)
        at android.app.IActivityManager$Stub$Proxy.startActivityAsUser(IActivityManager.java:8300)
        ... 9 more
Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1057)
        at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1030)
        at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:684)
        at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1118)
        at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1090)

Steps to reproduce the behavior.

am start -a android.intent.action.SET_ALARM --ei android.intent.extra.alarm.HOUR 7 --ei android.intent.extra.alarm.MINUTES 30  --es android.intent.extra.alarm.MESSAGE "Wake up!" --ez android.intent.extra.alarm.SKIP_UI true

What is the expected behavior?

Trigger a alarm to (system) clock app

System information

Termux App Info

APP_NAME: Termux
PACKAGE_NAME: com.termux
VERSION_NAME: 0.118.0
VERSION_CODE: 118
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: true
APK_RELEASE: Github
SIGNING_CERTIFICATE_SHA256_DIGEST: B6DA01480EEFD5FBF2CD3771B8D1021EC791304BDD6C4BF41D3FAABAD48EE5E1

Termux:API App Info

APP_NAME: Termux:API
PACKAGE_NAME: com.termux.api
VERSION_NAME: 0.50.1
VERSION_CODE: 51
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: true
APK_RELEASE: Github
SIGNING_CERTIFICATE_SHA256_DIGEST: B6DA01480EEFD5FBF2CD3771B8D1021EC791304BDD6C4BF41D3FAABAD48EE5E1

Termux:Widget App Info

APP_NAME: Termux:Widget
PACKAGE_NAME: com.termux.widget
VERSION_NAME: 0.13.0
VERSION_CODE: 13
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: true
APK_RELEASE: Github
SIGNING_CERTIFICATE_SHA256_DIGEST: B6DA01480EEFD5FBF2CD3771B8D1021EC791304BDD6C4BF41D3FAABAD48EE5E1

Device Info

Software

OS_VERSION: 4.14.193+-ab475
SDK_INT: 30
RELEASE: 11
ID: RP1A.201005.001
DISPLAY: RMX3231_11.A.123
INCREMENTAL: 475
SECURITY_PATCH: 2024-02-05
IS_DEBUGGABLE: 0
IS_TREBLE_ENABLED: true
TYPE: user
TAGS: release-keys

Hardware

MANUFACTURER: realme
BRAND: realme
MODEL: RMX3231
PRODUCT: RMX3231
BOARD: RMX3231
HARDWARE: RMX3231
DEVICE: RMX3231
SUPPORTED_ABIS: armeabi-v7a, armeabi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant