How to grant permission to "com.sec.android.app.clockpackage/.alarm.activity.AlarmCTSHandleActivity" using adb pm grant command

by Vinayak Sharma   Last Updated August 10, 2018 10:11 AM

I need to using this command to invoke google voice action intents using adb

adb shell am start -a android.intent.action.SET_ALARM

I get this error on invoking because of permission denial.

C:\Users\Admin>adb shell am start -a android.intent.action.SET_ALARM * Starting: Intent { act=android.intent.action.SET_ALARM } Security exception: Permission Denial: starting Intent { act=android.intent.action.SET_ALARM flg=0x10000000 cmp=com.sec.android.app.clockpackage/.alarm.activity.AlarmCTSHandleActivity } from null (pid=3797, uid=2000) requires com.android.alarm.permission.SET_ALARM java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.SET_ALARM flg=0x10000000 cmp=com.sec.android.app.clockpackage/.alarm.activity.AlarmCTSHandleActivity } from null (pid=3797, uid=2000) requires com.android.alarm.permission.SET_ALARM at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1922) at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:630) at com.android.server.am.ActivityStarter.startActivityLocked(ActivityStarter.java:410) at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:1271) at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6054) at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:424) at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:142) at android.os.ShellCommand.exec(ShellCommand.java:96) at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:18825) at android.os.Binder.shellCommand(Binder.java:581) at android.os.Binder.onTransact(Binder.java:481) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4785) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3888) at android.os.Binder.execTransact(Binder.java:682)*

I have tried to grant the permission but it was also unsuccessful

** adb shell pm grant -a com.sec.android.app.clockpackage/.alarm.activity.AlarmCTSHandleActivity com.android.alarm.permission.SET_ALARM**

ERROR:"Bad argument: java.lang.IllegalArgumentException: Unknown package: com.sec.android.app.clockpackage/.alarm.activity.AlarmCTSHandleActivity"

+++++++++++++++++++++++++++++++++++++++++ C:\Users\Admin>adb shell pm grant -a com.sec.android.app.clockpackage com.android.alarm.permission.SET_ALARM

Operation not allowed: java.lang.SecurityException: Permission com.android.alarm.permission.SET_ALARM is not a changeable permission type.

Please help me out, I am new to android and i have just started using adb.

Thanks in advance.



Related Questions





Use Samsung or Google account for automatic backup?

Updated November 06, 2018 22:11 PM