Closed boralyl closed 4 years ago
Looks very straightforward, nice work!
I'll be sure to try this out soon & merge!
Just wanted to provide an update. I compiled the apk with this branch and installed it on my nvidia shield. It's been working flawlessly for the past 20 days or so with homeassistant starting/stopping the hyperion service on my nvidia shield when the media state changes from play/standby.
Apologies for not getting around to this sooner... Since this is only a tweak to the manifest I feel alright taking your word that is functions as intended! I'll merge this now.
I'm not sure if this is working anymore. I get the following error:
❯ ./adb.exe shell am start com.abrenoch.hyperiongrabber/com.abrenoch.hyperiongrabber.common.BootActivity
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.abrenoch.hyperiongrabber/.common.BootActivity }
Exception occurred while executing 'start':
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.abrenoch.hyperiongrabber/.common.BootActivity } from null (pid=23542, uid=2000) not exported from uid 10078
at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1043)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1052)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:712)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1107)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1079)
at com.android.server.am.ActivityManagerService.startActivityAsUserWithFeature(ActivityManagerService.java:3694)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:543)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:185)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10611)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5073)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2899)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
Hey @fraser-mendeco could you give the latest beta (available in the releases section) a shot? I saw a couple issues similar to this while testing, it might be resolved already.
@abrenoch Thanks, that seems to have fixed it :)
This addresses #149 I wanted to be able to start/stop the screen recording service without any user input. This way I could use homeassistant/tasker/etc. to send an adb command when it notices media is playing on my android device then stop it when the media stops.
I've tested these changes out on both a mobile device and an android tv device and I've got it working as expected.
To start:
To stop:
The only caveat is the first time you start the service you will have to check the box so that it doesn't ask again for the permission. After that it will work w/o user interaction.